Skip to content

Replace deprecated PDESystem accessors with qualified get_ivs/get_dvs#1036

Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:fix/replace-deprecated-pdesystem-accessors
Mar 23, 2026
Merged

Replace deprecated PDESystem accessors with qualified get_ivs/get_dvs#1036
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:fix/replace-deprecated-pdesystem-accessors

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Summary

  • Replaces deprecated pde_system.indvars / pde_system.depvars with ModelingToolkit.get_ivs(pde_system) / ModelingToolkit.get_dvs(pde_system) in all three call sites (discretize.jl and both methods in neural_adapter.jl)
  • Uses module-qualified calls (ModelingToolkit.get_ivs) because NeuralPDE's selective import (using ModelingToolkit: ModelingToolkit, PDESystem, ...) does not bring get_ivs/get_dvs into scope

Context

Supersedes #1034 which correctly identified the deprecation warnings but used unqualified get_ivs()/get_dvs() calls, causing UndefVarError in all PDE-related tests. The functions are auto-generated in ModelingToolkitBase from SYS_PROPS and exported from ModelingToolkit, but not available unqualified in NeuralPDE's module namespace due to the selective import on line 39 of NeuralPDE.jl.

Test plan

  • Verified ModelingToolkit.get_ivs(sys) === getfield(sys, :ivs) and ModelingToolkit.get_dvs(sys) === getfield(sys, :dvs) — semantically identical to the deprecated accessors
  • Tested discretize() on a sample PDE system with the patched code — completes without error
  • Runic formatting check passes on both changed files

🤖 Generated with Claude Code

…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>
@ChrisRackauckas ChrisRackauckas merged commit bbb609a into SciML:master Mar 23, 2026
28 of 36 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