From 62cb42936ac855c20fd1bf8a773d7f67c4a3ec6f Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 25 Jun 2026 16:24:15 -0400 Subject: [PATCH] Declare documented public API with the public keyword 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 Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ArrayInterface.jl | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/ArrayInterface.jl b/src/ArrayInterface.jl index 05231120..0b2593a4 100644 --- a/src/ArrayInterface.jl +++ b/src/ArrayInterface.jl @@ -982,4 +982,35 @@ function has_trivial_array_constructor(::Type{T}, args...) where T applicable(convert, T, args...) end +# Declare the documented, user-facing API as `public` so downstream packages can +# reference these names without ExplicitImports non-public allow-lists. The +# `public` keyword only parses on Julia 1.11+, so the declaration is gated and +# `eval`'d to keep the source loadable on the package's older compat floor. +@static if VERSION >= v"1.11.0-DEV.469" + eval(Expr(:public, + # conversions + :aos_to_soa, :promote_eltype, :restructure, :safevec, + :has_trivial_array_constructor, + # indexing traits + :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, :device, + # allowed indexing + :allowed_getindex, :allowed_setindex!, + # indexing type buffers + :ArrayIndex, :GetIndex, :SetIndex!, + # linear algebra + :zeromatrix, :undefmatrix, :issingular, :bunchkaufman_instance, + :cholesky_instance, :ldlt_instance, :lu_instance, :qr_instance, + :svd_instance, + # sparse arrays + :isstructured, :findstructralnz, :has_sparsestruct, :fast_matrix_colors, + :matrix_colors, + # wrapping + :is_forwarding_wrapper, :buffer, :parent_type, + # tuples + :flatten_tuples, :map_tuple_type)) +end + end # module