Skip to content

Commit

Permalink
fix: in case of a tied rank, where multiple sources have exactly the …
Browse files Browse the repository at this point in the history
…same number of data points, arbitrarily pick the first one in the data

Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Aug 1, 2023
1 parent 7d13ee3 commit 12bac09
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions flexmeasures/data/models/charts/belief_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,17 @@ def daily_heatmap(
"frame": [None, None],
},
{"filter": "datum.source_rank == 1"},
# In case of a tied rank, arbitrarily choose the first one occurring in the data
{
"window": [
{
"op": "first_value",
"field": "source.id",
"as": "first_source_id",
}
],
},
{"filter": "datum.source.id == datum.first_source_id"},
],
},
{
Expand Down

0 comments on commit 12bac09

Please sign in to comment.