docs: document the reexported BandedMatrices API - #83
Conversation
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
|
Pushed Cause. Git checks the repo out with CRLF on Windows, and the docs section was located with a regex anchored on Fix.
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):
🤖 Generated with Claude Code |
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 FastAlmostBandedMatricesgives them and which upstream package actually owns each name.Changes
docs/src/api.md(already wired intodocs/make.jlas the "API" page) and the matching README section now give:BandedMatrix,brand,brandn), populating them (Band,BandRange,band,bandrange), querying them (bandwidth,bandwidths,colrange,rowrange), errors (BandError);Fill,Ones,ZerosandEye(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 anAlmostBandedMatrix), theBandedMatricesmodule binding itself, andsymrcm;BandandBandErrorhave no docstring upstream, which is why they sit in theapi_docs_kwargsignore list intest/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
exportblock insrc/FastAlmostBandedMatrices.jl,REEXPORTED_APIintest/qa/qa.jl, and the docs section. The Core testset "Reexported BandedMatrices API" previously checked only the exports; it now also parsesREEXPORTED_APIout oftest/qa/qa.jland the role bullets out ofdocs/src/api.mdand asserts all three are the same set. Both file reads are guarded byisfile, so the test degrades gracefully if the suite is run from a tree withoutdocs/.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.jl11 pass,qa.jl18 pass / 2 broken / 0 fail (the 2 broken are the pre-existingaqua_broken = (:ambiguities,)andei_broken = (:no_implicit_imports,))Runic --checkclean over the repoDocs were not built locally.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ