-
Notifications
You must be signed in to change notification settings - Fork 20
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
enabling modelling with network_routes == greenfield and gas_network_… #290
Conversation
for more information, see https://pre-commit.ci
Snakefile
Outdated
if config["custom_data"]["gas_network"] | ||
else "resources/gas_networks/gas_network_elec_s{simpl}_{clusters}.csv", | ||
else "resources/gas_networks/gas_network_elec_s{simpl}_{clusters}.csv" | ||
if not ( | ||
config["sector"]["hydrogen"]["network_routes"] == "greenfield" | ||
and not config["sector"]["hydrogen"]["gas_network_repurposing"] | ||
) | ||
else "data/pipelines.csv", |
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 doesnt' look so clean to me, and i'm unsure about the need for that. I drop few comments:
- since there is already the custom_data/pipelines, is there the need to add data/pipelines as well?
- are the conditions (the if/else cases) expected to grow in the future? if so, an auxiliary function may help
From a styling point of you, if these conditions are needed, I feel we can either we use if ... elif ... else ... , or we create an auxiliary function in the snakefile that takes care of the switch among cases.
What do you think?
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.
In the case (config["sector"]["hydrogen"]["network_routes"] == "greenfield" and not config["sector"]["hydrogen"]["gas_network_repurposing"]), we dont go into the rule prepare_gas_network, but also dont have any custom gas_network data. As we do h2_links = pd.read_csv(snakemake.input.pipelines) for all those cases in prepare_sector_network.py, we need some kind of empty file with the right columns for this case. It would also be okay to read this file out of the filepath custom_data, but i thought it might be an issue, if someone has custom_data, but wants to model without it for benchmarking.
Guess the conditions doesnt grow any more in the future in this case
What do you think, how should we handle it?
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.
@Eddy-JV could you please share your thoughts here?
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.
We could also create an empty dataframe with the right columns in prepare_sector_network.py for the case (config["sector"]["hydrogen"]["network_routes"] == "greenfield" and not config["sector"]["hydrogen"]["gas_network_repurposing"]) and reading the file for all other cases, just say what you prefer :)
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.
…odelling-with-hydrogen-network_routes-==-greenfield-and-gas_network_repurposing
Would make sense to merge it with #283 |
Do NOT MERGE. |
I'm closing this as it is merged with the other |
…repurposing
Closes # (if applicable).
Changes proposed in this Pull Request
Checklist
envs/environment.yaml
andenvs/environment.docs.yaml
.config.default.yaml
,config.tutorial.yaml
, andtest/config.test1.yaml
.doc/configtables/*.csv
and line references are adjusted indoc/configuration.rst
anddoc/tutorial.rst
.doc/release_notes.rst
is amended in the format of previous release notes, including reference to the requested PR.