-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable Cost Refactor Part 1: Function Data #331
Conversation
The files `function_data.jl` and `test_function_data.jl` are copied from https://github.com/NREL-Sienna/PowerSystems.jl/tree/4a5375b9db694c1d64de0bec87234008d0c27640; see history there.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
==========================================
+ Coverage 79.57% 80.04% +0.47%
==========================================
Files 53 54 +1
Lines 4244 4315 +71
==========================================
+ Hits 3377 3454 +77
+ Misses 867 861 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
function transform_array_for_hdf( | ||
data::SortedDict{Dates.DateTime, Vector{PiecewiseLinearPointData}}, | ||
) | ||
quad_cost = hcat([get_points.(v) for v in values(data)]...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this called quad_cost
for a PWL data? I see that the name is prior to this PR but it seems incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem incorrect. I'll change it
@@ -481,7 +515,10 @@ function transform_array_for_hdf(data::SortedDict{Dates.DateTime, Vector{PWL}}) | |||
return t_quad_cost | |||
end | |||
|
|||
function transform_array_for_hdf(data::Vector{PWL}) | |||
# TODO: old code here does not properly handle data with different numbers of points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok. It was meant like that for proper storage in the HDF5 file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks ok to me, there is some pending work for the MarketBid Cost that requires scoping but we already decided to refactor that at a later stage.
The first part of a significant refactor of Sienna cost data structures. See NREL-Sienna/PowerSystems.jl#1056 for more details. This PR consists of a new type
FunctionData
, a new set of concrete subtype structs to represent various functions, and the necessary refactoring to use them rather thanIS.PWL
and such in other InfrastructureSystems data structures. I also performed some minor code deduplication.IS, PSY, and PSB tests pass when using the appropriate branches of each plus PowerSystemsTestData: