-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw an error if structural simplification is applied twice (take 2) #3035
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,8 +144,8 @@ function level1() | |
eqs = [D(x) ~ p1 * x - p2 * x * y | ||
D(y) ~ -p3 * y + p4 * x * y] | ||
|
||
sys = structural_simplify(ODESystem( | ||
eqs, t, tspan = (0, 3.0), name = :sys, parameter_dependencies = [y0 => 2p4])) | ||
sys = structural_simplify(complete(ODESystem( | ||
eqs, t, tspan = (0, 3.0), name = :sys, parameter_dependencies = [y0 => 2p4]))) | ||
prob = ODEProblem{true, SciMLBase.FullSpecialize}(sys) | ||
end | ||
|
||
|
@@ -158,8 +158,8 @@ function level2() | |
eqs = [D(x) ~ p1 * x - p23[1] * x * y | ||
D(y) ~ -p23[2] * y + p4 * x * y] | ||
|
||
sys = structural_simplify(ODESystem( | ||
eqs, t, tspan = (0, 3.0), name = :sys, parameter_dependencies = [y0 => 2p4])) | ||
sys = structural_simplify(complete(ODESystem( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the whole point of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But they don't use the indexing, and they immediately call structural simplify here which would set complete itself There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am just saying calling complete before is valid use and should be tested. |
||
eqs, t, tspan = (0, 3.0), name = :sys, parameter_dependencies = [y0 => 2p4]))) | ||
prob = ODEProblem{true, SciMLBase.FullSpecialize}(sys) | ||
end | ||
|
||
|
@@ -172,8 +172,8 @@ function level3() | |
eqs = [D(x) ~ p1 * x - p23[1] * x * y | ||
D(y) ~ -p23[2] * y + p4 * x * y] | ||
|
||
sys = structural_simplify(ODESystem( | ||
eqs, t, tspan = (0, 3.0), name = :sys, parameter_dependencies = [y0 => 2p4])) | ||
sys = structural_simplify(complete(ODESystem( | ||
eqs, t, tspan = (0, 3.0), name = :sys, parameter_dependencies = [y0 => 2p4]))) | ||
prob = ODEProblem{true, SciMLBase.FullSpecialize}(sys) | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,6 +251,7 @@ end | |
0 ~ z - cos(x), | ||
0 ~ x * y] | ||
@named ns = NonlinearSystem(eqs, [x, y, z], []) | ||
ns = complete(ns) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? |
||
vs = [unknowns(ns); parameters(ns)] | ||
ss_mtk = structural_simplify(ns) | ||
prob = NonlinearProblem(ss_mtk, vs .=> 1.0) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,62 +32,57 @@ end | |
@safetestset "Dynamic Quantities Test" include("dq_units.jl") | ||
@safetestset "Unitful Quantities Test" include("units.jl") | ||
@safetestset "Mass Matrix Test" include("mass_matrix.jl") | ||
@safetestset "SteadyStateSystem Test" include("steadystatesystems.jl") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are the tests moved back? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change just got reverted with your PR. |
||
@safetestset "SDESystem Test" include("sdesystem.jl") | ||
@safetestset "DDESystem Test" include("dde.jl") | ||
@safetestset "NonlinearSystem Test" include("nonlinearsystem.jl") | ||
@safetestset "InitializationSystem Test" include("initializationsystem.jl") | ||
@safetestset "Guess Propagation" include("guess_propagation.jl") | ||
@safetestset "Hierarchical Initialization Equations" include("hierarchical_initialization_eqs.jl") | ||
@safetestset "PDE Construction Test" include("pde.jl") | ||
@safetestset "JumpSystem Test" include("jumpsystem.jl") | ||
@safetestset "Constraints Test" include("constraints.jl") | ||
@safetestset "Reduction Test" include("reduction.jl") | ||
@safetestset "Split Parameters Test" include("split_parameters.jl") | ||
@safetestset "StaticArrays Test" include("static_arrays.jl") | ||
@safetestset "Components Test" include("components.jl") | ||
@safetestset "Model Parsing Test" include("model_parsing.jl") | ||
@safetestset "print_tree" include("print_tree.jl") | ||
@safetestset "Error Handling" include("error_handling.jl") | ||
@safetestset "StructuralTransformations" include("structural_transformation/runtests.jl") | ||
@safetestset "State Selection Test" include("state_selection.jl") | ||
@safetestset "Symbolic Event Test" include("symbolic_events.jl") | ||
@safetestset "Stream Connect Test" include("stream_connectors.jl") | ||
@safetestset "Domain Connect Test" include("domain_connectors.jl") | ||
@safetestset "Lowering Integration Test" include("lowering_solving.jl") | ||
@safetestset "Test Big System Usage" include("bigsystem.jl") | ||
@safetestset "Dependency Graph Test" include("dep_graphs.jl") | ||
@safetestset "Function Registration Test" include("function_registration.jl") | ||
@safetestset "Precompiled Modules Test" include("precompile_test.jl") | ||
@safetestset "Variable Utils Test" include("variable_utils.jl") | ||
@safetestset "Variable Metadata Test" include("test_variable_metadata.jl") | ||
@safetestset "DAE Jacobians Test" include("dae_jacobian.jl") | ||
@safetestset "Jacobian Sparsity" include("jacobiansparsity.jl") | ||
@safetestset "Modelingtoolkitize Test" include("modelingtoolkitize.jl") | ||
@safetestset "OptimizationSystem Test" include("optimizationsystem.jl") | ||
@safetestset "FuncAffect Test" include("funcaffect.jl") | ||
@safetestset "Constants Test" include("constants.jl") | ||
@safetestset "Parameter Dependency Test" include("parameter_dependencies.jl") | ||
@safetestset "Generate Custom Function Test" include("generate_custom_function.jl") | ||
@safetestset "Initial Values Test" include("initial_values.jl") | ||
@safetestset "Discrete System" include("discrete_system.jl") | ||
@safetestset "Equation Type Accessors Test" include("equation_type_accessors.jl") | ||
@safetestset "Equations with complex values" include("complex.jl") | ||
end | ||
end | ||
|
||
if GROUP == "All" || GROUP == "InterfaceII" | ||
@testset "InterfaceII" begin | ||
@safetestset "Variable Utils Test" include("variable_utils.jl") | ||
@safetestset "Variable Metadata Test" include("test_variable_metadata.jl") | ||
@safetestset "OptimizationSystem Test" include("optimizationsystem.jl") | ||
@safetestset "Discrete System" include("discrete_system.jl") | ||
@safetestset "SteadyStateSystem Test" include("steadystatesystems.jl") | ||
@safetestset "SDESystem Test" include("sdesystem.jl") | ||
@safetestset "DDESystem Test" include("dde.jl") | ||
@safetestset "NonlinearSystem Test" include("nonlinearsystem.jl") | ||
@safetestset "PDE Construction Test" include("pde.jl") | ||
@safetestset "JumpSystem Test" include("jumpsystem.jl") | ||
@safetestset "print_tree" include("print_tree.jl") | ||
@safetestset "Constraints Test" include("constraints.jl") | ||
end | ||
end | ||
|
||
if GROUP == "All" || GROUP == "SymbolicIndexingInterface" | ||
if GROUP == "All" || GROUP == "InterfaceI" || GROUP == "SymbolicIndexingInterface" | ||
@safetestset "SymbolicIndexingInterface test" include("symbolic_indexing_interface.jl") | ||
@safetestset "SciML Problem Input Test" include("sciml_problem_inputs.jl") | ||
@safetestset "MTKParameters Test" include("mtkparameters.jl") | ||
end | ||
|
||
if GROUP == "All" || GROUP == "Extended" | ||
@safetestset "Test Big System Usage" include("bigsystem.jl") | ||
if GROUP == "All" || GROUP == "InterfaceII" | ||
println("C compilation test requires gcc available in the path!") | ||
@safetestset "C Compilation Test" include("ccompile.jl") | ||
@testset "Distributed Test" include("distributed.jl") | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just reverted together. I can add them back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to not delete the tests...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3037