Sienna-Platform / Sienna-Platform/PowerOperationsModels.jl
Use More Semantically Appropriate Null Values
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 2
- Forks
- 1
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 26
Description
At https://github.com/NREL-Sienna/PowerSimulations.jl/blob/f93f740f8d4ffc61895bf3a8f59f400fdc3961a0/src/core/optimization_container.jl#L437, https://github.com/NREL-Sienna/PowerSimulations.jl/blob/f93f740f8d4ffc61895bf3a8f59f400fdc3961a0/src/network_models/network_slack_variables.jl#L41, and https://github.com/NREL-Sienna/PowerSimulations.jl/blob/f93f740f8d4ffc61895bf3a8f59f400fdc3961a0/src/network_models/powermodels_interface.jl#L302, we have special cases for when a particular dictionary is empty. The empty dictionary is being used as a null value, but nothing would be a better semantic match: we're not just trying to indicate that we should run the algorithm with zero bus reduction mappings, for example; we're trying to indicate that we should run a different version of the algorithm that takes its input from a different data structure. There are likely other occurrences of this elsewhere in the codebase.
Contributor guide
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 with the empty-dictionary cases in src/core/optimization_container.jl, src/network_models/network_slack_variables.jl, and src/network_models/powermodels_interface.jl. Trace how each dictionary is used as a null value, search the codebase for similar occurrences, and verify that the refactor distinguishes an absent input from an empty mapping without changing ordinary behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100