Sienna-Platform / Sienna-Platform/PowerOperationsModels.jl

Clean up `add_expressions!` family

Open
#197 0 comments 0 reactions 1 assignee View on GitHub

@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:

  1. Generic per-device expression-container init: dispatch on T<:ExpressionType and model::DeviceModel{...}.
  2. Same shape as (1) but on reserves: model::ServiceModel{V<:PSY.Reserve, ...}
  3. AC branch variants: only called from branch constructors, on PTDF network model subtypes.
  4. BTheta aggregate in PR #196: only called from network_constructor.jl.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.