Skip to content

Commit

Permalink
Fix bug where transform_single_time_series! fails
Browse files Browse the repository at this point in the history
This function will throw an exception if the first component that has
time series does not have any time series of type SingleTimeSeries.
  • Loading branch information
daniel-thom committed Jul 13, 2022
1 parent 04113c0 commit 41bf313
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/component.jl
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ function get_single_time_series_transformed_parameters(
end
end

throw(ArgumentError("component $(get_name(component)) does not have SingleTimeSeries"))
return
end

function _get_single_time_series_transformed_parameters(
Expand Down
4 changes: 4 additions & 0 deletions src/system_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ function transform_single_time_series!(
horizon,
interval,
)
if params === nothing
# This component doesn't have SingleTimeSeries.
continue
end
# This will throw if there is another forecast type with conflicting parameters.
check_params_compatibility(data.time_series_params, params)
end
Expand Down

0 comments on commit 41bf313

Please sign in to comment.