PyPSA / pypsa-usa

PyPSA-USA: An Open-Source Energy System Optimization Model for the United States
https://pypsa-usa.readthedocs.io
MIT License
55 stars 23 forks source link

Add Assertion that carriers exist within eligible sets #382

Open ktehranchi opened 2 months ago

ktehranchi commented 2 months ago

Checklist

The Issue

If a user mistakenly places a conventional carrier in StorageUnits, instead of skipping it, we should set a warning that the carrier is not eligible.

Ideally, this happens early in each script, or in snakemake, so that the user gets the feedback immediately

Steps To Reproduce

No response

Expected Behavior

No response

Error Message

No response

Anything else?

No response

trevorb1 commented 2 months ago

I agree! Once we get to more stable configuration file(s) setup, it may be good to write some simple logic to validate the configuration file. Pydantic could be a good option (easy to setup and can handle conditional logic quite nicely)! That way we can just run the validation script once at the top of the workflow (maybe via the onstart command) so none of the checking has to happen in the scripts. :)