Skip to content

Clean up add_expressions! family #197

Description

@luke-kiernan

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 Branch and network coverage increase and bug fix #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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions