PyPSA / pypsa-usa

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

EIA API key needed when modeling other than CAISO #232

Closed casinocullen closed 2 months ago

casinocullen commented 3 months ago

Checklist

The Issue

When building NG prices, now the only options are getting data from EIA or CAISO. If no EIA API key is provided, no data would be prepared and cannot run the rest.

Recommend to add a third option to provide a default NG price.

Also, seems like that data can't model period >= 2023, so if I am running period in 2023, there comes an error..

Steps To Reproduce

No response

Expected Behavior

No response

Error Message

No response

Anything else?

No response

ktehranchi commented 3 months ago

This issue won't trigger if you set config['conventional']['dynamic_fuel_price'] == False . Also, we should have a comment on dynamic_fuel_price that you need to input an eia_api_key.

We should add an if statement to these lines in rule add_electricity: such that if config['conventional']['dynamic_fuel_price'] == Falsethen thebuild_fuel_prices` module does not run. Inside add_electricity the dynamic fuel prices are not used unless that configuration is set to true.

This way if the user doesn't input an EIA api key then build_fuel_prices never runs and no error will trigger.

https://github.com/PyPSA/pypsa-usa/blob/e40c63a8b748beac2f8a40e02c4674fcc761997c/workflow/rules/build_electricity.smk#L324C1-L325C85

ktehranchi commented 3 months ago

Do you think we should assert that dynamic_fuel_price == true the user must input an EIA API key?

Or throw a warning and just fall back to the single average fuel cost

@trevorb1 thoughts?

casinocullen commented 3 months ago

@ktehranchi That sounds reasonable to me

trevorb1 commented 3 months ago

@ktehranchi @casinocullen I agree! Asserting that the api key is provided is probably better than a warning, as it can be easy to miss with all the print outs :)

trevorb1 commented 3 months ago

Also, I add this documentation to the tasks in issue #220