Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.10 #25

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading