Skip to content

Commit

Permalink
add method to get correct time_series_type
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Nov 29, 2024
1 parent f252a68 commit 5510a92
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/utils/powersystems_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,22 @@ function _get_piecewise_incrementalcurve_per_system_unit(
y_coords_normalized = y_coords .* system_base_power
return PSY.PiecewiseStepData(x_coords_normalized, y_coords_normalized)
end

function get_deterministic_time_series_type(sys::PSY.System)
time_series_types = IS.get_time_series_counts_by_type(sys.data)
@show existing_types = Set(d["type"] for d in time_series_types)
if Set(["Deterministic", "DeterministicSingleTimeSeries"]) existing_types
error(
"The System contains a combination of forecast data and transformed time series data. Currently this is not supported.",
)
end
if "Deterministic" existing_types
return PSY.Deterministic
elseif "DeterministicSingleTimeSeries" existing_types
return PSY.DeterministicSingleTimeSeries
else
error(
"The System does not contain any forecast data or transformed time series data.",
)
end
end

0 comments on commit 5510a92

Please sign in to comment.