Fix the Documentation build under ModelingToolkit v11 - #68
Open
ChrisRackauckas-Claude wants to merge 2 commits into
Open
Fix the Documentation build under ModelingToolkit v11#68ChrisRackauckas-Claude wants to merge 2 commits into
ChrisRackauckas-Claude wants to merge 2 commits into
Conversation
The Documentation build has been failing since MTK v11 became resolvable in the docs environment: the component DSL moved to SciCompDSL.jl, solvers are no longer re-exported by DifferentialEquations v8, `missing_variable_defaults` and `defaults` were removed, several standard-library components changed their constructor signatures, and symbolic defaults are now bindings rather than initial conditions. This updates the lecture examples to the current APIs so `makedocs` runs every `@example` block again, instead of capping MTK to v9. The hydraulic debugging model in lecture 6 is rewritten in the same functional `ODESystem` style used by the rest of that lecture, and its flattened variable names use `_` instead of the `₊` namespace separator, which MTK now strips defaults from. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
The Documentation workflow has been red since MTK v11 became resolvable in
docs/Project.toml(the v9 cap from #64 was undone by the dependency bump in #65). Rather than capping again, this migrates the lecture examples to the current APIs. Root causes, in order of how many blocks they broke:@mtkmodel/@connectorcomponent DSL now lives inSciCompDSL.jl, so lecture 1 needsusing SciCompDSL.DifferentialEquationsv8 no longer re-exports the solvers and initialization algorithms used here, soNewtonRaphson,DFBDF,ImplicitEuler,ShampineCollocationInitandNLNewtonneedNonlinearSolve,OrdinaryDiffEqBDF,OrdinaryDiffEqSDIRKandOrdinaryDiffEqNonlinearSolve.ModelingToolkit.missing_variable_defaultsandModelingToolkit.defaultswere removed; problems now take a symbolic operating-point map, and defaults are split intobindingsandinitial_conditions.@variables x(t) = x₀is now a binding, which cannot be overridden by a lateru0. Where the lectures deliberately override those states (restarting from a previous solve), the values are passed via theinitial_conditionskeyword instead.MTKStandardLibraryconstructor changes:Massno longer takesv,MassFlowno longer takesp_int,Opentakesp, andHydraulicPortno longer takesp_int.sol.destatsis nowsol.stats, and integer indexing of a solution (sol[2]) is element-wise, so the state after one step issol.u[2].₊(the namespace separator) silently lose their defaults, so the hydraulic debugging model in lecture 6 uses_instead. That model is also rewritten in the functionalODESystemstyle already used by the rest of the lecture, since@mtkmodel Systemnow collides withModelingToolkit.System.The
Volumecomponent that lecture 6 already carried locally is now also used by lecture 2, whoseIsothermalCompressible.Volumeusage no longer matches the library version.Test plan
julia --project=docs docs/make.jlequivalent run locally (Documenter 1.17, MTK v11.40, MTKStandardLibrary v2.29.7): all pages expand, no@example/@replfailures and no Documenter errors.linkcheckwas disabled locally since the sandbox has no outbound network; CI still runs it.Pkg.resolve()ondocs/succeeds with the updated compat bounds.Made with Cursor