-
Notifications
You must be signed in to change notification settings - Fork 249
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
Consider using conda:
directives in snakemake rules
#450
Comments
(I could also add that if this is adopted, I'd be happy to open a similar pull request for pypsa-eur-sec.) |
I agree we should try out this One more pro (I think):
One challenge, I see:
A useful note:
|
As for I agree that the solver is something to think about. As of today, the user is already required to install some kind of solver in the pypsa-eur environment, so action is required either way. The difference would be adding a line to Maybe another option could be to have multiple environment files, with different solvers, and choose the correct environment for the I think bash code to install a solver in the Snakefile is more likely to lead to issues down the road. |
@koen-vg having to maintain different environement.yaml's is not strictly necessary. We could write an 'updater' function that uses a base.environmental.yaml and e.g. updates it with gurobi.environment.yaml. We did that in this python script, where the However, I prefer installing all major solvers only in one environment.yaml as here. It's just easier to maintain and allows this cool |
Conda:
directives in snakemake rules.I would propose a minor enhancement to the Snakefile, which is to add
conda:
directives to each rule; see https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#integrated-package-management. The implication for running pypsa-eur is that you would no longer have to activate the pypsa-eur conda environment before calling snakemake, but instead call snakemake with the--use-conda
argument.Pros:
--use-conda
argument, snakemake will run the workflow as usual, meaning that this change would be fully backwards compatible.Cons:
Other implications:
snakemake [...] --touch [...]
stategy; it might be an idea to write about that in the pypsa-eur documentation if this change is adopted.And example of what this would look like can be found here: https://github.com/koen-vg/pypsa-eur/blob/64aed45cd3d94ab48cdaed0cc02c16b6aec7dfc5/Snakefile
Overall I think this would be a good step in the direction of making pypsa-eur easier to work with in a fully reproducible way and makes it harder to make mistakes with the conda environment.
Of people are in favour of this change, I would of course be happy to open a pull request.
The text was updated successfully, but these errors were encountered: