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

Switch Emission Accounting to PyPSA.Statistics #245

Closed trevorb1 closed 3 months ago

trevorb1 commented 3 months ago

Changes proposed in this Pull Request

In this PR I have switched emissions accounting to use the pypsa.statistics.StatisticsAccessor methods. Specifically I have:

  1. Added a new function to find primary energy consumption called get_primary_energy_use
  2. Added a new function to find generator/node/carrier emissions called get_node_carrier_emissions_timeseries
  3. Modified the get_node_emissions_timeseries and get_technology_emissions_timeseries functions to use the get_node_carrier_emissions_timeseries

While two new functions are added, overall, the logic is much simpler as we are not looping over all the different components to find primary energy use.

I did a qualitative check on the graphs to make sure the results have not changed.

Checklist