Replace deprecated PDESystem accessors with qualified get_ivs/get_dvs#1036
Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom Mar 23, 2026
Conversation
…r calls Use ModelingToolkit.get_ivs() and ModelingToolkit.get_dvs() instead of the deprecated pde_system.indvars and pde_system.depvars property accessors. The accessors must be module-qualified because NeuralPDE's selective import (using ModelingToolkit: ModelingToolkit, PDESystem, ...) does not bring get_ivs/get_dvs into the module namespace. Fixes all three call sites: symbolic_discretize in discretize.jl and both get_loss_function_neural_adapter methods in neural_adapter.jl. Supersedes SciML#1034 which used unqualified get_ivs/get_dvs causing UndefVarError in all PDE-related tests. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 tasks
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
pde_system.indvars/pde_system.depvarswithModelingToolkit.get_ivs(pde_system)/ModelingToolkit.get_dvs(pde_system)in all three call sites (discretize.jland both methods inneural_adapter.jl)ModelingToolkit.get_ivs) because NeuralPDE's selective import (using ModelingToolkit: ModelingToolkit, PDESystem, ...) does not bringget_ivs/get_dvsinto scopeContext
Supersedes #1034 which correctly identified the deprecation warnings but used unqualified
get_ivs()/get_dvs()calls, causingUndefVarErrorin all PDE-related tests. The functions are auto-generated inModelingToolkitBasefromSYS_PROPSand exported fromModelingToolkit, but not available unqualified in NeuralPDE's module namespace due to the selective import on line 39 ofNeuralPDE.jl.Test plan
ModelingToolkit.get_ivs(sys) === getfield(sys, :ivs)andModelingToolkit.get_dvs(sys) === getfield(sys, :dvs)— semantically identical to the deprecated accessorsdiscretize()on a sample PDE system with the patched code — completes without error🤖 Generated with Claude Code