Skip to content

Commit

Permalink
v2.17.2
Browse files Browse the repository at this point in the history
Merge pull request #2074 from AntaresSimulatorTeam/release/v2.17.2
  • Loading branch information
skamril committed Jun 19, 2024
2 parents 55a245b + 96b8013 commit 23027df
Show file tree
Hide file tree
Showing 85 changed files with 2,999 additions and 1,226 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v5
6 changes: 3 additions & 3 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:

steps:
- name: Checkout github repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -37,7 +37,7 @@ jobs:
node-version: [18.16.1]
steps:
- name: Checkout github repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#file: noinspection YAMLSchemaValidation
name: deploy
on:
push:
Expand All @@ -12,11 +11,11 @@ jobs:
strategy:
max-parallel: 3
matrix:
os: [ windows-latest, ubuntu-20.04 ]
os: [ windows-latest, ubuntu-20.04, ubuntu-22.04]

steps:
- name: 🐙 Checkout GitHub repo (+ download lfs dependencies)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -40,7 +39,7 @@ jobs:
NODE_OPTIONS: --max-old-space-size=8192

- name: 🐍 Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down Expand Up @@ -73,12 +72,12 @@ jobs:

- name: 📦 Archive Antares Desktop for Ubuntu
# this is the only way to preserve file permission and symlinks
if: matrix.os == 'ubuntu-20.04'
if: matrix.os != 'windows-latest'
run: zip -r --symlinks AntaresWeb.zip *
working-directory: dist/package

- name: 🚀 Upload binaries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: AntaresWeb-${{ matrix.os }}-pkg
path: dist/package/AntaresWeb.zip
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout github repo (+ download lfs dependencies)
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
Expand Down Expand Up @@ -42,9 +42,9 @@ jobs:

steps:
- name: Checkout github repo (+ download lfs dependencies)
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
Expand All @@ -60,7 +60,7 @@ jobs:
sed -i 's/\/home\/runner\/work\/AntaREST\/AntaREST/\/github\/workspace/g' coverage.xml
- name: Archive code coverage results
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-code-coverage-report
path: coverage.xml
Expand All @@ -72,7 +72,7 @@ jobs:
os: [ ubuntu-20.04 ]
steps:
- name: Checkout github repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand All @@ -94,9 +94,9 @@ jobs:
runs-on: ubuntu-20.04
needs: [ python-test, npm-test ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download python coverage report
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-code-coverage-report
- name: SonarCloud Scan
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: worker
on:
push:
branches:
- "master"
- "worker/**"

jobs:
binary:
runs-on: windows-latest

steps:
- name: 🐙 Checkout GitHub repo (+ download lfs dependencies)
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: 🐍 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller==5.6.2
- name: 📦 Packaging AntaresWebWorker
run: bash ./package_worker.sh
working-directory: scripts

- name: 🚀 Upload binary
uses: actions/upload-artifact@v4
with:
name: AntaresWebWorker
path: dist/AntaresWebWorker.exe
45 changes: 45 additions & 0 deletions AntaresWebWorker.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None

a = Analysis(
["antarest/worker/archive_worker_service.py"],
pathex=[],
binaries=[],
datas=[("resources", "resources")],
hiddenimports=["pythonjsonlogger.jsonlogger"],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(
a.pure,
a.zipped_data,
cipher=block_cipher,
)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name="AntaresWebWorker",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
4 changes: 2 additions & 2 deletions antarest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

# Standard project metadata

__version__ = "2.17.1"
__version__ = "2.17.2"
__author__ = "RTE, Antares Web Team"
__date__ = "2024-06-10"
__date__ = "2024-06-19"
# noinspection SpellCheckingInspection
__credits__ = "(c) Réseau de Transport de l’Électricité (RTE)"

Expand Down
10 changes: 1 addition & 9 deletions antarest/launcher/adapters/slurm_launcher/slurm_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def _import_study_output(
xpansion_mode: t.Optional[str] = None,
log_dir: t.Optional[str] = None,
) -> t.Optional[str]:
if xpansion_mode is not None:
if xpansion_mode:
self._import_xpansion_result(job_id, xpansion_mode)

launcher_logs: t.Dict[str, t.List[Path]] = {}
Expand Down Expand Up @@ -331,14 +331,6 @@ def _import_xpansion_result(self, job_id: str, xpansion_mode: str) -> None:
)
output_path = unzipped_output_path

if (output_path / "updated_links").exists():
logger.warning("Skipping updated links")
self.callbacks.append_after_log(job_id, "Skipping updated links")
else:
shutil.copytree(
self.local_workspace / STUDIES_OUTPUT_DIR_NAME / job_id / "input" / "links",
output_path / "updated_links",
)
if xpansion_mode == "r":
shutil.copytree(
self.local_workspace / STUDIES_OUTPUT_DIR_NAME / job_id / "user" / "expansion",
Expand Down
10 changes: 10 additions & 0 deletions antarest/study/business/advanced_parameters_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pydantic import validator
from pydantic.types import StrictInt, StrictStr

from antarest.core.exceptions import InvalidFieldForVersionError
from antarest.study.business.enum_ignore_case import EnumIgnoreCase
from antarest.study.business.utils import GENERAL_DATA_PATH, FieldInfo, FormFieldsBaseModel, execute_or_add_commands
from antarest.study.model import Study
Expand Down Expand Up @@ -44,6 +45,7 @@ class ReserveManagement(EnumIgnoreCase):
class UnitCommitmentMode(EnumIgnoreCase):
FAST = "fast"
ACCURATE = "accurate"
MILP = "milp"


class SimulationCore(EnumIgnoreCase):
Expand Down Expand Up @@ -236,6 +238,14 @@ def set_field_values(self, study: Study, field_values: AdvancedParamsFormFields)
if value is not None:
info = FIELDS_INFO[field_name]

# Handle the specific case of `milp` value that appeared in v8.8
if (
field_name == "unit_commitment_mode"
and value == UnitCommitmentMode.MILP
and int(study.version) < 880
):
raise InvalidFieldForVersionError("Unit commitment mode `MILP` only exists in v8.8+ studies")

commands.append(
UpdateConfig(
target=info["path"],
Expand Down
2 changes: 1 addition & 1 deletion antarest/study/business/area_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def update_areas_props(
if old_area.average_spilled_energy_cost != new_area.average_spilled_energy_cost:
commands.append(
UpdateConfig(
target=f"input/thermal/areas/spilledenergycost:{area_id}",
target=f"input/thermal/areas/spilledenergycost/{area_id}",
data=new_area.average_spilled_energy_cost,
command_context=command_context,
)
Expand Down
4 changes: 2 additions & 2 deletions antarest/study/business/link_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def update_links_props(

# Convert the DTO to a configuration object and update the configuration file.
properties = LinkProperties(**new_link_dto.dict(by_alias=False))
path = f"{_ALL_LINKS_PATH}/{area1}/properties"
path = f"{_ALL_LINKS_PATH}/{area1}/properties/{area2}"
cmd = UpdateConfig(
target=path,
data={area2: properties.to_config()},
data=properties.to_config(),
command_context=self.storage_service.variant_study_service.command_factory.command_context,
)
commands.append(cmd)
Expand Down
Loading

0 comments on commit 23027df

Please sign in to comment.