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

Update demand extraction for different sectors from same dataset #283

Closed trevorb1 closed 2 months ago

trevorb1 commented 2 months ago

Feature Request

If we want to use the same dataset to extract out different sector demands (ie. heating, cooling, electrical), the current logic requires reading in and formatting the dataset for each sector (ie. we read and process the dataset 3 times to get the 3 different sectors). We should update logic to reuse the same dataset.

Suggested Solution

Within the Context class, we can add a new function, similar to prepare_demand(...) that will use the read in data. Maybe this function returns a dictionary of dataframes, where the key is the sector

https://github.com/PyPSA/pypsa-usa/blob/504208a89d31cfa144b6d30c6b0b72917de6c41f/workflow/scripts/build_demand.py#L107-L112

Additional Info

No response