Skip to content

Commit

Permalink
Fix ts_type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Dec 11, 2024
1 parent ce19795 commit 63548e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/core/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ function add_component_name!(attr::TimeSeriesAttributes, name::String, uuid::Str
return
end

_get_ts_uuid(attr::TimeSeriesAttributes, name) = attr.component_name_to_ts_uuid[name]
function _get_ts_uuid(attr::TimeSeriesAttributes, name)
return attr.component_name_to_ts_uuid[name]
end

struct VariableValueAttributes{T <: OptimizationContainerKey} <: ParameterAttributes
attribute_key::T
Expand Down
3 changes: 2 additions & 1 deletion src/devices_models/devices/common/get_time_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ function get_time_series(
component::PSY.Component,
forecast_name::String,
)
ts_type = get_default_time_series_type(container)
return _get_time_series(
container,
component,
TimeSeriesAttributes(PSY.Deterministic, forecast_name),
TimeSeriesAttributes(ts_type, forecast_name),
)
end
4 changes: 3 additions & 1 deletion src/operation/decision_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,15 @@ function reset!(model::DecisionModel{<:DefaultDecisionProblem})
if was_built_for_recurrent_solves
set_execution_count!(model, 0)
end
sys = get_system(model)
ts_type = get_deterministic_time_series_type(sys)
IS.Optimization.set_container!(
get_internal(model),
OptimizationContainer(
get_system(model),
get_settings(model),
nothing,
PSY.Deterministic,
ts_type,
),
)
get_optimization_container(model).built_for_recurrent_solves =
Expand Down

0 comments on commit 63548e1

Please sign in to comment.