Skip to content

Commit

Permalink
Merge branch 'main' into 89-update-to-latest-python-template
Browse files Browse the repository at this point in the history
  • Loading branch information
lfse-slafleur committed Dec 19, 2024
2 parents 06f1ebc + e28b03c commit 3e37c27
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
10 changes: 6 additions & 4 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ antlr4-python3-runtime==4.7.2
# via
# -c requirements.txt
# pymoca
attrs==24.2.0
attrs==24.3.0
# via flake8-bugbear
billiard==4.2.1
# via
Expand All @@ -39,7 +39,7 @@ celery==5.3.6
# via
# -c requirements.txt
# omotes-sdk-python
certifi==2024.8.30
certifi==2024.12.14
# via
# -c requirements.txt
# requests
Expand Down Expand Up @@ -72,7 +72,9 @@ coolprop==6.6.0
# -c requirements.txt
# mesido
coverage[toml]==7.6.9
# via pytest-cov
# via
# coverage
# pytest-cov
exceptiongroup==1.2.2
# via pytest
flake8==7.1.1
Expand Down Expand Up @@ -122,7 +124,7 @@ lxml==5.3.0
# 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
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
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ casadi==3.6.3
# rtc-tools
celery==5.3.6
# via omotes-sdk-python
certifi==2024.8.30
certifi==2024.12.14
# via requests
charset-normalizer==3.4.0
# via requests
Expand Down Expand Up @@ -50,7 +50,7 @@ kombu==5.4.2
# via celery
lxml==5.3.0
# via pyecore
mesido==0.1.8.3
mesido==0.1.8.4
# via omotes-grow-worker (pyproject.toml)
msgpack==1.1.0
# via influxdb
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 3e37c27

Please sign in to comment.