Skip to content

Default to component-first per-category formulas#91

Draft
shsms wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
shsms:meter-subtraction
Draft

Default to component-first per-category formulas#91
shsms wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
shsms:meter-subtraction

Conversation

@shsms

@shsms shsms commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Track component-graph's meter-subtraction branch and mirror its breaking default: per-category formulas now use the component reading as the primary source and the meter as the fallback.

Changes

  • Repoint the frequenz-microgrid-component-graph dependency at the meter-subtraction branch (temporary — repoint to a release before merge).
  • Flip the ComponentGraphConfig default for prefer_meters_in_component_formulas from True to False, so an explicit ComponentGraphConfig() matches both the no-config path and upstream.
  • Rename the "device" wording to "component" in the type stub and preference tests, matching component-graph's vocabulary (no behavior change).
  • Update the type stub, the preference/formula tests, and the release notes.

Breaking

  • prefer_meters_in_component_formulas now defaults to False (was True): the per-category formulas (battery/chp/pv/wind_turbine/ev_charger/steam_boiler) use the component reading as primary and the meter as fallback. Pass True to restore the previous meter-first behavior.

shsms added 3 commits June 24, 2026 19:36
Point the frequenz-microgrid-component-graph dependency at the
meter-subtraction branch of the fork. Update the default-preference
steam-boiler and wind-turbine formula tests for the new component-first
default: per-category formulas now use the component reading as the
primary source and the meter as the fallback.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
component-graph flipped the prefer_meters_in_component_formulas default
to false (component reading primary, meter as fallback). Mirror it in the
binding so an explicit ComponentGraphConfig() matches both the no-config
path and the upstream default, instead of forcing the old meter-first
behavior. Update the type stub and the preference tests.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Pure terminology: the per-category formulas' non-meter source is a
component, matching component-graph's vocabulary (the flag is
prefer_meters_in_component_formulas). Rename _DEVICE_PRIMARY and the
"device" wording in the type stub and preference tests to "component";
no behavior change.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) labels Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant