Adopt component-graph's unified Formula type#52
Draft
shsms wants to merge 3 commits into
Draft
Conversation
Point the frequenz-microgrid-component-graph dependency at the meter-subtraction branch of the fork and port the logical-meter formula layer to the unified component-graph Formula type: the AggregationFormula and CoalesceFormula graph types and the Formula trait are gone, replaced by a single Formula struct, so FormulaParams and the formula wrappers hold it directly and the GraphFormulaConnector indirection is dropped. Update the pv-pool and logical-meter formula-display tests for the new component-graph behavior: per-category formulas are component-first by default (the exact sum leads), and a component sharing a meter with a sibling now falls back to the meter minus that sibling. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
After the port to the unified component-graph Formula, AggregationFormula and CoalesceFormula had byte-identical bodies (field, Display, FormulaSubscriber, From<FormulaParams>); only their GraphFormulaProvider impls differed. Collapse them into one GraphFormula<M, K> keyed by an Aggregation/Coalesce marker, keep the two provider impls, and alias the old names. The dead reverse From<wrapper> for FormulaParams impls are dropped. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
The new component-graph meter-minus-sibling formulas (e.g. COALESCE(frequenz-floss#8, frequenz-floss#5 - frequenz-floss#6, 0.0)) were only checked by display-string assertions; add a numeric round-trip through FormulaEngine. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port the logical-meter formula layer to component-graph's unified
Formulatype and build against the meter-subtraction branch.Changes
frequenz-microgrid-component-graphdependency at themeter-subtractionbranch (temporary — repoint to a release before merge).AggregationFormula/CoalesceFormulagraph types and theFormulatrait with the singleFormulastruct:FormulaParamsand the formula wrappers hold it directly; theGraphFormulaConnectorindirection is dropped.GraphFormula<M, K>keyed by anAggregation/Coalescemarker; the twoGraphFormulaProviderimpls and the public names (via aliases) are preserved.Breaking
meter − siblings), inherited from the component-graph upgrade.