Skip to content

docs: document the reexported BandedMatrices API - #83

Merged
ChrisRackauckas merged 2 commits into
mainfrom
document-banded-reexports
Aug 23, 2026
Merged

docs: document the reexported BandedMatrices API#83
ChrisRackauckas merged 2 commits into
mainfrom
document-banded-reexports

Conversation

@ChrisRackauckas

Copy link
Copy Markdown
Member

Follow-up to #82, which restored the explicit reexport of the BandedMatrices names needed for this package's documented use. #82 was merged before this docs pass landed on the branch, so it comes as its own PR.

Requirement: every reexport restoration must also document the reexported surface in the package's own docs, so a reader can see at a glance what using FastAlmostBandedMatrices gives them and which upstream package actually owns each name.

Changes

docs/src/api.md (already wired into docs/make.jl as the "API" page) and the matching README section now give:

  • the names grouped by role rather than a flat list — building the bands (BandedMatrix, brand, brandn), populating them (Band, BandRange, band, bandrange), querying them (bandwidth, bandwidths, colrange, rowrange), errors (BandError);
  • the owning package named and linked to its docs, https://juliaLinearAlgebra.github.io/BandedMatrices.jl/stable/, stating plainly that FastAlmostBandedMatrices.jl only re-exports these names and neither documents nor defines them;
  • an explicit boundary line: anything else from BandedMatrices.jl must be imported from BandedMatrices.jl directly;
  • the deliberate exclusions with reasons — the FillArrays.jl names Fill, Ones, Zeros and Eye (BandedMatrices reexports those from a dependency of its own, so passing them along would be reexporting a whole dependency chain, and none of them is needed to build an AlmostBandedMatrix), the BandedMatrices module binding itself, and symrcm;
  • a note that Band and BandError have no docstring upstream, which is why they sit in the api_docs_kwargs ignore list in test/qa/qa.jl, and that the docstring is owed by BandedMatrices.jl.

Keeping the three copies in sync

The list now lives in three places: the reexport export block in src/FastAlmostBandedMatrices.jl, REEXPORTED_API in test/qa/qa.jl, and the docs section. The Core testset "Reexported BandedMatrices API" previously checked only the exports; it now also parses REEXPORTED_API out of test/qa/qa.jl and the role bullets out of docs/src/api.md and asserts all three are the same set. Both file reads are guarded by isfile, so the test degrades gracefully if the suite is run from a tree without docs/.

No source change, no behaviour change, no version bump.

Verified

  • Pkg.test() (Core group), Julia 1.11.8 / macOS aarch64: 80 pass, 2 broken, 0 fail (was 76 pass before the 4 new sync assertions)
  • GROUP=QA Pkg.test(): alloc_tests.jl 11 pass, qa.jl 18 pass / 2 broken / 0 fail (the 2 broken are the pre-existing aqua_broken = (:ambiguities,) and ei_broken = (:no_implicit_imports,))
  • Runic --check clean over the repo
  • Both external doc links return 200

Docs were not built locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ

ChrisRackauckas and others added 2 commits August 23, 2026 18:36
Per the requirement that every reexport restoration also document the reexported
surface in the package's own docs, expand the "Reexported from BandedMatrices.jl"
section of `docs/src/api.md` (already wired into `docs/make.jl`) and mirror it in
the README:

  * names grouped by role -- building the bands, populating them, querying them,
    errors -- rather than a flat list;
  * the owning package named and linked to its docs
    (https://juliaLinearAlgebra.github.io/BandedMatrices.jl/stable/), stating
    plainly that FastAlmostBandedMatrices only re-exports these names and neither
    documents nor defines them;
  * an explicit boundary line: anything else from BandedMatrices.jl must be
    imported from BandedMatrices.jl directly;
  * the deliberate exclusions with their reasons -- the FillArrays.jl names
    `Fill`, `Ones`, `Zeros` and `Eye` (a whole dependency chain of BandedMatrices,
    none of it needed to build an `AlmostBandedMatrix`), the `BandedMatrices`
    module binding itself, and `symrcm`;
  * a note that `Band` and `BandError` carry no upstream docstring, which is why
    they sit in the `api_docs_kwargs` ignore list in `test/qa/qa.jl`, and that the
    docstring is owed by BandedMatrices.jl.

The list now lives in three places -- the `export` block in
`src/FastAlmostBandedMatrices.jl`, `REEXPORTED_API` in `test/qa/qa.jl`, and the
docs section -- so the Core testset now parses the latter two and asserts all
three are the same set, rather than only checking the exports.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
The docs/export sync assertions added in the previous commit failed on all three
Windows lanes while Linux and macOS passed. Git checks the repository out with
CRLF line endings on Windows, and the section was located with a regex anchored
on `\n\nThese names are owned`, which cannot match `\r\n\r\n`. `match` returned
`nothing`, so `@test section !== nothing` failed and the following line then
errored dereferencing `nothing`.

Verified directly: the old regex run against a CRLF copy of docs/src/api.md
returns `nothing`.

Fixes:

  * Both files are now read through a helper that normalises `\r\n` and bare
    `\r` to `\n` before anything is matched, so no pattern depends on the
    checkout's line endings.
  * The docs section is located structurally rather than by prose: from the
    `## Reexported from BandedMatrices.jl` heading to the next `## ` heading (or
    end of file), taking the first contiguous run of `  - ` bullets. That run is
    the reexported names; the second bullet list in the same section is the
    deliberate exclusions, which must not be picked up. The check no longer
    depends on the wording of any paragraph, so ordinary prose edits cannot
    break it.
  * Every lookup now reports what it was looking for and where before failing:
    the file, the heading or pattern, and for a genuine drift the symmetric
    difference between the documented names and the exports. Each result is also
    guarded so a failed lookup cannot cascade into an error on `nothing`.

The parse-the-docs approach is kept rather than downgraded to a plain
"docs mention each name" check: containment alone would not catch a name
documented in the exclusions list, nor a stale name left behind in the docs
after it was dropped from the exports.

Checked against both an LF and a synthetic CRLF copy of docs/src/api.md and
test/qa/qa.jl (both pass), and against a deliberately drifted CRLF copy with
`brandn` removed from the docs bullets, which fails with
`only_in_exports = Set([:brandn])`.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
@ChrisRackauckas

Copy link
Copy Markdown
Member Author

Pushed 3f552b7 to fix the three Windows lanes.

Cause. Git checks the repo out with CRLF on Windows, and the docs section was located with a regex anchored on \n\nThese names are owned, which cannot match \r\n\r\n. match returned nothing, @test section !== nothing failed, and the next line then errored dereferencing nothing — which is the 1 failed, 1 errored pair in the log. Confirmed directly: the old regex run against a CRLF copy of docs/src/api.md returns nothing.

Fix.

  • Both files are read through a helper that normalises \r\n and bare \r to \n before anything is matched, so nothing depends on the checkout's line endings.
  • The docs section is now located structurally instead of by prose: from the ## Reexported from BandedMatrices.jl heading to the next ## heading (or EOF), taking the first contiguous run of - bullets. That run is the reexported names; the second bullet list in the same section is the deliberate exclusions and must not be picked up. Ordinary prose edits can no longer break the check.
  • Every lookup reports what it looked for and where before failing (file, heading/pattern, and for a real drift the symmetric difference against the exports), and each result is guarded so a failed lookup cannot cascade into an error.

Kept the parse rather than downgrading to "the docs mention each name". Containment alone would not catch a name that appears only in the exclusions list, nor a stale name left in the docs after it was dropped from the exports — which is exactly the drift this test exists to catch.

Verified locally (Julia 1.11.8, macOS aarch64):

  • Pkg.test() Core: 81 pass, 2 broken, 0 fail
  • the extracted sync block against a synthetic CRLF copy of docs/src/api.md + test/qa/qa.jl: 5/5 pass (and 5/5 on the LF originals)
  • a deliberately drifted CRLF copy with brandn removed from the docs bullets fails as intended, with only_in_exports = Set([:brandn])
  • Runic --check clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ

@ChrisRackauckas
ChrisRackauckas merged commit 41fa861 into main Aug 23, 2026
16 of 17 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the document-banded-reexports branch August 23, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant