Skip to content

Commit

Permalink
Merge branch 'main' into try-highs-on-python3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Flix6x committed Oct 2, 2023
2 parents 6236792 + 39f1e7c commit 465862f
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 4 deletions.
23 changes: 19 additions & 4 deletions ci/update-packages.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#!/bin/bash

######################################################################
# This script sets up the docker environment for updating packages
# This script sets up docker environments for supported Python versions
# for updating packages in each of them.
#
# To upgrade, add "upgrade" as parameter.
#
# To execute this script, cd into the `ci` directory, then call from there.
######################################################################

set -e
set -x

PYTHON_VERSIONS=(3.8 3.9 3.10 3.11)

# check if we will upgrade or just freeze
UPDATE_CMD=freeze-deps
if [ "$1" == "upgrade" ]; then
UPDATE_CMD=upgrade-deps
echo "Going to upgrade dependencies with make $UPDATE_CMD ..."
else
echo "Going to freeze dependencies with make $UPDATE_CMD..."
fi

# Check if docker is installed
if ! [ -x "$(command -v docker)" ]; then
echo "Docker is not installed. Please install docker and try again."
Expand All @@ -33,7 +49,6 @@ cp -r ../Makefile $TEMP_DIR

cd $TEMP_DIR

PYTHON_VERSIONS=(3.8 3.9 3.10 3.11)

for PYTHON_VERSION in "${PYTHON_VERSIONS[@]}"
do
Expand All @@ -44,7 +59,7 @@ do
# Build flexmeasures
# We are disabling running tests here, because we only want to update the packages. Running tests would require us to setup a postgres database,
# which is not necessary for updating packages.
docker run --name flexmeasures-update-packages-$PYTHON_VERSION -it flexmeasures-update-packages:$PYTHON_VERSION make upgrade-deps skip-test=yes
docker run --name flexmeasures-update-packages-$PYTHON_VERSION -it flexmeasures-update-packages:$PYTHON_VERSION make $UPDATE_CMD skip-test=yes
# Copy the requirements to the source directory
docker cp flexmeasures-update-packages-$PYTHON_VERSION:/app/requirements/$PYTHON_VERSION $SOURCE_DIR/requirements/
# Remove the container
Expand All @@ -58,4 +73,4 @@ echo "You can clean up the docker builder cache with the following command:"
echo "docker builder prune --all -f"

# Remove the temp directory
rm -rf $TEMP_DIR
rm -rf $TEMP_DIR
30 changes: 30 additions & 0 deletions documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
FlexMeasures Changelog
**********************


v0.16.1 | October 2, 2023
============================

Bugfixes
-----------

* Fix infeasible problem due to incorrect parsing of soc units of the ``soc-minima`` and ``soc-maxima`` fields within the ``flex-model`` field [see `PR #864 <https://github.com/FlexMeasures/flexmeasures/pull/864>`_]


v0.16.0 | September 27, 2023
============================

Expand Down Expand Up @@ -31,6 +41,15 @@ Infrastructure / Support
* Implement cache-busting to avoid the need for users to hard refresh the browser when new JavaScript functionality is added to the :abbr:`UI (user interface)` in a new FlexMeasures version [see `PR #860 <https://github.com/FlexMeasures/flexmeasures/pull/860>`_]


v0.15.2 | October 2, 2023
============================

Bugfixes
-----------

* Fix infeasible problem due to incorrect parsing of soc units of the ``soc-minima`` and ``soc-maxima`` fields within the ``flex-model`` field [see `PR #864 <https://github.com/FlexMeasures/flexmeasures/pull/864>`_]


v0.15.1 | August 28, 2023
============================

Expand All @@ -43,6 +62,7 @@ Bugfixes
* Fix showing sensor data on the asset page of public assets, and searching for annotations on public assets [see `PR #830 <https://github.com/FlexMeasures/flexmeasures/pull/830>`_]
* Make the command `flexmeasures add schedule for-storage` to pass the soc-target timestamp to the flex model as strings instead of `pd.Timestamp` [see `PR #834 <https://github.com/FlexMeasures/flexmeasures/pull/834>`_]


v0.15.0 | August 9, 2023
============================

Expand Down Expand Up @@ -87,6 +107,16 @@ Infrastructure / Support
* Start keeping sets of pinned requirements per supported Python version. Also fixes recent Docker build problem. [see `PR #776 <https://www.github.com/FlexMeasures/flexmeasures/pull/776>`_]
* Removed obsolete code dealing with deprecated data models (e.g. assets, markets and weather sensors), and sunset the fm0 scheme for entity addresses [see `PR #695 <https://www.github.com/FlexMeasures/flexmeasures/pull/695>`_ and `project 11 <https://www.github.com/FlexMeasures/flexmeasures/projects/11>`_]


v0.14.3 | October 2, 2023
============================

Bugfixes
-----------

* Fix infeasible problem due to incorrect parsing of soc units of the ``soc-minima`` and ``soc-maxima`` fields within the ``flex-model`` field [see `PR #864 <https://github.com/FlexMeasures/flexmeasures/pull/864>`_]


v0.14.2 | July 25, 2023
============================

Expand Down
7 changes: 7 additions & 0 deletions flexmeasures/api/v3_0/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,11 @@ def message_for_trigger_schedule(
message["flex-model"]["soc-targets"] = [
{"value": target_value, "datetime": target_datetime}
]
# Also create some minima and maxima constraints to test correct deserialization using the soc-unit
message["flex-model"]["soc-minima"] = [
{"value": target_value - 1, "datetime": target_datetime}
]
message["flex-model"]["soc-maxima"] = [
{"value": target_value + 1, "datetime": target_datetime}
]
return message
6 changes: 6 additions & 0 deletions flexmeasures/data/schemas/scheduling/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ def post_load_sequence(self, data: dict, **kwargs) -> dict:
if data.get("soc_targets"):
for target in data["soc_targets"]:
target["value"] /= 1000.0
if data.get("soc_minima"):
for minimum in data["soc_minima"]:
minimum["value"] /= 1000.0
if data.get("soc_maxima"):
for maximum in data["soc_maxima"]:
maximum["value"] /= 1000.0
data["soc_unit"] = "MWh"

# Convert efficiencies to dimensionless (to the (0,1] range)
Expand Down

0 comments on commit 465862f

Please sign in to comment.