diff --git a/src/core/defcomp.jl b/src/core/defcomp.jl index 2c6edbad3..2b527d0fe 100644 --- a/src/core/defcomp.jl +++ b/src/core/defcomp.jl @@ -197,8 +197,7 @@ macro defcomp(comp_name, ex) # DEPRECATION - EVENTUALLY REMOVE if @capture(elt, name_::datum_type_ = elt_type_(args__)) - msg = "The following syntax has been deprecated in @defcomp: \"$name::$datum_type = $elt_type(...)\". Use curly bracket syntax instead: \"$name = $elt_type{$datum_type}(...)\"" - error("$msg\n$(reduce((x,y) -> "$x\n$y", stacktrace()))") + error("The following syntax has been deprecated in @defcomp: \"$name::$datum_type = $elt_type(...)\". Use curly bracket syntax instead: \"$name = $elt_type{$datum_type}(...)\"") elseif ! @capture(elt, name_ = (elt_type_{datum_type_}(args__) | elt_type_(args__))) end diff --git a/src/core/model.jl b/src/core/model.jl index 1b9359fb8..a79e23497 100644 --- a/src/core/model.jl +++ b/src/core/model.jl @@ -171,10 +171,7 @@ new component specified by `comp_id`. Use the following syntax instead: See docstring for `replace!` for further description of available functionality. """ function replace_comp!(m::Model, comp_id::ComponentId, comp_name::Symbol=comp_id.comp_name; kwargs...) - msg = "Function `replace_comp!(m, comp_id, comp_name; kwargs...)` has been deprecated. Use `replace!(m, comp_name => Mimi.compdef(comp_id); kwargs...)` instead." - st = _get_stacktrace_string() - full_msg = string(msg, " \n", st) - error(full_msg) + error("Function `replace_comp!(m, comp_id, comp_name; kwargs...)` has been deprecated. Use `replace!(m, comp_name => Mimi.compdef(comp_id); kwargs...)` instead.") end # DEPRECATION - EVENTUALLY REMOVE @@ -194,10 +191,7 @@ new component specified by `comp_def`. Use the following syntax instead: See docstring for `replace!` for further description of available functionality. """ function replace_comp!(m::Model, comp_def::ComponentDef, comp_name::Symbol=comp_def.comp_id.comp_name; kwargs...) - msg = "Function `replace_comp!(m, comp_def, comp_name; kwargs...)` has been deprecated. Use `replace!(m, comp_name => comp_def; kwargs...)` instead." - st = _get_stacktrace_string() - full_msg = string(msg, " \n", st) - error(full_msg) + error("Function `replace_comp!(m, comp_def, comp_name; kwargs...)` has been deprecated. Use `replace!(m, comp_name => comp_def; kwargs...)` instead.") end """ diff --git a/src/core/time.jl b/src/core/time.jl index 6689a441c..2704d13d1 100644 --- a/src/core/time.jl +++ b/src/core/time.jl @@ -27,7 +27,7 @@ end Deprecated fucntion to return true or false, true if the current time (year) for `ts` is `t` """ function is_time(ts::AbstractTimestep, t::Int) - error("`is_time(ts, t)` is deprecated. Use comparison operators with TimestepValue objects instead: `ts == TimestepValue(t)` \n$(stacktrace())", :is_time) + error("`is_time(ts, t)` is deprecated. Use comparison operators with TimestepValue objects instead: `ts == TimestepValue(t)`") end """ @@ -46,7 +46,7 @@ end Deprecated function to return true or false, true if `ts` timestep is step `t`. """ function is_timestep(ts::AbstractTimestep, t::Int) - error("`is_timestep(ts, t)` is deprecated. Use comparison operators with TimestepIndex objects instead: `ts == TimestepIndex(t)` \n$(stacktrace())", :is_timestep) + error("`is_timestep(ts, t)` is deprecated. Use comparison operators with TimestepIndex objects instead: `ts == TimestepIndex(t)`") end """ diff --git a/src/core/time_arrays.jl b/src/core/time_arrays.jl index 9e611924e..a96272f51 100644 --- a/src/core/time_arrays.jl +++ b/src/core/time_arrays.jl @@ -57,36 +57,16 @@ function _single_index_check(data, idxs) end end -# DEPRECATION - EVENTUALLY REMOVE -# Helper to print stacktrace for the integer indexing errors -function _get_stacktrace_string() - s = "" - for line in stacktrace() - if startswith(string(line), "run_timestep") - return s - else - s = string(s, line, "\n") - end - end - return s -end - # DEPRECATION - EVENTUALLY REMOVE # Helper function for getindex; throws an error if one indexes into a TimestepArray with an integer function _throw_int_getindex_error() - msg = "Indexing with getindex into a TimestepArray with Integer(s) is deprecated, please index with a TimestepIndex(index::Int) instead ie. instead of t[2] use t[TimestepIndex(2)]\n" - st = _get_stacktrace_string() - full_msg = string(msg, " \n", st) - error(full_msg) + error("Indexing with getindex into a TimestepArray with Integer(s) is deprecated, please index with a TimestepIndex(index::Int) instead ie. instead of t[2] use t[TimestepIndex(2)]") end # DEPRECATION - EVENTUALLY REMOVE # Helper function for setindex; throws an error if one indexes into a TimestepArray with an integer function _throw_int_setindex_error() - msg = "Indexing with setindex into a TimestepArray with Integer(s) is deprecated, please index with a TimestepIndex(index::Int) instead ie. instead of t[2] use t[TimestepIndex(2)]" - st = _get_stacktrace_string() - full_msg = string(msg, " \n", st) - error(full_msg) + error("Indexing with setindex into a TimestepArray with Integer(s) is deprecated, please index with a TimestepIndex(index::Int) instead ie. instead of t[2] use t[TimestepIndex(2)]") end # Helper macro used by connector diff --git a/src/mcs/mcs_types.jl b/src/mcs/mcs_types.jl index 2e39e95ea..5fddbdb4b 100644 --- a/src/mcs/mcs_types.jl +++ b/src/mcs/mcs_types.jl @@ -230,7 +230,5 @@ function getdataframe(sim_inst::SimulationInstance, comp_name::Symbol, datum_nam end function Base.getindex(sim_inst::SimulationInstance, comp_name::Symbol, datum_name::Symbol; model::Int = 1) - msg = "getindex method for `SimulationInstance` has been replaced with getdataframe function for consistency of return type, please use getdataframe instead" - Base.depwarn("$msg, $(stacktrace())", :getindex) - return sim_inst.results[model][(comp_name, datum_name)] + error("getindex method for `SimulationInstance` has been replaced with getdataframe function for consistency of return type, please use getdataframe instead") end