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

Duplicate `update_marginal_costs(...)` functions #252

Closed trevorb1 closed 2 months ago

trevorb1 commented 2 months ago

Feature Request

We have two functions called update_marginal_costs(...) that are almost identical. One in add_electricity and one in build_powerplants. This one in add_electricity has an extra conditional (shown below), but other than that I believe they are identical. It is quite confusing to have two almost identical named functions that have almost identical logic.

Suggested Solution

Collapse these functions into a single function.

Additional Info

The one in add_electricity has this extra conditional in it:

if len(dfs) == 0:
    continue