Skip to content
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

doneachh
Copy link
Collaborator

…repurposing

Closes # (if applicable).

Changes proposed in this Pull Request

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Newly introduced dependencies are added to envs/environment.yaml and envs/environment.docs.yaml.
  • Changes in configuration options are added in all of config.default.yaml, config.tutorial.yaml, and test/config.test1.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv and line references are adjusted in doc/configuration.rst and doc/tutorial.rst.
  • A note for the release notes doc/release_notes.rst is amended in the format of previous release notes, including reference to the requested PR.

@doneachh
Copy link
Collaborator Author

Hi @Eddy-JV !
didn't find a way to merge it to the other branch. So i guess simply merge this as soon as #283 is merged as well should be fine? :)

@doneachh doneachh self-assigned this Feb 16, 2024
Snakefile Outdated
Comment on lines 168 to 174
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",
Copy link
Member

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator

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?

Copy link
Collaborator Author

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 :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi everyone, I updated the PR #283 inlcuding the comment of @davide-f and solving the problem faced by @doneachh . Please check and provide me with any feedback.

This way, this PR can be disregarded.

doneachh and others added 2 commits March 6, 2024 14:32
…odelling-with-hydrogen-network_routes-==-greenfield-and-gas_network_repurposing
@doneachh
Copy link
Collaborator Author

Would make sense to merge it with #283

@Eddy-JV
Copy link
Collaborator

Eddy-JV commented Mar 18, 2024

Do NOT MERGE.

@davide-f
Copy link
Member

I'm closing this as it is merged with the other

@davide-f davide-f closed this Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants