Skip to content

Commit

Permalink
Backport PR #414: Fix search filter and CLI test (#414)
Browse files Browse the repository at this point in the history
Fix filter for selecting one deterministic belief per event, which was duplicating index levels.

* Fix CLI test

Signed-off-by: F.N. Claessen <felix@seita.nl>

* Fix: do not duplicate index levels in groupby

Signed-off-by: F.N. Claessen <felix@seita.nl>

* Changelog entry

Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Apr 9, 2022
1 parent d5250c9 commit 40b2a96
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions documentation/changelog.rst
Expand Up @@ -8,6 +8,7 @@ v0.9.2 | April XX, 2022
Bugfixes
--------
* Prefer unit conversions to short stock units [see `PR #412 <http://www.github.com/FlexMeasures/flexmeasures/pull/412>`_]
* Fix filter for selecting one deterministic belief per event, which was duplicating index levels [see `PR #414 <http://www.github.com/FlexMeasures/flexmeasures/pull/414>`_]


v0.9.1 | March 31, 2022
Expand Down
2 changes: 1 addition & 1 deletion flexmeasures/cli/tests/test_data_show.py
Expand Up @@ -100,7 +100,7 @@ def test_plot_beliefs(app, fresh_db, setup_beliefs_fresh_db):
[
"--sensor-id",
sensor.id,
"--from",
"--start",
"2021-03-28T16:00+01",
"--duration",
"PT1H",
Expand Down
2 changes: 1 addition & 1 deletion flexmeasures/data/models/time_series.py
Expand Up @@ -560,7 +560,7 @@ def search(
# todo: move to timely-beliefs: select mean/median belief
bdf = (
bdf.for_each_belief(get_median_belief)
.groupby(level=["event_start", "belief_time"])
.groupby(level=["event_start", "belief_time"], group_keys=False)
.apply(lambda x: x.head(1))
)
if resolution is not None:
Expand Down

0 comments on commit 40b2a96

Please sign in to comment.