Skip to content

Commit

Permalink
Merge pull request #92 from Project-OMOTES/91-update-to-latest-mesido
Browse files Browse the repository at this point in the history
91: Update to latest mesido 0.1.8.4
  • Loading branch information
lfse-slafleur authored Dec 12, 2024
2 parents def86d4 + 3ea116b commit e28b03c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 39 deletions.
20 changes: 3 additions & 17 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --constraint=requirements.txt --extra=dev --output-file=dev-requirements.txt pyproject.toml
Expand All @@ -20,11 +20,6 @@ antlr4-python3-runtime==4.7.2
# via
# -c requirements.txt
# pymoca
backports-zoneinfo[tzdata]==0.2.1
# via
# -c requirements.txt
# celery
# kombu
billiard==4.2.0
# via
# -c requirements.txt
Expand Down Expand Up @@ -80,9 +75,7 @@ coolprop==6.6.0
# -c requirements.txt
# mesido
coverage[toml]==7.4.1
# via
# coverage
# pytest-cov
# via pytest-cov
exceptiongroup==1.2.0
# via pytest
flake8==6.1.0
Expand All @@ -106,8 +99,6 @@ idna==3.4
# -c requirements.txt
# requests
# yarl
importlib-metadata==7.0.2
# via build
influxdb==5.3.1
# via
# -c requirements.txt
Expand All @@ -126,7 +117,7 @@ lxml==4.9.3
# pyecore
mccabe==0.7.0
# via flake8
mesido==0.1.8.3
mesido==0.1.8.4
# via
# -c requirements.txt
# omotes-grow-worker (pyproject.toml)
Expand Down Expand Up @@ -286,14 +277,11 @@ tomli==2.0.1
typing-extensions==4.11.0
# via
# -c requirements.txt
# black
# kombu
# mypy
# omotes-sdk-python
tzdata==2023.3
# via
# -c requirements.txt
# backports-zoneinfo
# celery
urllib3==2.0.4
# via
Expand All @@ -316,8 +304,6 @@ yarl==1.9.4
# -c requirements.txt
# aio-pika
# aiormq
zipp==3.18.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ requires-python = ">=3.10"

dependencies = [
"python-dotenv ~= 1.0.0",
"mesido ~= 0.1.8.3",
"mesido ~= 0.1.8.4",
"omotes-sdk-python ~= 3.2.5"
]

Expand Down
16 changes: 4 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=requirements.txt pyproject.toml
Expand All @@ -12,10 +12,6 @@ amqp==5.2.0
# via kombu
antlr4-python3-runtime==4.7.2
# via pymoca
backports-zoneinfo[tzdata]==0.2.1
# via
# celery
# kombu
billiard==4.2.0
# via celery
casadi==3.6.3
Expand Down Expand Up @@ -54,7 +50,7 @@ kombu==5.3.4
# via celery
lxml==4.9.3
# via pyecore
mesido==0.1.8.3
mesido==0.1.8.4
# via omotes-grow-worker (pyproject.toml)
msgpack==1.0.5
# via influxdb
Expand Down Expand Up @@ -126,13 +122,9 @@ streamcapture==1.2.4
strenum==0.4.15
# via mesido
typing-extensions==4.11.0
# via
# kombu
# omotes-sdk-python
# via omotes-sdk-python
tzdata==2023.3
# via
# backports-zoneinfo
# celery
# via celery
urllib3==2.0.4
# via requests
vine==5.1.0
Expand Down
14 changes: 7 additions & 7 deletions src/grow_worker/worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from mesido.workflows import NetworkSimulatorHIGHSWeeklyTimeStep
from mesido.workflows.grow_workflow import (
EndScenarioSizingDiscountedStaged,
EndScenarioSizingHeadLossDiscountedStaged,
EndScenarioSizingHeadLossStaged,
EndScenarioSizingStaged,
)
from mesido.workflows import (
run_end_scenario_sizing,
Expand All @@ -26,8 +26,8 @@ class GrowTaskType(Enum):


GROWProblem = Union[
Type[EndScenarioSizingHeadLossDiscountedStaged],
Type[EndScenarioSizingDiscountedStaged],
Type[EndScenarioSizingHeadLossStaged],
Type[EndScenarioSizingStaged],
Type[NetworkSimulatorHIGHSWeeklyTimeStep],
]

Expand All @@ -40,13 +40,13 @@ def get_problem_type(task_type: GrowTaskType) -> GROWProblem:
"""
result: GROWProblem
if task_type == GrowTaskType.GROW_OPTIMIZER_DEFAULT:
result = EndScenarioSizingDiscountedStaged
result = EndScenarioSizingStaged
elif task_type == GrowTaskType.GROW_SIMULATOR:
result = NetworkSimulatorHIGHSWeeklyTimeStep
elif task_type == GrowTaskType.GROW_OPTIMIZER_NO_HEAT_LOSSES:
result = EndScenarioSizingDiscountedStaged
result = EndScenarioSizingStaged
elif task_type == GrowTaskType.GROW_OPTIMIZER_WITH_PRESSURE:
result = EndScenarioSizingHeadLossDiscountedStaged
result = EndScenarioSizingHeadLossStaged
else:
raise RuntimeError(f"Unknown workflow type, please implement {task_type}")

Expand Down
4 changes: 2 additions & 2 deletions unit_test/test_worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from grow_worker.worker_types import (
get_problem_type,
GrowTaskType,
EndScenarioSizingDiscountedStaged,
EndScenarioSizingStaged,
)


Expand All @@ -15,5 +15,5 @@ def test__get_problem_type__is_correct_grow_optimizer(self) -> None:
result = get_problem_type(task_type)

# Assert
expected_result = EndScenarioSizingDiscountedStaged
expected_result = EndScenarioSizingStaged
self.assertEqual(expected_result, result)

0 comments on commit e28b03c

Please sign in to comment.