fix: specify all parameters for DemandFlexibility struct #131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
The purpose of this code is to fix the error discussed in #129. When a
demand_flexibility.csv
file is not available, not all of the parameters of theDemandFlexibility
struct were defined.What is the code doing?
In the
try/catch
loop that is responsible for trying to load thedemand_flexibility.csv
file inread_demand_flexibility
, the three parameters that were previously unspecified are now specified.Where to look
The fix lives in the
read_demand_flexibility
function insrc/read.jl
.Testing
I tested the fix on my local machine and the error presented in #129 no longer occurs. As @BainanXia mentioned, the demand flexibility functionality is not yet integrated into
PowerSimData
, so I cannot be sure that there are not any errors on that end. I also have not tested this withplug
, which is where the error was first noted. However, based on the error reported in #129, I believe this fix should do the trick.Time estimate
This review should be pretty quick.