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 14 forks source link

Index snapshots by planning horizon #336

Closed trevorb1 closed 1 month ago

trevorb1 commented 1 month ago

Closes #335

Changes proposed in this Pull Request

In this PR I have changed the indexing logic to be the planning horizon instead of the profile year. This includes:

I have checked that both single horizon and multi-horizon data still works. Todo before merging:

Checklist

trevorb1 commented 1 month ago

@ktehranchi, are you able to take a quick look (and maybe a quick run) to make sure this looks okay, please. Just want to make sure this stays true to your multi-horizon implementation implementation.

Ive run a few different edge cases, and everything seems to work correctly! Comparing against the develop branch, the objective cost continually comes out ~4% different; however the results seem the same (just visually comparing graphs). 4% seems like a lot for simply numerical errors, tho. I can do a better exploration to see where the differences are coming from if you think this is needed.