-
Notifications
You must be signed in to change notification settings - Fork 115
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
Update case folder structure and examples #640
Update case folder structure and examples #640
Conversation
function _get_policyfile_info() | ||
policyfile_info = ( | ||
esr = (filename="Resource_energy_share_requirement.csv"), | ||
cap_res = (filename="Resource_capacity_reserve_margin.csv"), | ||
min_cap = (filename="Resource_minimum_capacity_requirement.csv"), | ||
max_cap = (filename="Resource_maximum_capacity_requirement.csv"), | ||
esr = (filename="Resource_energy_share_requirement.csv", setup_param="EnergyShareRequirement"), | ||
cap_res = (filename="Resource_capacity_reserve_margin.csv", setup_param="CapacityReserveMargin"), | ||
min_cap = (filename="Resource_minimum_capacity_requirement.csv", setup_param="MinCapReq"), | ||
max_cap = (filename="Resource_maximum_capacity_requirement.csv", setup_param="MaxCapReq"), | ||
) | ||
return policyfile_info | ||
end |
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 makes me a bit nervous that policy files are being joined one-to-one with policy settings. While right now this is the case, it doesn't seem like a fundamental thing. What if some new policy requires two files?
if setup["TimeDomainReduction"] == 1 && time_domain_reduced_files_exist(data_directory) | ||
my_dir = data_directory | ||
else | ||
my_dir = path | ||
# If TDR is not used, then use the "system" directory specified in the setup | ||
my_dir = joinpath(path, setup["SystemFolder"]) | ||
end |
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.
Consider making these five lines to construct my_dir
be a function (of setup
, data_directory
, and path
I suppose) since they're repeated in load_demand_data
, load_fuels_data
, load_generators_availability
, load_vre_stor_availability
.
function validate_policy_files(resource_policies_path::AbstractString, setup::Dict) | ||
policyfile_info = _get_policyfile_info() | ||
for (filename, setup_param) in values(policyfile_info) | ||
if setup[setup_param] == 1 && !isfile(joinpath(resource_policies_path, filename)) |
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.
.... I hope that we can change policies from 0
/1
to false
/true
in the future. Or for policies with three or more options (looking at U, UCommit) have them be descriptive strings which translate internally into named constants or enums or something.
if isfile(joinpath(case_path, "Generators_data.csv")) | ||
msg = "The `Generators_data.csv` file was deprecated in release v0.4. " * | ||
"Please use the new interface for generators creation, and see the documentation for additional details." | ||
Base.depwarn(msg, :load_resources_data!, force=true) | ||
error("Exiting GenX...") | ||
else | ||
# create vector of resources from dataframes |
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.
Since you throw an error
in the if
clause, could the contents of else
be moved out of the else
and up one indent level? After all, they're on the Happy Path.
Gotten rid of Gurobi from Run.jl
… of Gurobi optimizer from all Run.jl files
f5218f4
to
533ae86
Compare
Description
This PR updates the folder structure of a GenX case, and selects the examples for v0.4.
The proposed version is the following:
Tests and examples have been updated to match the new folder structure, and the naming convention for folders is
snake_case
, to match the rest the of the source code.All the current examples can be moved to a separate repository together with the new tutorials: https://github.com/GenXProject/GenX-Tutorials
Please feel free to add any comments or suggestions you may have on this PR.
What type of PR is this? (check all applicable)
Checklist
How this can be tested
I ran all the example cases and the tests that are available.
Post-approval checklist for GenX core developers
After the PR is approved