Sienna-Platform / Sienna-Platform/PowerOperationsModels.jl
Clean up `add_expressions!` family
Open
@luke-kiernan is already working on this.
Since Jul 21, 2026.
- Dominant language
- Julia
- Stars
- 2
- Forks
- 1
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 26
Description
There's a lot of functions called add_expressions!. I asked AI to inspect the signatures. We have 5 different families:
- Generic per-device expression-container init: dispatch on
T<:ExpressionTypeandmodel::DeviceModel{...}. - Same shape as (1) but on reserves:
model::ServiceModel{V<:PSY.Reserve, ...} - AC branch variants: only called from branch constructors, on PTDF network model subtypes.
BThetaaggregate in PR #196: only called fromnetwork_constructor.jl.- Hydro turbine flow rate: only called from
hydrogenation_construction.jl.
(1) and (2) genuinely use multiple dispatch, same arguments of (container, T, devices, model) . (3)-(5) are functions that just happen to share the same name: they have different arities and argument types, zero ambiguity. We can keep (1) and (2) as add_expressions!, but I'd like to rename (3)-(5) to something more descriptive.
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.
Assessment
This issue has not been assessed yet.