Refactor cost multiplier functions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 148
- Forks
- 55
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 18
Description
Feature Request
We can combine quite a bit of the cost multiplier functions (update_marginal_costs(...) and update_capital_costs(...)). Specifically, the logic that maps each generator to a state, as it needs to extract out the state label from the bus dataframe. If this logic is packaged into its own function, it may be useful later in the workflow as well :)
Suggested Solution
Here is the code that I think should be simplified.
Moreover, here is the portion that I think should be extracted into its own funtion
Additional Info
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in workflow/scripts/add_electricity.py around lines 312-420, focusing first on the repeated generator-to-state logic at lines 315-324. Extract that mapping for reuse by update_marginal_costs(...) and update_capital_costs(...), then verify the electricity workflow still produces the expected cost calculations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100