Skip to content

Fix docs build: import OptimizationFunction and AutoForwardDiff explicitly - #1070

Merged
baggepinnen merged 1 commit into
masterfrom
docs/fix-optimization-imports
Sep 8, 2026
Merged

baggepinnen merged 1 commit into
masterfrom
docs/fix-optimization-imports

Conversation

@baggepinnen

@baggepinnen baggepinnen commented Sep 8, 2026

Copy link
Copy Markdown
Member

The Documentation workflow has been failing on master since July 31 and on open PRs since.

Cause

The current failure is in docs/src/examples/automatic_differentiation.md:

UndefVarError: `OptimizationFunction` not defined in `Main.__atexample__named__autodiff`

OptimizationIpopt v1.4 (SciML/Optimization.jl#1286, merged 2026-08-02) curated its public API and no longer re-exports the Optimization API. The example only did using OptimizationIpopt, so OptimizationFunction, OptimizationProblem, solve and OptimizationIpopt.AutoForwardDiff are no longer available.

The earlier July failure on master was a different, transient issue: DelayDiffEq v6.1.0 resolved together with an incompatible OrdinaryDiffEqCore v4.11.0, making every lsim on a delay system throw. Newer registry versions resolve compatibly now, and those pages pass in today's CI runs and locally.

Fix

Import the missing names from the packages that define them, without loading Optimization.jl:

  • using SciMLBase: OptimizationFunction, OptimizationProblem, solve
  • using ADTypes: AutoForwardDiff

Both packages are already dependencies of OptimizationIpopt, so this adds nothing to the load time. They are added to docs/Project.toml so they can be loaded directly.

Verification

Instantiated the docs environment the same way the workflow does (resolves to OptimizationIpopt v1.4.1, SciMLBase v3.53.1, ADTypes v1.24.0) and ran every @example block of automatic_differentiation.md, delay_systems.md, smith_predictor.md and zoh.md in order. All pass.

🤖 Generated with Claude Code

…citly

OptimizationIpopt v1.4 stopped re-exporting the Optimization API, so
OptimizationFunction, OptimizationProblem, solve and AutoForwardDiff are no
longer available from `using OptimizationIpopt` alone. Import them from
the packages that define them, SciMLBase and ADTypes. Both are already
dependencies of OptimizationIpopt, so no new package is loaded.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@baggepinnen
baggepinnen force-pushed the docs/fix-optimization-imports branch from 118aa9f to 0d5b3be Compare September 8, 2026 05:21
@baggepinnen baggepinnen changed the title Fix docs build: load Optimization explicitly in the autodiff example Fix docs build: import OptimizationFunction and AutoForwardDiff explicitly Sep 8, 2026
@JuliaControlBot

Copy link
Copy Markdown

This is an automated message.
Plots were compared to references. 4/11 images have changed, see differences below.
After pulling this PR, please update the reference images by creating a PR to ControlExamplePlots.jl here.

Difference Reference Image New Image
✔️ 0.0 Reference New
✔️ 0.0 Reference New
✔️ 0.0 Reference New
✔️ 0.0 Reference New

@JuliaControlBot

Copy link
Copy Markdown

This is an automated message.
Plots were compared to references. 4/11 images have changed, see differences below.
After pulling this PR, please update the reference images by creating a PR to ControlExamplePlots.jl here.

Difference Reference Image New Image
✔️ 0.0 Reference New
✔️ 0.0 Reference New
✔️ 0.0 Reference New
✔️ 0.0 Reference New

@baggepinnen
baggepinnen merged commit 66e30e5 into master Sep 8, 2026
4 checks passed
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.63%. Comparing base (4784e94) to head (0d5b3be).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1070      +/-   ##
==========================================
+ Coverage   87.94%   91.63%   +3.68%     
==========================================
  Files          42       42              
  Lines        5649     5714      +65     
==========================================
+ Hits         4968     5236     +268     
+ Misses        681      478     -203     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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