Skip to content

Commit

Permalink
v1.0.10 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle authored Oct 25, 2024
1 parent 13c0645 commit 6fa949c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

v1.0.10 (2024-10-25)
-------------------

- migrate cluster group from "other" to "other 1" inside v8.1 upgrader

v1.0.9 (2024-10-16)
-------------------

Expand Down
4 changes: 2 additions & 2 deletions src/antares/study/version/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Standard project metadata

__version__ = "1.0.9"
__version__ = "1.0.10"
__author__ = "RTE, Antares Web Team"
__date__ = "2024-10-16"
__date__ = "2024-10-25"
__credits__ = "© Réseau de Transport de l’Électricité (RTE)"
12 changes: 12 additions & 0 deletions src/antares/study/version/upgrade_app/upgrader_0801.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from antares.study.version.model.study_version import StudyVersion

from .upgrade_method import UpgradeMethod
from antares.study.version.ini_writer import IniWriter
from antares.study.version.ini_reader import IniReader


class UpgradeTo0801(UpgradeMethod):
Expand All @@ -28,3 +30,13 @@ def upgrade(cls, study_dir: Path) -> None:
data.to_ini_file(study_dir)
study_dir.joinpath("input", "renewables", "clusters").mkdir(parents=True, exist_ok=True)
study_dir.joinpath("input", "renewables", "series").mkdir(parents=True, exist_ok=True)

# Migrate thermal group from Other to Other 1
thermal_cluster_dir = study_dir / "input" / "thermal" / "clusters"
for area in thermal_cluster_dir.iterdir():
ini_path = thermal_cluster_dir / area / "list.ini"
sections = IniReader().read(ini_path)
for section in sections.values():
if section["group"].lower() == "Other".lower():
section["group"] = "other 1"
IniWriter().write(sections, ini_path)
4 changes: 3 additions & 1 deletion tests/upgrade_app/test_upgrade_0801.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def test_nominal_case(study_assets: StudyAssets):
expected = IniReader().read(expected_path)
assert actual == expected

# compare folders (because the upgrade should create empty "renewables" folder)
# compare input folders:
# 1- The upgrade should create empty "renewables" folder
# 2- The upgrade should rename old thermal groups
assert are_same_dir(
study_assets.study_dir.joinpath("input"),
study_assets.expected_dir.joinpath("input"),
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 6fa949c

Please sign in to comment.