Skip to content

feat: add AggregatorReporter#712

Merged
victorgarcia98 merged 26 commits intomainfrom
feature/aggregation-reporter
Jun 11, 2023
Merged

feat: add AggregatorReporter#712
victorgarcia98 merged 26 commits intomainfrom
feature/aggregation-reporter

Conversation

@victorgarcia98
Copy link
Contributor

Description

This PR adds the class AggregatorReporter to compute the aggregation (SUM or MEAN) of different sources' into a single one. This reporter allows to add the aggregate energy flows, costs, emissions, etc... of a system in a time period (e.g hourly).

Details:

  • This reporter makes source a required parameter in beliefs_search_configs.
  • Supports passing weights for the different alias. This can be used to convert a consumption (in absolute value) to a negative flow or to convert a current into power (i.e $P = V \cdot I$ for biphasic and $P = V \cdot I \cdot cos(\theta) \cdot \sqrt{3}$ for triphasic).
  • The (optional) parameter method can be set to SUM or MEAN to chose the aggregation method.

Look & Feel

{
    "beliefs_search_configs": [
        {
            "sensor": 1,
            "source" : 1,
            "alias" : "PV"
        },
        {
            "sensor": 1,
            "source" : 2,
            "alias" : "CONSUMPTION"
        }
    ],
    "method" : "SUM",
    "weights" : {
        "PV" : 1.0,
        "CONSUMPTION" : -1.0
    }
}

Testing Steps

Test for MEAN and SUM cases in flexmeasures/data/models/reporting/tests/test_aggregator.py.

Victor Garcia Reolid added 4 commits June 1, 2023 12:00
…Error

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice to have. Are you sure you don't want this to subclass from PandasReporter instead?

Victor Garcia Reolid added 9 commits June 9, 2023 11:12
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@victorgarcia98 victorgarcia98 requested a review from Flix6x June 9, 2023 11:18
Flix6x added 3 commits June 9, 2023 15:21
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Victor Garcia Reolid added 4 commits June 9, 2023 17:53
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Base automatically changed from 683-trigger-scheduler-api-endpoint-fails-to-save-the-results-to-the-database-on-subsequent-calls to main June 9, 2023 15:56
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@victorgarcia98 victorgarcia98 requested a review from Flix6x June 9, 2023 16:00
Flix6x added 3 commits June 10, 2023 19:15
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this can even be shipped with 0.14. I added a changelog and moved the relevant entry to the Infrastructure / Support category. I also added an experimental disclaimer, because we are planning to still refactor these classes soon (see #662).

Signed-off-by: F.N. Claessen <felix@seita.nl>
@nhoening
Copy link
Contributor

So can this be merged?

@Flix6x
Copy link
Contributor

Flix6x commented Jun 11, 2023

Yes, but let's give @victorgarcia98 a chance to review my commits first.

@victorgarcia98
Copy link
Contributor Author

Thanks! Nice the addition of the experimental warning.

@victorgarcia98 victorgarcia98 merged commit 583fc87 into main Jun 11, 2023
@victorgarcia98 victorgarcia98 deleted the feature/aggregation-reporter branch June 11, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments