Declare documented API public (unlock downstream ExplicitImports)#491
Merged
ChrisRackauckas merged 1 commit intoJun 26, 2026
Conversation
ArrayInterface exports nothing; all of its user-facing API is accessed via `ArrayInterface.foo`. Downstream packages (SciMLStructures, NonlinearSolve, and others) therefore have to maintain ExplicitImports non-public allow-lists for names that are documented API but were never declared `public` (e.g. SciMLStructures.jl#71 ignores `restructure` and `has_trivial_array_constructor`). Declare every documented, ArrayInterface-owned API name (each carries a docstring and appears in the docs/src/*.md API pages) with the `public` keyword so those allow-lists can be dropped. The declaration is version-gated and `eval`'d because `public` only parses on Julia 1.11+ while the package floor is 1.10. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #491 +/- ##
=======================================
Coverage 60.20% 60.20%
=======================================
Files 14 14
Lines 588 588
=======================================
Hits 354 354
Misses 234 234 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ignore this PR until reviewed by @ChrisRackauckas. Opened at @ChrisRackauckas's request (a maintainer/top-contributor of ArrayInterface).
What
ArrayInterface
exports nothing — its entire user-facing API is reached viaArrayInterface.foo. As a result, downstream packages must maintain ExplicitImports non-public allow-lists for names that are documented API but were never declaredpublic. For example, SciMLStructures.jl#71 ignoresrestructureandhas_trivial_array_constructor, noting they are "documented API but ArrayInterface has not adopted thepublickeyword."This PR declares every documented, ArrayInterface-owned API name with the Julia 1.11+
publickeyword so downstream packages (SciMLStructures, NonlinearSolve, and others) can drop those allow-lists.The declaration is version-gated (
@static if VERSION >= v"1.11.0-DEV.469") andeval'd viaExpr(:public, ...)because thepublickeyword only parses on Julia 1.11+, while the package's compat floor is Julia 1.10.Selection criteria
A name was made
publiciff it (a) carries a docstring insrc/, (b) appears in thedocs/src/*.mdAPI pages, (c) is defined in ArrayInterface (not a re-export), and (d) is not already exported. The docstring set and the docs-page set were cross-referenced and match exactly (42 names). Internal helpers (underscore-prefixed,parameterless_type,stride_preserving_index, the index/device structs and type aliases, etc.) and the StaticArrayInterface-only names (known_*,stride_rank,contiguous_axis, …, which live in a separate package) were left non-public.madePublic (42)
docs/src/conversions.md):aos_to_soa,promote_eltype,restructure,safevec,has_trivial_array_constructordocs/src/indexing.md):can_avx,can_change_size,can_setindex,fast_scalar_indexing,ismutable,ndims_index,ndims_shape,defines_strides,ensures_all_unique,ensures_sorted,indices_do_not_alias,instances_do_not_alias,deviceallowed_getindex,allowed_setindex!ArrayIndex,GetIndex,SetIndex!docs/src/linearalgebra.md):zeromatrix,undefmatrix,issingular,bunchkaufman_instance,cholesky_instance,ldlt_instance,lu_instance,qr_instance,svd_instancedocs/src/sparsearrays.md):isstructured,findstructralnz,has_sparsestruct,fast_matrix_colors,matrix_colorsdocs/src/wrapping.md):is_forwarding_wrapper,buffer,parent_typedocs/src/tuples.md):flatten_tuples,map_tuple_typeskipped (with reason)
parameterless_type,__parameterless_type,stride_preserving_index(block-comment only, not a docstring),diaganyzero,noalloc_diag,_cycle,_device,_not_pointer,_new_field_positions,_fl1,_indices_do_not_alias,_defines_stridesVecAdjTrans,MatAdjTrans,UpTri,LoTri,MatrixIndex,VectorIndex,BidiagonalIndex,TridiagonalIndex,BandedMatrixIndex,ColoringAlgorithm,AbstractDevice,AbstractCPU,CPUPointer,CPUTuple,CPUIndex,CheckParent,GPU,DEFAULT_CHOLESKY_PIVOTknown_length,known_size,known_first,known_last,known_step,static_length,indices,offsets,strides,contiguous_axis,stride_rank,dense_dims— none of these exist in this package, so they were not invented.Verification (run locally)
publicblock is correctly skipped (version gate isfalse).Base.ispublic(ArrayInterface, name) == trueandBase.isexported(ArrayInterface, name) == false. The two SciMLStructures motivators (restructure,has_trivial_array_constructor) are confirmed public. Sampled internals (parameterless_type,stride_preserving_index,MatrixIndex,BidiagonalIndex,CPUPointer,diaganyzero) confirmed to remain non-public..JuliaFormatter.tomlSciML style (running the official formatter leaves the block unchanged); no bulk reformatting of unrelated code.🤖 Generated with Claude Code