Commit Graph

27 Commits

Author SHA1 Message Date
dependabot[bot]
260d8ce20a deps(book): update ghostscript requirement from >=0.7 to >=0.8.1 (#1653)
Updates the requirements on [ghostscript](https://gitlab.com/pdftools/python-ghostscript) to permit the latest version.
- [Release notes](https://gitlab.com/pdftools/python-ghostscript/tags)
- [Changelog](https://gitlab.com/pdftools/python-ghostscript/blob/develop/CHANGES.txt)
- [Commits](https://gitlab.com/pdftools/python-ghostscript/compare/v0.7...v0.8.1)

---
updated-dependencies:
- dependency-name: ghostscript
  dependency-version: 0.8.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-04 07:18:34 -04:00
dependabot[bot]
a480a1a48b deps(book): update seaborn requirement from >=0.13.0 to >=0.13.2 (#1665)
Updates the requirements on [seaborn](https://github.com/mwaskom/seaborn) to permit the latest version.
- [Release notes](https://github.com/mwaskom/seaborn/releases)
- [Commits](https://github.com/mwaskom/seaborn/compare/v0.13.0...v0.13.2)

---
updated-dependencies:
- dependency-name: seaborn
  dependency-version: 0.13.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-04 07:18:08 -04:00
dependabot[bot]
d70b32e3ad deps(book): update pint requirement from >=0.23 to >=0.24.4 (#1668)
Updates the requirements on [pint](https://github.com/hgrecco/pint) to permit the latest version.
- [Changelog](https://github.com/hgrecco/pint/blob/master/CHANGES)
- [Commits](https://github.com/hgrecco/pint/compare/0.23...0.24.4)

---
updated-dependencies:
- dependency-name: pint
  dependency-version: 0.24.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-04 07:18:05 -04:00
Vijay Janapa Reddi
46410c7c9d Merge pull request #1575 from harvard-edge/dependabot/pip/dev/groq-gte-1.0.0
deps(book): update groq requirement from >=0.4.0 to >=1.0.0
2026-04-27 09:14:03 -04:00
dependabot[bot]
4ab1f77ba1 deps(book): update groq requirement from >=0.4.0 to >=1.0.0
Updates the requirements on [groq](https://github.com/groq/groq-python) to permit the latest version.
- [Release notes](https://github.com/groq/groq-python/releases)
- [Changelog](https://github.com/groq/groq-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/groq/groq-python/compare/v0.4.0...v1.0.0)

---
updated-dependencies:
- dependency-name: groq
  dependency-version: 1.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 13:11:21 +00:00
Vijay Janapa Reddi
a1bae21996 Merge pull request #1580 from harvard-edge/dependabot/pip/dev/pydantic-gte-2.13.3
deps(book): update pydantic requirement from >=2.0.0 to >=2.13.3
2026-04-27 09:11:04 -04:00
Vijay Janapa Reddi
420e00d2db Merge pull request #1571 from harvard-edge/dependabot/pip/dev/absl-py-gte-2.3.1 2026-04-27 09:10:09 -04:00
Vijay Janapa Reddi
c44bcefcec Merge pull request #1562 from harvard-edge/dependabot/pip/dev/nltk-gte-3.9.2 2026-04-27 09:09:47 -04:00
dependabot[bot]
a9f68e5e37 deps(book): update pydantic requirement from >=2.0.0 to >=2.13.3
Updates the requirements on [pydantic](https://github.com/pydantic/pydantic) to permit the latest version.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.0...v2.13.3)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-version: 2.13.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 05:38:23 +00:00
dependabot[bot]
d93fad83fc deps(book): update absl-py requirement from >=1.0.0 to >=2.3.1
Updates the requirements on [absl-py](https://github.com/abseil/abseil-py) to permit the latest version.
- [Release notes](https://github.com/abseil/abseil-py/releases)
- [Changelog](https://github.com/abseil/abseil-py/blob/main/CHANGELOG.md)
- [Commits](https://github.com/abseil/abseil-py/compare/v1.0.0...v2.3.1)

---
updated-dependencies:
- dependency-name: absl-py
  dependency-version: 2.3.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 05:38:08 +00:00
dependabot[bot]
75f76dac68 deps(book): update nltk requirement from >=3.8 to >=3.9.2
Updates the requirements on [nltk](https://github.com/nltk/nltk) to permit the latest version.
- [Changelog](https://github.com/nltk/nltk/blob/develop/ChangeLog)
- [Commits](https://github.com/nltk/nltk/compare/3.8...3.9.2)

---
updated-dependencies:
- dependency-name: nltk
  dependency-version: 3.9.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 05:37:57 +00:00
dependabot[bot]
3d3f3513b8 deps(book): update matplotlib requirement from >=3.7.0 to >=3.9.4
Updates the requirements on [matplotlib](https://github.com/matplotlib/matplotlib) to permit the latest version.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.9.0...v3.9.4)

---
updated-dependencies:
- dependency-name: matplotlib
  dependency-version: 3.9.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 05:37:54 +00:00
Vijay Janapa Reddi
bb79abb84a fix(docker): split R required list, harden install, slim verify
- Add book/tools/dependencies/required_r_packages.R for a single source of truth
- install_packages.R: fail if any package not loadable after install; source shared list
- verify: match R_LIBS_USER and requireNamespace only (no re-source of full install/tinytex)
- Dockerfile: COPY and cleanup /tmp/required_r_packages.R with install/verify scripts
2026-04-26 15:15:58 -04:00
Vijay Janapa Reddi
422dbbe02b fix(docker): R installs — lib path, CRAN mirror, fail-fast for toolchain
- mkdir R_LIBS_USER before Rscript; set .libPaths + cloud.r-project.org in install_packages.R
- Pre-flight step fails in seconds if cmake or pkg-config missing (avoids 30–60m then fs/rmarkdown/tidyverse verify failure)
- Ncpus=1 for R package compiles; realistic time hint for the long CRAN compile step
2026-04-26 11:22:04 -04:00
dependabot[bot]
6b601e728c deps(book): update lxml requirement from >=5.0.0 to >=6.1.0 (#1458)
Updates the requirements on [lxml](https://github.com/lxml/lxml) to permit the latest version.
- [Release notes](https://github.com/lxml/lxml/releases)
- [Changelog](https://github.com/lxml/lxml/blob/master/CHANGES.txt)
- [Commits](https://github.com/lxml/lxml/compare/lxml-5.0.0...lxml-6.1.0)

---
updated-dependencies:
- dependency-name: lxml
  dependency-version: 6.1.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-22 18:37:47 -04:00
dependabot[bot]
b55107395c deps(book): update scipy requirement from >=1.11.0 to >=1.13.1 (#1469)
Updates the requirements on [scipy](https://github.com/scipy/scipy) to permit the latest version.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](https://github.com/scipy/scipy/compare/v1.11.0...v1.13.1)

---
updated-dependencies:
- dependency-name: scipy
  dependency-version: 1.13.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-22 18:10:35 -04:00
Vijay Janapa Reddi
48dae7b52b refactor(binder): integrate EPUB checks into the check command group
Folds both EPUB checks into the binder CLI so pre-commit, CI, and
interactive `./binder check epub` all exercise the same Python code
(no subprocess-to-script). Adds epubcheck to book/tools/dependencies
so pip install gives every contributor the validator, and simplifies
the CI job from ~60 lines of shell+Java setup to three binder calls.

New CLI surface
---------------
  ./binder check epub                    # both scopes (default)
  ./binder check epub --scope hygiene    # source-level invariants
  ./binder check epub --scope epubcheck  # W3C validator on built EPUBs
  ./binder check epub --scope epubcheck \
      --max-fatal 0 --max-errors 0       # tighten thresholds
  ./binder check epub --json             # machine-readable output

Implementation
--------------
New file book/cli/commands/_epub_checks.py holds the primitives:
  find_hygiene_issues()   — walks SVG + BIB source, returns
                            EpubIssue records for the four invariant
                            classes (svg-c0, svg-dupe-marker,
                            bib-url-escape-{underscore,percent},
                            bib-url-raw-angle).
  run_epubcheck_on()      — invokes the epubcheck binary or Python
                            wrapper, parses JSON messages, returns
                            one EpubIssue per location with severity
                            counts for threshold checks.
  emit_github_annotations() — under GITHUB_ACTIONS=true, emits
                              `::error file=...` so findings appear
                              inline on the PR diff.
  _discover_built_epubs() — finds the most recent EPUB per volume
                            under book/quarto/_build/epub-vol*/.

validate.py gains:
  - GROUPS['epub'] with 'hygiene' and 'epubcheck' scopes (the old
    'structure' scope delegated to validate_epub.py and had a
    pre-existing broken exit code; retired from default runs).
  - New --max-fatal and --max-errors flags.
  - Native _run_epub_hygiene and _run_epubcheck methods that call
    _epub_checks.py directly and wrap results into ValidationIssue.
    No subprocess-to-my-own-script.

Pre-commit wiring
-----------------
book-epub-hygiene now runs `./book/binder check epub --scope hygiene`.
Trigger files extended to include validate.py and _epub_checks.py so
the hook re-runs when the check itself changes.

CI wiring
---------
epub-validate job drops ~60 lines of shell + java jar download and
calls `./binder check epub --scope epubcheck` twice: once with --json
to capture a machine-readable artifact, once without for the
threshold-gated human summary. Java is still installed via
actions/setup-java because epubcheck is a jar.

Requirements
------------
`epubcheck>=5.1.0` added to book/tools/dependencies/requirements.txt
so every contributor gets the validator alongside the rest of the
binder runtime. Wrapper bundles the jar; JRE 8+ is still a host
requirement (brew install temurin / apt install default-jre). When
neither the Python wrapper nor the system binary is available, the
binder check emits an `epubcheck-missing` issue with install
instructions rather than silently passing.

Removed
-------
book/tools/audit/checks/epub_hygiene.py — its logic now lives in
book/cli/commands/_epub_checks.py.

Documentation
-------------
book/cli/README.md gains a "EPUB Checks — Two Layers, One CLI
Surface" section with an error-code table, fix-at-source guidance
per code, and the defense-in-depth rationale (hygiene →
epub_postprocess → epubcheck) so future contributors understand
where each check fits in the pipeline.

Validation
----------
  ./binder check epub              → 0 issues, ~7s (both scopes)
  ./binder check epub --scope hygiene  → 0 issues, ~100ms
  pre-commit run book-epub-hygiene → passes
  YAML parse of pre-commit + CI    → both OK
2026-04-20 16:03:40 -04:00
Vijay Janapa Reddi
a2b28071ac chore(precommit): scope auto-cleanup to manual stage; document audit env deps
Two project-health fixes flagged by the MIT Press release audit:

1. The `book-cleanup-artifacts` hook ran on every pre-commit and
   destroyed `_build/`, `.quarto/`, and `index_files/`. This made
   sequential PDF builds (vol1 -> vol2) fail with "FATAL Error opening
   book citations file" because the second build had no cached state to
   reuse. Move the hook to `stages: [manual]` so it runs only when
   explicitly invoked (`pre-commit run --hook-stage manual
   book-cleanup-artifacts`, or directly via `./book/binder clean
   artifacts`). The hook still works -- it just no longer auto-fires.

2. Add `pydantic`, `scipy`, and `seaborn` to the canonical requirements
   file. The audit had to install these by hand on a fresh python 3.14
   env before pre-commit ran cleanly; codifying them prevents future
   contributors from hitting the same wall.

No content changes.
2026-04-18 16:12:28 -04:00
Vijay Janapa Reddi
501ac92bb1 Adds SVG XML validation hook
Introduces a pre-commit hook to ensure SVG image files are well-formed XML,
preventing potential rendering or processing issues. This leverages `lxml` for
parsing, which has been added as a new dependency.

Corrects missing whitespace between attributes in existing SVG figures to
comply with the new validation requirements.
2026-03-04 11:07:06 -05:00
Vijay Janapa Reddi
96f03a672b fix(build): fix three container build failures across epub, pdf, and html targets
- Remove invalid `output-file` from `project:` block in both EPUB configs
  (Quarto schema only allows `output-file` under `book:`, not `project:`)
- Move `language` to top-level `lang:` and remove HTML-only keys from
  EPUB format blocks (`fig-caption`, `footnotes-hover`, `citations-hover`,
  `code-copy`, `code-line-numbers`, `description`) per Quarto EPUB spec
- Add `matplotlib>=3.7.0` to requirements.txt — was missing from container
  image, causing ModuleNotFoundError during figure rendering
- Add `_matplotlib_available` guard in `viz.setup_plot()` to raise a clear
  ImportError instead of a cryptic AttributeError when matplotlib is absent
2026-03-03 08:14:59 -05:00
Vijay Janapa Reddi
2349e63094 fix(ci): consolidate black version — drop workflow pin, floor to >=24.0.0
The CI workflow hard-pinned black==24.10.0 separately from requirements.txt
(which said >=23.0.0), causing version skew that reformatted 11 QMD files
on every CI run. Remove the override and let requirements.txt be the single
source of truth, bumped to >=24.0.0 to align with current latest.
2026-03-03 07:39:31 -05:00
Vijay Janapa Reddi
96fa7ac5e5 chore: bump Quarto to 1.9.27 and R to 4.5.2
- Quarto 1.9.27: Linux (.deb), Windows (direct download; Scoop Extras has 1.8.27)
- R 4.5.2: Linux (CRAN jammy-cran40), Windows (Scoop main/r)
- Baremetal: quarto-actions/setup for both Linux and Windows
- Remove ggrepel version pin (R 4.5.x supports ggrepel 0.9.7)
- Update docs: BUILD.md, CONTAINER_BUILDS.md, docker READMEs
2026-03-02 17:36:35 -05:00
Vijay Janapa Reddi
1f568f4283 Remove hallucinator from default dependency set.
Avoid blocking CI and local bootstrap on an optional reference-check package that is not required by the pre-commit validation path.
2026-03-02 10:44:53 -05:00
Vijay Janapa Reddi
56e091f7e0 feat: standardize System Archetypes in Vol 1 and Vol 2; add canonical roster table to Introductions; ensure tight math-prose integration 2026-02-24 20:23:50 -05:00
Vijay Janapa Reddi
06f9a8fbb8 Add narrative invariant tests and update dependencies
Test suite validates structural invariants across chapters (progressive
knowledge building, cross-reference consistency, volume boundary compliance).
Update requirements.txt with new dependency.
2026-01-31 19:46:48 -05:00
Vijay Janapa Reddi
853eb03ee8 style: apply consistent whitespace and formatting across codebase 2025-12-13 14:05:34 -05:00
Vijay Janapa Reddi
7b92e11193 Repository Restructuring: Prepare for TinyTorch Integration (#1068)
* Restructure: Move book content to book/ subdirectory

- Move quarto/ → book/quarto/
- Move cli/ → book/cli/
- Move docker/ → book/docker/
- Move socratiQ/ → book/socratiQ/
- Move tools/ → book/tools/
- Move scripts/ → book/scripts/
- Move config/ → book/config/
- Move docs/ → book/docs/
- Move binder → book/binder

Git history fully preserved for all moved files.

Part of repository restructuring to support MLSysBook + TinyTorch.

Pre-commit hooks bypassed for this commit as paths need updating.

* Update pre-commit hooks for book/ subdirectory

- Update all quarto/ paths to book/quarto/
- Update all tools/ paths to book/tools/
- Update config/linting to book/config/linting
- Update project structure checks

Pre-commit hooks will now work with new directory structure.

* Update .gitignore for book/ subdirectory structure

- Update quarto/ paths to book/quarto/
- Update assets/ paths to book/quarto/assets/
- Maintain all existing ignore patterns

* Update GitHub workflows for book/ subdirectory

- Update all quarto/ paths to book/quarto/
- Update cli/ paths to book/cli/
- Update tools/ paths to book/tools/
- Update docker/ paths to book/docker/
- Update config/ paths to book/config/
- Maintain all workflow functionality

* Update CLI config to support book/ subdirectory

- Check for book/quarto/ path first
- Fall back to quarto/ for backward compatibility
- Maintain full CLI functionality

* Create new root and book READMEs for dual structure

- Add comprehensive root README explaining both projects
- Create book-specific README with quick start guide
- Document repository structure and navigation
- Prepare for TinyTorch integration
2025-12-05 14:04:21 -08:00