From fc87dd65ab3bbb48c604bf72fff98af228567bde Mon Sep 17 00:00:00 2001 From: Yingbo Ma Date: Wed, 3 Jan 2024 14:20:57 -0500 Subject: [PATCH] Revert "Ignore iv in `__get_unit_type`" This reverts commit 1a8b7235423a40180ad3a88a525b09e1213a4406. --- src/systems/diffeqs/odesystem.jl | 2 +- src/systems/diffeqs/sdesystem.jl | 2 +- src/systems/discrete_system/discrete_system.jl | 2 +- src/systems/jumps/jumpsystem.jl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/systems/diffeqs/odesystem.jl b/src/systems/diffeqs/odesystem.jl index c453625ac3..508cb8cfe5 100644 --- a/src/systems/diffeqs/odesystem.jl +++ b/src/systems/diffeqs/odesystem.jl @@ -163,7 +163,7 @@ struct ODESystem <: AbstractODESystem check_equations(equations(cevents), iv) end if checks == true || (checks & CheckUnits) > 0 - u = __get_unit_type(dvs, ps) + u = __get_unit_type(dvs, ps, iv) check_units(u, deqs) end new(tag, deqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, tgrad, jac, diff --git a/src/systems/diffeqs/sdesystem.jl b/src/systems/diffeqs/sdesystem.jl index abff555682..5f3f9fb00f 100644 --- a/src/systems/diffeqs/sdesystem.jl +++ b/src/systems/diffeqs/sdesystem.jl @@ -134,7 +134,7 @@ struct SDESystem <: AbstractODESystem check_equations(equations(cevents), iv) end if checks == true || (checks & CheckUnits) > 0 - u = __get_unit_type(dvs, ps) + u = __get_unit_type(dvs, ps, iv) check_units(u, deqs, neqs) end new(tag, deqs, neqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, tgrad, jac, diff --git a/src/systems/discrete_system/discrete_system.jl b/src/systems/discrete_system/discrete_system.jl index e28076eb97..dedb7bf6b3 100644 --- a/src/systems/discrete_system/discrete_system.jl +++ b/src/systems/discrete_system/discrete_system.jl @@ -103,7 +103,7 @@ struct DiscreteSystem <: AbstractTimeDependentSystem check_parameters(ps, iv) end if checks == true || (checks & CheckUnits) > 0 - u = __get_unit_type(dvs, ps, ctrls) + u = __get_unit_type(dvs, ps, iv, ctrls) check_units(u, discreteEqs) end new(tag, discreteEqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, name, diff --git a/src/systems/jumps/jumpsystem.jl b/src/systems/jumps/jumpsystem.jl index 7b7061fd61..6fe2b503e1 100644 --- a/src/systems/jumps/jumpsystem.jl +++ b/src/systems/jumps/jumpsystem.jl @@ -112,7 +112,7 @@ struct JumpSystem{U <: ArrayPartition} <: AbstractTimeDependentSystem check_parameters(ps, iv) end if checks == true || (checks & CheckUnits) > 0 - u = __get_unit_type(states, ps) + u = __get_unit_type(states, ps, iv) check_units(u, ap, iv) end new{U}(tag, ap, iv, states, ps, var_to_name, observed, name, systems, defaults,