From 458cbde11c917277011b02ca812f26a5b54e1eb3 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Mon, 14 Jul 2025 12:51:36 +0530 Subject: [PATCH] refactor: use `@deprecate_binding` to deprecate `ODESystem` --- src/ModelingToolkit.jl | 3 --- src/deprecations.jl | 8 +------- src/systems/system.jl | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/ModelingToolkit.jl b/src/ModelingToolkit.jl index 46c6892607..ae73dca00a 100644 --- a/src/ModelingToolkit.jl +++ b/src/ModelingToolkit.jl @@ -138,9 +138,6 @@ $(TYPEDEF) TODO """ abstract type AbstractSystem end -# Solely so that `ODESystem` can be deprecated and still act as a valid type. -# See `deprecations.jl`. -abstract type IntermediateDeprecationSystem <: AbstractSystem end function independent_variable end diff --git a/src/deprecations.jl b/src/deprecations.jl index 3735d8f6f4..6c7aa2a09c 100644 --- a/src/deprecations.jl +++ b/src/deprecations.jl @@ -9,13 +9,7 @@ macro mtkbuild(exprs...) end |> esc end -const ODESystem = IntermediateDeprecationSystem - -function IntermediateDeprecationSystem(args...; kwargs...) - Base.depwarn("`ODESystem(args...; kwargs...)` is deprecated. Use `System(args...; kwargs...) instead`.", :ODESystem) - - return System(args...; kwargs...) -end +Base.@deprecate_binding ODESystem System for T in [:NonlinearSystem, :DiscreteSystem, :ImplicitDiscreteSystem] @eval @deprecate $T(args...; kwargs...) System(args...; kwargs...) diff --git a/src/systems/system.jl b/src/systems/system.jl index 729e8c4219..d4fde81249 100644 --- a/src/systems/system.jl +++ b/src/systems/system.jl @@ -24,7 +24,7 @@ structure. $(TYPEDFIELDS) """ -struct System <: IntermediateDeprecationSystem +struct System <: AbstractSystem """ $INTERNAL_FIELD_WARNING A unique integer tag for the system.