Skip to content

Commit

Permalink
Backport: docs: changelog entry for v0.19.1, plus 2 fixes
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <[email protected]>
  • Loading branch information
Flix6x committed Feb 26, 2024
1 parent e0cc765 commit 0c86c26
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion documentation/api/change_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ API change log
v3.0-16 | 2024-02-26
""""""""""""""""""""

- Fix support for providing a sensor definition to the ``site-power-capacity`` flex-config field for `/sensors/<id>/schedules/trigger` (POST).
- Fix support for providing a sensor definition to the ``power-capacity`` flex-model field for `/sensors/<id>/schedules/trigger` (POST).

v3.0-15 | 2024-01-11
""""""""""""""""""""
Expand Down
9 changes: 7 additions & 2 deletions documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ FlexMeasures Changelog
**********************


v0.19.1 | February 26, 2024
============================

* Support defining the ``power-capacity`` as a sensor in the API and CLI [see `PR #987 <https://github.com/FlexMeasures/flexmeasures/pull/987>`_]


v0.19.0 | February 18, 2024
============================

Expand Down Expand Up @@ -38,8 +44,7 @@ v0.18.2 | February 26, 2024
* Automatically update table navigation in the UI without requiring users to hard refresh their browser [see `PR #961 <https://github.com/FlexMeasures/flexmeasures/pull/961>`_]
* Updated documentation to enhance clarity for integrating plugins within the FlexMeasures Docker container [see `PR #958 <https://github.com/FlexMeasures/flexmeasures/pull/958>`_]
* Convert unit of the power capacities to ``MW`` instead of that of the storage power sensor [see `PR #979 <https://github.com/FlexMeasures/flexmeasures/pull/979>`_]
* Support defining the ``site-power-capacity`` as a sensor [see `PR #987 <https://github.com/FlexMeasures/flexmeasures/pull/987>`_]

* Support defining the ``site-power-capacity`` as a sensor in the API [see `PR #987 <https://github.com/FlexMeasures/flexmeasures/pull/987>`_]

v0.18.1 | January 15, 2024
============================
Expand Down
13 changes: 5 additions & 8 deletions documentation/cli/change_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
FlexMeasures CLI Changelog
**********************

since v0.19.1 | February 26, 2024
=======================================

* Fix support for providing a sensor definition to the ``--storage-power-capacity`` option of the ``flexmeasures add schedule for-storage`` command.

since v0.19.0 | February 18, 2024
=======================================

Expand All @@ -27,19 +32,11 @@ since v0.19.0 | February 18, 2024
* ``--source-id`` -> ``--source``
* ``--user-id`` -> ``--user`
since v0.18.2 | February 26, 2024
=======================================
* Fix support for providing a sensor definition to the ``--site-power-capacity`` option of the ``flexmeasures add schedule for-storage`` command.


since v0.18.1 | January 15, 2024
=======================================
* Fix the validation of the option ``--parent-asset`` of command ``flexmeasures add asset``.


since v0.17.0 | November 8, 2023
=======================================

Expand Down
5 changes: 3 additions & 2 deletions flexmeasures/cli/data_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,11 @@ def create_schedule(ctx):
@click.option(
"--storage-power-capacity",
"storage_power_capacity",
type=QuantityField("MW"),
type=QuantityOrSensor("MW"),
required=False,
default=None,
help="Storage consumption/production power capacity. Provide this as a quantity in power units (e.g. 1 MW or 1000 kW)."
help="Storage consumption/production power capacity. Provide this as a quantity in power units (e.g. 1 MW or 1000 kW)"
"or reference a sensor using 'sensor:<id>' (e.g. sensor:34)."
"It defines both-ways maximum power capacity.",
)
@click.option(
Expand Down
2 changes: 1 addition & 1 deletion flexmeasures/cli/tests/test_data_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def test_add_account(
@pytest.mark.skip_github
@pytest.mark.parametrize("storage_power_capacity", ["sensor", "quantity", None])
@pytest.mark.parametrize("storage_efficiency", ["sensor", "quantity", None])
def test_add_storage_scheduler(
def test_add_storage_schedule(
app,
add_market_prices_fresh_db,
storage_schedule_sensors,
Expand Down
6 changes: 6 additions & 0 deletions flexmeasures/data/models/planning/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,10 @@ def get_continuous_series_sensor_or_quantity(

def nanmin_of_series_and_value(s: pd.Series, value: float | pd.Series) -> pd.Series:
"""Perform a nanmin between a Series and a float."""
if isinstance(value, pd.Series):
# Avoid strange InvalidIndexError on .clip due to different "dtype"
# pd.testing.assert_index_equal(value.index, s.index)
# [left]: datetime64[ns, +0000]
# [right]: datetime64[ns, UTC]
value = value.tz_convert("UTC")
return s.fillna(value).clip(upper=value)

0 comments on commit 0c86c26

Please sign in to comment.