Skip to content

Mark the documented public API as public - #226

Merged
ChrisRackauckas merged 1 commit into
JuliaDiff:masterfrom
ChrisRackauckas-Claude:mark-public-api
Jul 12, 2026
Merged

ChrisRackauckas merged 1 commit into
JuliaDiff:masterfrom
ChrisRackauckas-Claude:mark-public-api

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown

Summary

FiniteDiff exports nothing and declared no public names, so every documented entry point is only reachable via qualified access (FiniteDiff.finite_difference_jacobian, etc.). On Julia 1.11+ this trips downstream ExplicitImports/Aqua qualified-access checks, which flag these as accesses to non-public names.

Concretely, this surfaced as a QA failure in SimpleBoundaryValueDiffEq.jl, where check_all_qualified_accesses_are_public reported:

- finite_difference_jacobian is not public in FiniteDiff
- finite_difference_jacobian! is not public in FiniteDiff

Change

Declare the 15 names that are rendered in the manual's @docs blocks as public:

  • finite_difference_derivative, finite_difference_derivative!
  • finite_difference_gradient, finite_difference_gradient!
  • finite_difference_jacobian, finite_difference_jacobian!
  • finite_difference_hessian, finite_difference_hessian!
  • finite_difference_jvp, finite_difference_jvp!
  • DerivativeCache, GradientCache, JacobianCache, HessianCache, JVPCache

public is a keyword only on Julia 1.11+, so it is emitted via eval(Expr(:public, ...)) guarded on VERSION to keep the source parseable on the 1.10 LTS. Names described only in prose on the "Internal Utilities" docs page (the _-prefixed helpers) are intentionally left non-public.

A test/public_api_tests.jl asserts each name is defined and, on 1.11+, marked public.

Verification

  • Loads cleanly and all 15 names test Base.ispublic == true on Julia 1.11; loads cleanly on the 1.10 LTS (guard skips the public emit).
  • Reproduced the downstream check end-to-end: with unpatched FiniteDiff, improper_qualified_accesses(SimpleBoundaryValueDiffEq) lists both finite_difference_jacobian names; with this patch dev'd in, they no longer appear. (SBVDE separately still accesses Base.Iterators.peel, which is unrelated to FiniteDiff.)

Please ignore until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

FiniteDiff exports nothing and declared no `public` names, so every
documented entry point (finite_difference_* and the *Cache types) is
only reachable via qualified access `FiniteDiff.name`. On Julia 1.11+
that trips downstream ExplicitImports/Aqua qualified-access checks,
which flag these as accesses to non-public names (e.g. the QA failure
in SimpleBoundaryValueDiffEq.jl accessing finite_difference_jacobian).

Declare the 15 names rendered in the docs' `@docs` blocks as `public`.
`public` is a keyword only on 1.11+, so it is emitted via `eval` guarded
on VERSION to keep the source parseable on the 1.10 LTS. Add a test
asserting each name is defined and, on 1.11+, marked public.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 12, 2026 07:21
@ChrisRackauckas
ChrisRackauckas merged commit 5cada92 into JuliaDiff:master Jul 12, 2026
5 of 6 checks passed
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.

2 participants