pypsa-meets-earth / pypsa-earth

PyPSA-Earth: A flexible Python-based open optimisation model to study energy system futures around the world.
https://pypsa-earth.readthedocs.io/en/latest/
213 stars 169 forks source link

Create a wildcard with custom name #884

Open pz-max opened 9 months ago

pz-max commented 9 months ago

In the pypsa-kz-data project, we created a few new rules to import custom data e.g. https://github.com/yerbol-akhmetov/pypsa-kz-data/blob/5dc79d5b1abef182749fc36ffcf133b65310f141/kz.smk#L22 which required to change the network with letters e.g. dle

Building the CI in the kz-data repo, we changed the pypsa-earth Snakefile with a couple of lines because we required our new custom rules: https://github.com/yerbol-akhmetov/pypsa-kz-data/blob/5dc79d5b1abef182749fc36ffcf133b65310f141/.github/workflows/ci-linux.yml#L96-L101C1 ... Since that looks irritating, maybe a wildcard {custom_name} would allow more flexibility

FYI @martacki

davide-f commented 9 months ago

This is a bit delicate; I see that rules are building on each others, e.g d->dl, dl->dle etc Handling this with a single wildcard is highly challenging and hacky, I believe. So we shall consider whether the benefits are worth the cost. If this need is widespread, we can consider that. What do you think?

pz-max commented 9 months ago

Yeah, I am unsure how we can elegantly solve the issue atm. I think this issue needs some more exploration.