From 13a59293dba60e709c995cffa15cd27cd830bc35 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Fri, 1 Sep 2023 09:42:26 +0200 Subject: [PATCH] style: sort imports in project base code and unit tests using `line_length = 120` --- antarest/core/configdata/model.py | 10 +- antarest/core/core_blueprint.py | 6 +- antarest/core/filetransfer/model.py | 8 +- antarest/core/filetransfer/service.py | 13 +- antarest/core/logging/utils.py | 5 +- antarest/core/tasks/model.py | 10 +- antarest/core/tasks/service.py | 13 +- .../core/utils/fastapi_sqlalchemy/__init__.py | 5 +- .../utils/fastapi_sqlalchemy/middleware.py | 10 +- .../launcher/adapters/abstractlauncher.py | 7 +- .../launcher/adapters/factory_launcher.py | 13 +- .../adapters/local_launcher/local_launcher.py | 6 +- .../adapters/slurm_launcher/slurm_launcher.py | 18 +-- .../extensions/adequacy_patch/extension.py | 4 +- antarest/launcher/model.py | 10 +- antarest/launcher/service.py | 26 +--- antarest/launcher/web.py | 8 +- antarest/login/ldap.py | 6 +- antarest/login/main.py | 8 +- antarest/login/model.py | 10 +- antarest/login/service.py | 7 +- antarest/main.py | 10 +- antarest/matrixstore/main.py | 6 +- .../matrixstore/matrix_garbage_collector.py | 4 +- antarest/matrixstore/model.py | 10 +- antarest/matrixstore/repository.py | 7 +- antarest/matrixstore/service.py | 6 +- antarest/matrixstore/web.py | 8 +- .../business/adequacy_patch_management.py | 11 +- .../advanced_parameters_management.py | 11 +- .../study/business/allocation_management.py | 9 +- antarest/study/business/area_management.py | 26 +--- .../study/business/areas/hydro_management.py | 10 +- .../business/areas/properties_management.py | 14 +- .../business/areas/renewable_management.py | 10 +- .../business/areas/thermal_management.py | 10 +- .../business/binding_constraint_management.py | 9 +- antarest/study/business/config_management.py | 4 +- .../study/business/correlation_management.py | 9 +- antarest/study/business/district_manager.py | 23 +--- antarest/study/business/general_management.py | 15 +-- antarest/study/business/link_management.py | 8 +- antarest/study/business/matrix_management.py | 18 +-- .../study/business/optimization_management.py | 11 +- .../study/business/playlist_management.py | 9 +- .../business/scenario_builder_management.py | 4 +- antarest/study/business/st_storage_manager.py | 23 +--- .../study/business/table_mode_management.py | 36 ++---- .../business/thematic_trimming_management.py | 11 +- .../business/timeseries_config_management.py | 14 +- antarest/study/business/utils.py | 16 +-- .../study/business/xpansion_management.py | 13 +- antarest/study/common/studystorage.py | 11 +- antarest/study/main.py | 20 +-- antarest/study/model.py | 11 +- antarest/study/service.py | 122 ++++-------------- .../study/storage/abstract_storage_service.py | 19 +-- antarest/study/storage/patch_service.py | 7 +- .../storage/rawstudy/io/reader/__init__.py | 5 +- .../rawstudy/model/filesystem/bucket_node.py | 16 +-- .../filesystem/common/area_matrix_list.py | 16 +-- .../model/filesystem/common/prepro.py | 20 +-- .../rawstudy/model/filesystem/config/files.py | 13 +- .../model/filesystem/config/st_storage.py | 4 +- .../rawstudy/model/filesystem/factory.py | 13 +- .../rawstudy/model/filesystem/folder_node.py | 8 +- .../model/filesystem/ini_file_node.py | 8 +- .../rawstudy/model/filesystem/inode.py | 9 +- .../model/filesystem/json_file_node.py | 12 +- .../rawstudy/model/filesystem/lazy_node.py | 15 +-- .../filesystem/matrix/input_series_matrix.py | 13 +- .../model/filesystem/matrix/matrix.py | 12 +- .../filesystem/matrix/output_series_matrix.py | 16 +-- .../model/filesystem/raw_file_node.py | 8 +- .../rawstudy/model/filesystem/root/desktop.py | 12 +- .../model/filesystem/root/filestudytree.py | 32 ++--- .../filesystem/root/input/areas/areas.py | 24 +--- .../root/input/areas/item/adequacy_patch.py | 12 +- .../filesystem/root/input/areas/item/item.py | 12 +- .../root/input/areas/item/optimization.py | 12 +- .../filesystem/root/input/areas/item/ui.py | 12 +- .../model/filesystem/root/input/areas/list.py | 8 +- .../model/filesystem/root/input/areas/sets.py | 12 +- .../bindingconstraints_ini.py | 12 +- .../bindingconstraints/bindingcontraints.py | 8 +- .../root/input/hydro/allocation/allocation.py | 8 +- .../root/input/hydro/allocation/area.py | 12 +- .../input/hydro/common/capacity/capacity.py | 12 +- .../root/input/hydro/common/common.py | 4 +- .../filesystem/root/input/hydro/hydro.py | 24 +--- .../filesystem/root/input/hydro/hydro_ini.py | 12 +- .../root/input/hydro/prepro/area/area.py | 8 +- .../root/input/hydro/prepro/area/prepro.py | 12 +- .../root/input/hydro/prepro/prepro.py | 12 +- .../root/input/hydro/series/area/area.py | 12 +- .../root/input/hydro/series/series.py | 8 +- .../model/filesystem/root/input/input.py | 52 ++------ .../filesystem/root/input/link/area/area.py | 20 +-- .../input/link/area/capacities/capacities.py | 16 +-- .../root/input/link/area/properties.py | 12 +- .../model/filesystem/root/input/link/link.py | 8 +- .../model/filesystem/root/input/load/load.py | 16 +-- .../filesystem/root/input/miscgen/miscgen.py | 12 +- .../root/input/renewables/clusters.py | 16 +-- .../root/input/renewables/renewable.py | 8 +- .../root/input/renewables/series.py | 20 +-- .../root/input/reserves/reserves.py | 12 +- .../filesystem/root/input/solar/solar.py | 16 +-- .../input/st_storage/clusters/area/area.py | 12 +- .../input/st_storage/clusters/area/list.py | 12 +- .../input/st_storage/clusters/clusters.py | 8 +- .../root/input/st_storage/series/area/area.py | 12 +- .../series/area/st_storage/st_storage.py | 12 +- .../root/input/st_storage/series/series.py | 4 +- .../root/input/st_storage/st_storage.py | 8 +- .../root/input/thermal/areas_ini.py | 12 +- .../root/input/thermal/cluster/area/area.py | 12 +- .../root/input/thermal/cluster/area/list.py | 12 +- .../root/input/thermal/cluster/cluster.py | 4 +- .../root/input/thermal/prepro/area/area.py | 12 +- .../thermal/prepro/area/thermal/thermal.py | 8 +- .../root/input/thermal/prepro/prepro.py | 8 +- .../root/input/thermal/series/area/area.py | 12 +- .../thermal/series/area/thermal/thermal.py | 12 +- .../root/input/thermal/series/series.py | 8 +- .../filesystem/root/input/thermal/thermal.py | 20 +-- .../model/filesystem/root/input/wind/wind.py | 16 +-- .../model/filesystem/root/layers/layer_ini.py | 12 +- .../model/filesystem/root/layers/layers.py | 8 +- .../rawstudy/model/filesystem/root/logs.py | 4 +- .../model/filesystem/root/output/output.py | 12 +- .../root/output/simulation/about/about.py | 12 +- .../root/output/simulation/about/study.py | 12 +- .../output/simulation/info_antares_output.py | 12 +- .../output/simulation/mode/common/area.py | 20 +-- .../output/simulation/mode/common/areas.py | 12 +- .../simulation/mode/common/binding_const.py | 8 +- .../output/simulation/mode/common/link.py | 20 +-- .../output/simulation/mode/common/links.py | 12 +- .../root/output/simulation/mode/common/set.py | 20 +-- .../root/output/simulation/mode/economy.py | 13 +- .../root/output/simulation/mode/mcall/grid.py | 8 +- .../output/simulation/mode/mcall/mcall.py | 4 +- .../output/simulation/mode/mcind/mcind.py | 13 +- .../root/output/simulation/mode/mcind/scn.py | 4 +- .../root/output/simulation/simulation.py | 37 ++---- .../simulation/ts_generator/ts_generator.py | 16 +-- .../simulation/ts_numbers/ts_numbers.py | 4 +- .../root/output/simulation/xpansion/lp.py | 12 +- .../output/simulation/xpansion/sensitivity.py | 12 +- .../output/simulation/xpansion/xpansion.py | 8 +- .../filesystem/root/settings/generaldata.py | 12 +- .../root/settings/resources/resources.py | 8 +- .../root/settings/scenariobuilder.py | 12 +- .../filesystem/root/settings/settings.py | 24 +--- .../root/settings/simulations/simulations.py | 4 +- .../model/filesystem/root/study_antares.py | 12 +- .../root/user/expansion/candidates.py | 4 +- .../user/expansion/constraint_resources.py | 12 +- .../root/user/expansion/expansion.py | 25 +--- .../root/user/expansion/matrix_resources.py | 16 +-- .../root/user/expansion/sensitivity.py | 8 +- .../root/user/expansion/settings.py | 20 +-- .../model/filesystem/root/user/user.py | 17 +-- .../study/storage/rawstudy/model/helpers.py | 4 +- .../storage/rawstudy/raw_study_service.py | 22 +--- antarest/study/storage/storage_service.py | 4 +- .../study/storage/study_download_utils.py | 20 +-- .../storage/study_upgrader/upgrader_710.py | 4 +- .../storage/study_upgrader/upgrader_800.py | 4 +- .../storage/study_upgrader/upgrader_810.py | 4 +- .../storage/study_upgrader/upgrader_830.py | 4 +- .../storage/study_upgrader/upgrader_840.py | 4 +- .../storage/study_upgrader/upgrader_850.py | 4 +- .../storage/study_upgrader/upgrader_860.py | 8 +- antarest/study/storage/utils.py | 14 +- .../business/command_extractor.py | 78 +++-------- .../variantstudy/business/command_reverter.py | 104 ++++----------- .../storage/variantstudy/business/utils.py | 4 +- .../business/utils_binding_constraint.py | 11 +- .../storage/variantstudy/command_factory.py | 100 ++++---------- .../variantstudy/model/command/create_area.py | 15 +-- .../command/create_binding_constraint.py | 19 +-- .../model/command/create_cluster.py | 23 +--- .../model/command/create_district.py | 14 +- .../variantstudy/model/command/create_link.py | 33 +---- .../command/create_renewables_cluster.py | 14 +- .../model/command/create_st_storage.py | 36 ++---- .../variantstudy/model/command/icommand.py | 21 +-- .../variantstudy/model/command/remove_area.py | 18 +-- .../command/remove_binding_constraint.py | 14 +- .../model/command/remove_cluster.py | 14 +- .../model/command/remove_district.py | 14 +- .../variantstudy/model/command/remove_link.py | 14 +- .../command/remove_renewables_cluster.py | 15 +-- .../model/command/remove_st_storage.py | 15 +-- .../model/command/replace_matrix.py | 28 +--- .../command/update_binding_constraint.py | 18 +-- .../model/command/update_comments.py | 9 +- .../model/command/update_config.py | 18 +-- .../model/command/update_district.py | 18 +-- .../model/command/update_playlist.py | 9 +- .../model/command/update_raw_file.py | 18 +-- .../model/command/update_scenario_builder.py | 9 +- .../variantstudy/model/command_context.py | 4 +- .../storage/variantstudy/model/dbmodel.py | 9 +- .../storage/variantstudy/model/interfaces.py | 4 +- .../study/storage/variantstudy/repository.py | 5 +- .../variantstudy/variant_command_extractor.py | 16 +-- .../variantstudy/variant_command_generator.py | 17 +-- .../variantstudy/variant_study_service.py | 60 ++------- antarest/study/web/raw_studies_blueprint.py | 7 +- antarest/study/web/studies_blueprint.py | 4 +- antarest/study/web/study_data_blueprint.py | 63 ++------- antarest/study/web/variant_blueprint.py | 9 +- antarest/tools/admin_lib.py | 4 +- antarest/tools/lib.py | 26 +--- antarest/utils.py | 4 +- antarest/worker/simulator_worker.py | 4 +- tests/cache/test_local_cache.py | 10 +- tests/cache/test_redis_cache.py | 10 +- tests/conftest_services.py | 25 +--- tests/core/test_tasks.py | 10 +- tests/core/test_utils.py | 8 +- tests/core/test_utils_bp.py | 7 +- tests/eventbus/test_websocket_manager.py | 6 +- .../study_data_blueprint/test_st_storage.py | 4 +- tests/integration/test_integration.py | 4 +- .../test_integration_variantmanager_tool.py | 9 +- .../test_renewable_cluster.py | 4 +- .../variant_blueprint/test_st_storage.py | 4 +- .../launcher/test_extension_adequacy_patch.py | 4 +- tests/launcher/test_local_launcher.py | 4 +- tests/launcher/test_service.py | 22 +--- tests/launcher/test_web.py | 8 +- tests/login/test_repository.py | 18 +-- tests/matrixstore/conftest.py | 6 +- tests/matrixstore/test_matrix_editor.py | 7 +- .../test_matrix_garbage_collector.py | 16 +-- tests/matrixstore/test_repository.py | 13 +- .../business/test_antares_configparser.py | 5 +- .../storage/business/test_arealink_manager.py | 31 +---- tests/storage/business/test_config_manager.py | 20 +-- tests/storage/business/test_import.py | 6 +- .../business/test_raw_study_service.py | 11 +- .../business/test_study_version_upgrader.py | 18 +-- .../test_timeseries_config_manager.py | 12 +- .../business/test_variant_study_service.py | 13 +- .../storage/business/test_xpansion_manager.py | 24 +--- tests/storage/conftest.py | 8 +- tests/storage/integration/conftest.py | 14 +- tests/storage/integration/test_STA_mini.py | 4 +- tests/storage/integration/test_exporter.py | 16 +-- tests/storage/rawstudies/test_factory.py | 16 +-- .../antares_io/reader/test_ini_reader.py | 4 +- .../filesystem/config/test_config_files.py | 5 +- .../filesystem/config/test_files.py | 12 +- .../filesystem/config/test_utils.py | 4 +- .../filesystem/matrix/head_writer_test.py | 5 +- .../matrix/input_series_matrix_test.py | 8 +- .../matrix/output_series_matrix_test.py | 16 +-- .../filesystem/matrix/test_matrix_node.py | 13 +- .../hydro/common/capacity/test_capacity.py | 21 +-- .../root/input/hydro/series/area/test_area.py | 20 +-- .../simulation/mode/common/test_area.py | 20 +-- .../mode/common/test_binding_const.py | 16 +-- .../simulation/mode/common/test_link.py | 20 +-- .../output/simulation/mode/common/test_set.py | 20 +-- .../special_node/input_areas_list_test.py | 9 +- .../repository/filesystem/test_bucket_node.py | 17 +-- .../repository/filesystem/test_folder_node.py | 21 +-- .../filesystem/test_ini_file_node.py | 8 +- .../repository/filesystem/test_lazy_node.py | 8 +- .../filesystem/test_raw_file_node.py | 8 +- .../filesystem/test_scenariobuilder.py | 10 +- .../filesystem/test_ts_numbers_vector.py | 4 +- tests/storage/repository/filesystem/utils.py | 12 +- tests/storage/repository/test_study.py | 8 +- tests/storage/test_service.py | 35 ++--- tests/storage/web/test_studies_bp.py | 12 +- .../study/business/test_allocation_manager.py | 20 +-- .../business/test_correlation_manager.py | 20 +-- tests/study/business/test_district_manager.py | 34 ++--- .../study/business/test_matrix_management.py | 6 +- .../study/business/test_st_storage_manager.py | 16 +-- .../rawstudy/test_raw_study_service.py | 21 +-- .../storage/test_abstract_storage_service.py | 13 +- .../test_variant_study_service.py | 25 +--- tests/variantstudy/conftest.py | 20 +-- .../model/command/test_create_area.py | 21 +-- .../model/command/test_create_cluster.py | 32 ++--- .../model/command/test_create_link.py | 41 ++---- .../command/test_create_renewables_cluster.py | 29 +---- .../model/command/test_create_st_storage.py | 28 +--- .../test_manage_binding_constraints.py | 49 ++----- .../model/command/test_manage_district.py | 37 ++---- .../model/command/test_remove_area.py | 46 ++----- .../model/command/test_remove_cluster.py | 33 ++--- .../model/command/test_remove_link.py | 28 +--- .../command/test_remove_renewables_cluster.py | 25 +--- .../model/command/test_remove_st_storage.py | 25 +--- .../model/command/test_replace_matrix.py | 24 +--- .../model/command/test_update_comments.py | 20 +-- .../model/command/test_update_config.py | 28 +--- .../model/command/test_update_rawfile.py | 12 +- .../variantstudy/model/test_variant_model.py | 20 +-- tests/variantstudy/test_command_factory.py | 8 +- tests/variantstudy/test_utils.py | 16 +-- 308 files changed, 1035 insertions(+), 3547 deletions(-) diff --git a/antarest/core/configdata/model.py b/antarest/core/configdata/model.py index 19bd523750..05a5baba82 100644 --- a/antarest/core/configdata/model.py +++ b/antarest/core/configdata/model.py @@ -2,15 +2,7 @@ from typing import Any, Optional from pydantic import BaseModel -from sqlalchemy import ( # type: ignore - Boolean, - Column, - DateTime, - ForeignKey, - Integer, - Sequence, - String, -) +from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, Sequence, String # type: ignore from sqlalchemy.orm import relationship # type: ignore from antarest.core.persistence import Base diff --git a/antarest/core/core_blueprint.py b/antarest/core/core_blueprint.py index aea040f814..5eac42ce3b 100644 --- a/antarest/core/core_blueprint.py +++ b/antarest/core/core_blueprint.py @@ -8,11 +8,7 @@ from antarest.core.jwt import JWTUser from antarest.core.requests import UserHasNotPermissionError from antarest.core.utils.web import APITag -from antarest.core.version_info import ( - VersionInfoDTO, - get_commit_id, - get_dependencies, -) +from antarest.core.version_info import VersionInfoDTO, get_commit_id, get_dependencies from antarest.login.auth import Auth diff --git a/antarest/core/filetransfer/model.py b/antarest/core/filetransfer/model.py index b57336bd54..45768abfe8 100644 --- a/antarest/core/filetransfer/model.py +++ b/antarest/core/filetransfer/model.py @@ -4,13 +4,7 @@ from typing import Optional from pydantic import BaseModel -from sqlalchemy import ( # type: ignore - Boolean, - Column, - DateTime, - Integer, - String, -) +from sqlalchemy import Boolean, Column, DateTime, Integer, String # type: ignore from antarest.core.persistence import Base diff --git a/antarest/core/filetransfer/service.py b/antarest/core/filetransfer/service.py index 440e56dfc4..c4431264d4 100644 --- a/antarest/core/filetransfer/service.py +++ b/antarest/core/filetransfer/service.py @@ -9,21 +9,12 @@ from starlette.background import BackgroundTasks from antarest.core.config import Config -from antarest.core.filetransfer.model import ( - FileDownload, - FileDownloadDTO, - FileDownloadNotFound, - FileDownloadNotReady, -) +from antarest.core.filetransfer.model import FileDownload, FileDownloadDTO, FileDownloadNotFound, FileDownloadNotReady from antarest.core.filetransfer.repository import FileDownloadRepository from antarest.core.interfaces.eventbus import Event, EventType, IEventBus from antarest.core.jwt import JWTUser from antarest.core.model import PermissionInfo, PublicMode -from antarest.core.requests import ( - MustBeAuthenticatedError, - RequestParameters, - UserHasNotPermissionError, -) +from antarest.core.requests import MustBeAuthenticatedError, RequestParameters, UserHasNotPermissionError logger = logging.getLogger(__name__) diff --git a/antarest/core/logging/utils.py b/antarest/core/logging/utils.py index 712bc58da9..cc08b28171 100644 --- a/antarest/core/logging/utils.py +++ b/antarest/core/logging/utils.py @@ -5,10 +5,7 @@ from contextvars import ContextVar, Token from typing import Any, Dict, Optional, Type -from starlette.middleware.base import ( - BaseHTTPMiddleware, - RequestResponseEndpoint, -) +from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint from starlette.requests import Request from starlette.responses import Response diff --git a/antarest/core/tasks/model.py b/antarest/core/tasks/model.py index ee1965647c..19b1a8890f 100644 --- a/antarest/core/tasks/model.py +++ b/antarest/core/tasks/model.py @@ -4,15 +4,7 @@ from typing import Any, List, Optional from pydantic import BaseModel, Extra -from sqlalchemy import ( # type: ignore - Boolean, - Column, - DateTime, - ForeignKey, - Integer, - Sequence, - String, -) +from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, Sequence, String # type: ignore from sqlalchemy.orm import relationship # type: ignore from antarest.core.persistence import Base diff --git a/antarest/core/tasks/service.py b/antarest/core/tasks/service.py index 147823af69..5e822bc94d 100644 --- a/antarest/core/tasks/service.py +++ b/antarest/core/tasks/service.py @@ -9,19 +9,10 @@ from fastapi import HTTPException from antarest.core.config import Config -from antarest.core.interfaces.eventbus import ( - Event, - EventChannelDirectory, - EventType, - IEventBus, -) +from antarest.core.interfaces.eventbus import Event, EventChannelDirectory, EventType, IEventBus from antarest.core.jwt import DEFAULT_ADMIN_USER from antarest.core.model import PermissionInfo, PublicMode -from antarest.core.requests import ( - MustBeAuthenticatedError, - RequestParameters, - UserHasNotPermissionError, -) +from antarest.core.requests import MustBeAuthenticatedError, RequestParameters, UserHasNotPermissionError from antarest.core.tasks.model import ( CustomTaskEventMessages, TaskDTO, diff --git a/antarest/core/utils/fastapi_sqlalchemy/__init__.py b/antarest/core/utils/fastapi_sqlalchemy/__init__.py index 6d658b3b99..cdc6aaaaf5 100644 --- a/antarest/core/utils/fastapi_sqlalchemy/__init__.py +++ b/antarest/core/utils/fastapi_sqlalchemy/__init__.py @@ -1,7 +1,4 @@ -from antarest.core.utils.fastapi_sqlalchemy.middleware import ( - DBSessionMiddleware, - db, -) +from antarest.core.utils.fastapi_sqlalchemy.middleware import DBSessionMiddleware, db __all__ = ["db", "DBSessionMiddleware"] diff --git a/antarest/core/utils/fastapi_sqlalchemy/middleware.py b/antarest/core/utils/fastapi_sqlalchemy/middleware.py index 4f44446014..6f55b43a70 100644 --- a/antarest/core/utils/fastapi_sqlalchemy/middleware.py +++ b/antarest/core/utils/fastapi_sqlalchemy/middleware.py @@ -5,18 +5,12 @@ from sqlalchemy.engine import Engine # type: ignore from sqlalchemy.engine.url import URL # type: ignore from sqlalchemy.orm import Session, sessionmaker # type: ignore -from starlette.middleware.base import ( - BaseHTTPMiddleware, - RequestResponseEndpoint, -) +from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint from starlette.requests import Request from starlette.responses import Response from starlette.types import ASGIApp -from antarest.core.utils.fastapi_sqlalchemy.exceptions import ( - MissingSessionError, - SessionNotInitialisedError, -) +from antarest.core.utils.fastapi_sqlalchemy.exceptions import MissingSessionError, SessionNotInitialisedError _Session: sessionmaker = None _session: ContextVar[Optional[Session]] = ContextVar("_session", default=None) diff --git a/antarest/launcher/adapters/abstractlauncher.py b/antarest/launcher/adapters/abstractlauncher.py index 51c5b2a975..747cb708b0 100644 --- a/antarest/launcher/adapters/abstractlauncher.py +++ b/antarest/launcher/adapters/abstractlauncher.py @@ -5,12 +5,7 @@ from antarest.core.config import Config from antarest.core.interfaces.cache import ICache -from antarest.core.interfaces.eventbus import ( - Event, - EventChannelDirectory, - EventType, - IEventBus, -) +from antarest.core.interfaces.eventbus import Event, EventChannelDirectory, EventType, IEventBus from antarest.core.model import PermissionInfo, PublicMode from antarest.core.requests import RequestParameters from antarest.launcher.adapters.log_parser import LaunchProgressDTO diff --git a/antarest/launcher/adapters/factory_launcher.py b/antarest/launcher/adapters/factory_launcher.py index b391b14534..383e36f999 100644 --- a/antarest/launcher/adapters/factory_launcher.py +++ b/antarest/launcher/adapters/factory_launcher.py @@ -4,16 +4,9 @@ from antarest.core.config import Config from antarest.core.interfaces.cache import ICache from antarest.core.interfaces.eventbus import IEventBus -from antarest.launcher.adapters.abstractlauncher import ( - AbstractLauncher, - LauncherCallbacks, -) -from antarest.launcher.adapters.local_launcher.local_launcher import ( - LocalLauncher, -) -from antarest.launcher.adapters.slurm_launcher.slurm_launcher import ( - SlurmLauncher, -) +from antarest.launcher.adapters.abstractlauncher import AbstractLauncher, LauncherCallbacks +from antarest.launcher.adapters.local_launcher.local_launcher import LocalLauncher +from antarest.launcher.adapters.slurm_launcher.slurm_launcher import SlurmLauncher logger = logging.getLogger(__name__) diff --git a/antarest/launcher/adapters/local_launcher/local_launcher.py b/antarest/launcher/adapters/local_launcher/local_launcher.py index 618aed6581..5bf320065d 100644 --- a/antarest/launcher/adapters/local_launcher/local_launcher.py +++ b/antarest/launcher/adapters/local_launcher/local_launcher.py @@ -13,11 +13,7 @@ from antarest.core.interfaces.cache import ICache from antarest.core.interfaces.eventbus import IEventBus from antarest.core.requests import RequestParameters -from antarest.launcher.adapters.abstractlauncher import ( - AbstractLauncher, - LauncherCallbacks, - LauncherInitException, -) +from antarest.launcher.adapters.abstractlauncher import AbstractLauncher, LauncherCallbacks, LauncherInitException from antarest.launcher.adapters.log_manager import LogTailManager from antarest.launcher.model import JobStatus, LauncherParametersDTO, LogType diff --git a/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py b/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py index 80070ecb06..51ec139841 100644 --- a/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py +++ b/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py @@ -13,10 +13,7 @@ from antareslauncher.data_repo.data_repo_tinydb import DataRepoTinydb from antareslauncher.main import MainParameters, run_with -from antareslauncher.main_option_parser import ( - MainOptionParser, - ParserParameters, -) +from antareslauncher.main_option_parser import MainOptionParser, ParserParameters from antareslauncher.study_dto import StudyDTO from filelock import FileLock @@ -26,18 +23,9 @@ from antarest.core.model import PermissionInfo, PublicMode from antarest.core.requests import RequestParameters from antarest.core.utils.utils import assert_this, unzip -from antarest.launcher.adapters.abstractlauncher import ( - AbstractLauncher, - LauncherCallbacks, - LauncherInitException, -) +from antarest.launcher.adapters.abstractlauncher import AbstractLauncher, LauncherCallbacks, LauncherInitException from antarest.launcher.adapters.log_manager import LogTailManager -from antarest.launcher.model import ( - JobStatus, - LauncherParametersDTO, - LogType, - XpansionParametersDTO, -) +from antarest.launcher.model import JobStatus, LauncherParametersDTO, LogType, XpansionParametersDTO from antarest.study.storage.rawstudy.io.reader import IniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter diff --git a/antarest/launcher/extensions/adequacy_patch/extension.py b/antarest/launcher/extensions/adequacy_patch/extension.py index 59be0136c0..28791dcd98 100644 --- a/antarest/launcher/extensions/adequacy_patch/extension.py +++ b/antarest/launcher/extensions/adequacy_patch/extension.py @@ -11,9 +11,7 @@ from antarest.core.utils.utils import assert_this from antarest.launcher.extensions.interface import ILauncherExtension from antarest.study.service import StudyService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy logger = logging.getLogger(__name__) diff --git a/antarest/launcher/model.py b/antarest/launcher/model.py index f98135740d..e59a66a987 100644 --- a/antarest/launcher/model.py +++ b/antarest/launcher/model.py @@ -3,15 +3,7 @@ from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel -from sqlalchemy import ( # type: ignore - Column, - DateTime, - Enum, - ForeignKey, - Integer, - Sequence, - String, -) +from sqlalchemy import Column, DateTime, Enum, ForeignKey, Integer, Sequence, String # type: ignore from sqlalchemy.orm import relationship # type: ignore from antarest.core.persistence import Base diff --git a/antarest/launcher/service.py b/antarest/launcher/service.py index 039c0287be..1cc90328a6 100644 --- a/antarest/launcher/service.py +++ b/antarest/launcher/service.py @@ -15,31 +15,17 @@ from antarest.core.filetransfer.model import FileDownloadTaskDTO from antarest.core.filetransfer.service import FileTransferManager from antarest.core.interfaces.cache import ICache -from antarest.core.interfaces.eventbus import ( - Event, - EventChannelDirectory, - EventType, - IEventBus, -) +from antarest.core.interfaces.eventbus import Event, EventChannelDirectory, EventType, IEventBus from antarest.core.jwt import DEFAULT_ADMIN_USER, JWTUser from antarest.core.model import PermissionInfo, PublicMode, StudyPermissionType from antarest.core.requests import RequestParameters, UserHasNotPermissionError from antarest.core.tasks.model import TaskResult, TaskType from antarest.core.tasks.service import ITaskService, TaskUpdateNotifier from antarest.core.utils.fastapi_sqlalchemy import db -from antarest.core.utils.utils import ( - StopWatch, - concat_files, - concat_files_to_str, - is_zip, - read_in_zip, - zip_dir, -) +from antarest.core.utils.utils import StopWatch, concat_files, concat_files_to_str, is_zip, read_in_zip, zip_dir from antarest.launcher.adapters.abstractlauncher import LauncherCallbacks from antarest.launcher.adapters.factory_launcher import FactoryLauncher -from antarest.launcher.extensions.adequacy_patch.extension import ( - AdequacyPatchExtension, -) +from antarest.launcher.extensions.adequacy_patch.extension import AdequacyPatchExtension from antarest.launcher.extensions.interface import ILauncherExtension from antarest.launcher.model import ( JobLog, @@ -52,11 +38,7 @@ ) from antarest.launcher.repository import JobResultRepository from antarest.study.service import StudyService -from antarest.study.storage.utils import ( - assert_permission, - extract_output_name, - find_single_output_path, -) +from antarest.study.storage.utils import assert_permission, extract_output_name, find_single_output_path logger = logging.getLogger(__name__) diff --git a/antarest/launcher/web.py b/antarest/launcher/web.py index c82fcf000b..c5e72870fd 100644 --- a/antarest/launcher/web.py +++ b/antarest/launcher/web.py @@ -11,13 +11,7 @@ from antarest.core.jwt import JWTUser from antarest.core.requests import RequestParameters from antarest.core.utils.web import APITag -from antarest.launcher.model import ( - JobCreationDTO, - JobResultDTO, - LauncherEnginesDTO, - LauncherParametersDTO, - LogType, -) +from antarest.launcher.model import JobCreationDTO, JobResultDTO, LauncherEnginesDTO, LauncherParametersDTO, LogType from antarest.launcher.service import LauncherService from antarest.login.auth import Auth diff --git a/antarest/login/ldap.py b/antarest/login/ldap.py index aba59e79b2..de8f704010 100644 --- a/antarest/login/ldap.py +++ b/antarest/login/ldap.py @@ -7,11 +7,7 @@ from antarest.core.config import Config from antarest.core.model import JSON from antarest.login.model import Group, Role, UserLdap -from antarest.login.repository import ( - GroupRepository, - RoleRepository, - UserLdapRepository, -) +from antarest.login.repository import GroupRepository, RoleRepository, UserLdapRepository logger = logging.getLogger(__name__) diff --git a/antarest/login/main.py b/antarest/login/main.py index 6260f3bd2a..b7663a1309 100644 --- a/antarest/login/main.py +++ b/antarest/login/main.py @@ -12,13 +12,7 @@ from antarest.core.interfaces.eventbus import DummyEventBusService, IEventBus from antarest.core.utils.fastapi_sqlalchemy import db from antarest.login.ldap import LdapService -from antarest.login.repository import ( - BotRepository, - GroupRepository, - RoleRepository, - UserLdapRepository, - UserRepository, -) +from antarest.login.repository import BotRepository, GroupRepository, RoleRepository, UserLdapRepository, UserRepository from antarest.login.service import LoginService from antarest.login.web import create_login_api diff --git a/antarest/login/model.py b/antarest/login/model.py index e184bc2266..06453ed27c 100644 --- a/antarest/login/model.py +++ b/antarest/login/model.py @@ -4,15 +4,7 @@ import bcrypt from pydantic.main import BaseModel -from sqlalchemy import ( # type: ignore - Boolean, - Column, - Enum, - ForeignKey, - Integer, - Sequence, - String, -) +from sqlalchemy import Boolean, Column, Enum, ForeignKey, Integer, Sequence, String # type: ignore from sqlalchemy.ext.hybrid import hybrid_property # type: ignore from sqlalchemy.orm import relationship # type: ignore diff --git a/antarest/login/service.py b/antarest/login/service.py index cea68643d8..bef44d373b 100644 --- a/antarest/login/service.py +++ b/antarest/login/service.py @@ -27,12 +27,7 @@ UserLdap, UserRoleDTO, ) -from antarest.login.repository import ( - BotRepository, - GroupRepository, - RoleRepository, - UserRepository, -) +from antarest.login.repository import BotRepository, GroupRepository, RoleRepository, UserRepository logger = logging.getLogger(__name__) diff --git a/antarest/main.py b/antarest/main.py index c67155d798..3cd6751720 100644 --- a/antarest/main.py +++ b/antarest/main.py @@ -16,11 +16,7 @@ from ratelimit import RateLimitMiddleware # type: ignore from ratelimit.backends.redis import RedisBackend # type: ignore from ratelimit.backends.simple import MemoryBackend # type: ignore -from starlette.middleware.base import ( - BaseHTTPMiddleware, - DispatchFunction, - RequestResponseEndpoint, -) +from starlette.middleware.base import BaseHTTPMiddleware, DispatchFunction, RequestResponseEndpoint from starlette.middleware.cors import CORSMiddleware from starlette.requests import Request from starlette.responses import JSONResponse @@ -37,9 +33,7 @@ from antarest.core.utils.utils import get_local_path from antarest.core.utils.web import tags_metadata from antarest.login.auth import Auth, JwtSettings -from antarest.matrixstore.matrix_garbage_collector import ( - MatrixGarbageCollector, -) +from antarest.matrixstore.matrix_garbage_collector import MatrixGarbageCollector from antarest.singleton_services import SingletonServices from antarest.study.storage.auto_archive_service import AutoArchiveService from antarest.study.storage.rawstudy.watcher import Watcher diff --git a/antarest/matrixstore/main.py b/antarest/matrixstore/main.py index 47c9d8d910..2dbc0002f3 100644 --- a/antarest/matrixstore/main.py +++ b/antarest/matrixstore/main.py @@ -7,11 +7,7 @@ from antarest.core.filetransfer.service import FileTransferManager from antarest.core.tasks.service import ITaskService from antarest.login.service import LoginService -from antarest.matrixstore.repository import ( - MatrixContentRepository, - MatrixDataSetRepository, - MatrixRepository, -) +from antarest.matrixstore.repository import MatrixContentRepository, MatrixDataSetRepository, MatrixRepository from antarest.matrixstore.service import MatrixService from antarest.matrixstore.web import create_matrix_api diff --git a/antarest/matrixstore/matrix_garbage_collector.py b/antarest/matrixstore/matrix_garbage_collector.py index 5adc7fed80..82f38663db 100644 --- a/antarest/matrixstore/matrix_garbage_collector.py +++ b/antarest/matrixstore/matrix_garbage_collector.py @@ -16,9 +16,7 @@ from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.dbmodel import CommandBlock from antarest.study.storage.variantstudy.model.model import CommandDTO -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService logger = logging.getLogger(__name__) diff --git a/antarest/matrixstore/model.py b/antarest/matrixstore/model.py index 9050284840..f8cd401b1b 100644 --- a/antarest/matrixstore/model.py +++ b/antarest/matrixstore/model.py @@ -3,15 +3,7 @@ from typing import Any, List, Union from pydantic import BaseModel -from sqlalchemy import ( # type: ignore - Boolean, - Column, - DateTime, - ForeignKey, - Integer, - String, - Table, -) +from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String, Table # type: ignore from sqlalchemy.orm import relationship # type: ignore from antarest.core.persistence import Base diff --git a/antarest/matrixstore/repository.py b/antarest/matrixstore/repository.py index 9a7c6811c5..3993aa231f 100644 --- a/antarest/matrixstore/repository.py +++ b/antarest/matrixstore/repository.py @@ -10,12 +10,7 @@ from sqlalchemy.orm import aliased # type: ignore from antarest.core.utils.fastapi_sqlalchemy import db -from antarest.matrixstore.model import ( - Matrix, - MatrixContent, - MatrixData, - MatrixDataSet, -) +from antarest.matrixstore.model import Matrix, MatrixContent, MatrixData, MatrixDataSet logger = logging.getLogger(__name__) diff --git a/antarest/matrixstore/service.py b/antarest/matrixstore/service.py index 0f2afdeab0..de0f3af8a4 100644 --- a/antarest/matrixstore/service.py +++ b/antarest/matrixstore/service.py @@ -34,11 +34,7 @@ MatrixDTO, MatrixInfoDTO, ) -from antarest.matrixstore.repository import ( - MatrixContentRepository, - MatrixDataSetRepository, - MatrixRepository, -) +from antarest.matrixstore.repository import MatrixContentRepository, MatrixDataSetRepository, MatrixRepository logger = logging.getLogger(__name__) diff --git a/antarest/matrixstore/web.py b/antarest/matrixstore/web.py index 9044a76cef..7ff7e5c129 100644 --- a/antarest/matrixstore/web.py +++ b/antarest/matrixstore/web.py @@ -11,13 +11,7 @@ from antarest.core.requests import RequestParameters, UserHasNotPermissionError from antarest.core.utils.web import APITag from antarest.login.auth import Auth -from antarest.matrixstore.model import ( - MatrixData, - MatrixDataSetDTO, - MatrixDataSetUpdateDTO, - MatrixDTO, - MatrixInfoDTO, -) +from antarest.matrixstore.model import MatrixData, MatrixDataSetDTO, MatrixDataSetUpdateDTO, MatrixDTO, MatrixInfoDTO from antarest.matrixstore.service import MatrixService logger = logging.getLogger(__name__) diff --git a/antarest/study/business/adequacy_patch_management.py b/antarest/study/business/adequacy_patch_management.py index 9b43e2866d..cd169981fd 100644 --- a/antarest/study/business/adequacy_patch_management.py +++ b/antarest/study/business/adequacy_patch_management.py @@ -3,17 +3,10 @@ from pydantic.types import StrictBool, confloat 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.business.utils import GENERAL_DATA_PATH, FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class PriceTakingOrder(EnumIgnoreCase): diff --git a/antarest/study/business/advanced_parameters_management.py b/antarest/study/business/advanced_parameters_management.py index 34e5277a99..476aa2b53e 100644 --- a/antarest/study/business/advanced_parameters_management.py +++ b/antarest/study/business/advanced_parameters_management.py @@ -5,17 +5,10 @@ from pydantic.types import StrictInt, StrictStr 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.business.utils import GENERAL_DATA_PATH, FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class InitialReservoirLevel(EnumIgnoreCase): diff --git a/antarest/study/business/allocation_management.py b/antarest/study/business/allocation_management.py index 035cf19bd3..1222f3acc8 100644 --- a/antarest/study/business/allocation_management.py +++ b/antarest/study/business/allocation_management.py @@ -6,15 +6,10 @@ from antarest.core.exceptions import AllocationDataNotFound, AreaNotFound from antarest.study.business.area_management import AreaInfoDTO -from antarest.study.business.utils import ( - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class AllocationField(FormFieldsBaseModel): diff --git a/antarest/study/business/area_management.py b/antarest/study/business/area_management.py index c5114a75db..abdf0bf229 100644 --- a/antarest/study/business/area_management.py +++ b/antarest/study/business/area_management.py @@ -7,32 +7,16 @@ from antarest.core.exceptions import LayerNotAllowedToBeDeleted, LayerNotFound from antarest.study.business.utils import execute_or_add_commands -from antarest.study.model import ( - Patch, - PatchArea, - PatchCluster, - RawStudy, - Study, -) +from antarest.study.model import Patch, PatchArea, PatchCluster, RawStudy, Study from antarest.study.repository import StudyMetadataRepository from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - DistrictSet, - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, DistrictSet, transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig logger = logging.getLogger(__name__) diff --git a/antarest/study/business/areas/hydro_management.py b/antarest/study/business/areas/hydro_management.py index 506ebd9862..f9d253f331 100644 --- a/antarest/study/business/areas/hydro_management.py +++ b/antarest/study/business/areas/hydro_management.py @@ -2,16 +2,10 @@ from pydantic import Field -from antarest.study.business.utils import ( - FieldInfo, - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class ManagementOptionsFormFields(FormFieldsBaseModel): diff --git a/antarest/study/business/areas/properties_management.py b/antarest/study/business/areas/properties_management.py index 570cd51ff1..13048a613d 100644 --- a/antarest/study/business/areas/properties_management.py +++ b/antarest/study/business/areas/properties_management.py @@ -5,19 +5,11 @@ from pydantic import Field, root_validator from antarest.study.business.enum_ignore_case import EnumIgnoreCase -from antarest.study.business.utils import ( - FieldInfo, - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig AREA_PATH = "input/areas/{area}" THERMAL_PATH = "input/thermal/areas/{field}/{{area}}" diff --git a/antarest/study/business/areas/renewable_management.py b/antarest/study/business/areas/renewable_management.py index 853886f94e..1eec0acc16 100644 --- a/antarest/study/business/areas/renewable_management.py +++ b/antarest/study/business/areas/renewable_management.py @@ -4,16 +4,10 @@ from pydantic import Field from antarest.study.business.enum_ignore_case import EnumIgnoreCase -from antarest.study.business.utils import ( - FieldInfo, - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class TimeSeriesInterpretation(EnumIgnoreCase): diff --git a/antarest/study/business/areas/thermal_management.py b/antarest/study/business/areas/thermal_management.py index d0bdf3bc25..3d5a1b4482 100644 --- a/antarest/study/business/areas/thermal_management.py +++ b/antarest/study/business/areas/thermal_management.py @@ -4,16 +4,10 @@ from pydantic import StrictBool, StrictStr from antarest.study.business.enum_ignore_case import EnumIgnoreCase -from antarest.study.business.utils import ( - FieldInfo, - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class TimeSeriesGenerationOption(EnumIgnoreCase): diff --git a/antarest/study/business/binding_constraint_management.py b/antarest/study/business/binding_constraint_management.py index 4b24c28f04..c25393b15f 100644 --- a/antarest/study/business/binding_constraint_management.py +++ b/antarest/study/business/binding_constraint_management.py @@ -13,13 +13,8 @@ from antarest.study.business.utils import execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.common import ( - BindingConstraintOperator, - TimeStep, -) -from antarest.study.storage.variantstudy.model.command.update_binding_constraint import ( - UpdateBindingConstraint, -) +from antarest.study.storage.variantstudy.model.command.common import BindingConstraintOperator, TimeStep +from antarest.study.storage.variantstudy.model.command.update_binding_constraint import UpdateBindingConstraint class LinkInfoDTO(BaseModel): diff --git a/antarest/study/business/config_management.py b/antarest/study/business/config_management.py index d56604a6a7..9bc390e924 100644 --- a/antarest/study/business/config_management.py +++ b/antarest/study/business/config_management.py @@ -4,9 +4,7 @@ from antarest.study.model import Study from antarest.study.storage.rawstudy.model.helpers import FileStudyHelpers from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_playlist import ( - UpdatePlaylist, -) +from antarest.study.storage.variantstudy.model.command.update_playlist import UpdatePlaylist class ConfigManager: diff --git a/antarest/study/business/correlation_management.py b/antarest/study/business/correlation_management.py index 73e3dc772d..77c18ad2d8 100644 --- a/antarest/study/business/correlation_management.py +++ b/antarest/study/business/correlation_management.py @@ -11,16 +11,11 @@ from antarest.core.exceptions import AreaNotFound from antarest.study.business.area_management import AreaInfoDTO -from antarest.study.business.utils import ( - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class AreaCoefficientItem(FormFieldsBaseModel): diff --git a/antarest/study/business/district_manager.py b/antarest/study/business/district_manager.py index c203002d8e..c38f8b86c4 100644 --- a/antarest/study/business/district_manager.py +++ b/antarest/study/business/district_manager.py @@ -2,27 +2,14 @@ from pydantic import BaseModel -from antarest.core.exceptions import ( - AreaNotFound, - DistrictAlreadyExist, - DistrictNotFound, -) +from antarest.core.exceptions import AreaNotFound, DistrictAlreadyExist, DistrictNotFound from antarest.study.business.utils import execute_or_add_commands from antarest.study.model import Study -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.create_district import ( - CreateDistrict, - DistrictBaseFilter, -) -from antarest.study.storage.variantstudy.model.command.remove_district import ( - RemoveDistrict, -) -from antarest.study.storage.variantstudy.model.command.update_district import ( - UpdateDistrict, -) +from antarest.study.storage.variantstudy.model.command.create_district import CreateDistrict, DistrictBaseFilter +from antarest.study.storage.variantstudy.model.command.remove_district import RemoveDistrict +from antarest.study.storage.variantstudy.model.command.update_district import UpdateDistrict class DistrictUpdateDTO(BaseModel): diff --git a/antarest/study/business/general_management.py b/antarest/study/business/general_management.py index 31ebe03b3c..1b67f0cd94 100644 --- a/antarest/study/business/general_management.py +++ b/antarest/study/business/general_management.py @@ -3,21 +3,12 @@ from pydantic import PositiveInt, StrictBool, conint, root_validator 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.business.utils import GENERAL_DATA_PATH, FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext class Mode(EnumIgnoreCase): diff --git a/antarest/study/business/link_management.py b/antarest/study/business/link_management.py index bc60f6c9bf..77c86a0a76 100644 --- a/antarest/study/business/link_management.py +++ b/antarest/study/business/link_management.py @@ -5,12 +5,8 @@ from antarest.study.business.utils import execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command.remove_link import ( - RemoveLink, -) +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command.remove_link import RemoveLink class LinkUIDTO(BaseModel): diff --git a/antarest/study/business/matrix_management.py b/antarest/study/business/matrix_management.py index 4cdc1de1b2..64c1cb6610 100644 --- a/antarest/study/business/matrix_management.py +++ b/antarest/study/business/matrix_management.py @@ -6,24 +6,14 @@ import numpy as np import pandas as pd -from antarest.matrixstore.matrix_editor import ( - MatrixEditInstruction, - MatrixSlice, - Operation, -) +from antarest.matrixstore.matrix_editor import MatrixEditInstruction, MatrixSlice, Operation from antarest.study.business.utils import execute_or_add_commands from antarest.study.model import Study -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.utils import is_managed -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, -) -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix logger = logging.getLogger(__name__) diff --git a/antarest/study/business/optimization_management.py b/antarest/study/business/optimization_management.py index 6e2d8a5b02..7465fa184b 100644 --- a/antarest/study/business/optimization_management.py +++ b/antarest/study/business/optimization_management.py @@ -3,17 +3,10 @@ from pydantic.types import StrictBool 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.business.utils import GENERAL_DATA_PATH, FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class LegacyTransmissionCapacities(EnumIgnoreCase): diff --git a/antarest/study/business/playlist_management.py b/antarest/study/business/playlist_management.py index f801c8d781..68bf795082 100644 --- a/antarest/study/business/playlist_management.py +++ b/antarest/study/business/playlist_management.py @@ -3,16 +3,11 @@ from pydantic.types import StrictBool, StrictFloat, StrictInt from antarest.study.business.general_management import FIELDS_INFO -from antarest.study.business.utils import ( - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import RawStudy from antarest.study.storage.rawstudy.model.helpers import FileStudyHelpers from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_playlist import ( - UpdatePlaylist, -) +from antarest.study.storage.variantstudy.model.command.update_playlist import UpdatePlaylist DEFAULT_WEIGHT = 1 diff --git a/antarest/study/business/scenario_builder_management.py b/antarest/study/business/scenario_builder_management.py index c179435350..d6f8cad802 100644 --- a/antarest/study/business/scenario_builder_management.py +++ b/antarest/study/business/scenario_builder_management.py @@ -3,9 +3,7 @@ from antarest.study.business.utils import execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_scenario_builder import ( - UpdateScenarioBuilder, -) +from antarest.study.storage.variantstudy.model.command.update_scenario_builder import UpdateScenarioBuilder KEY_SEP = "," HL_COEF = 100 diff --git a/antarest/study/business/st_storage_manager.py b/antarest/study/business/st_storage_manager.py index 622cf0a6ee..4e3aa7d724 100644 --- a/antarest/study/business/st_storage_manager.py +++ b/antarest/study/business/st_storage_manager.py @@ -12,26 +12,13 @@ STStorageFieldsNotFoundError, STStorageMatrixNotFoundError, ) -from antarest.study.business.utils import ( - AllOptionalMetaclass, - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import AllOptionalMetaclass, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study -from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import ( - STStorageConfig, - STStorageGroup, -) +from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import STStorageConfig, STStorageGroup from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.create_st_storage import ( - CreateSTStorage, -) -from antarest.study.storage.variantstudy.model.command.remove_st_storage import ( - RemoveSTStorage, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.create_st_storage import CreateSTStorage +from antarest.study.storage.variantstudy.model.command.remove_st_storage import RemoveSTStorage +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig _HOURS_IN_YEAR = 8760 diff --git a/antarest/study/business/table_mode_management.py b/antarest/study/business/table_mode_management.py index c2dfd56c45..6e4baa3c99 100644 --- a/antarest/study/business/table_mode_management.py +++ b/antarest/study/business/table_mode_management.py @@ -3,39 +3,19 @@ from pydantic import StrictFloat from pydantic.types import StrictBool, StrictInt, StrictStr -from antarest.study.business.areas.properties_management import ( - AdequacyPatchMode, -) -from antarest.study.business.areas.renewable_management import ( - TimeSeriesInterpretation, -) -from antarest.study.business.areas.thermal_management import ( - LawOption, - TimeSeriesGenerationOption, -) -from antarest.study.business.binding_constraint_management import ( - BindingConstraintManager, -) +from antarest.study.business.areas.properties_management import AdequacyPatchMode +from antarest.study.business.areas.renewable_management import TimeSeriesInterpretation +from antarest.study.business.areas.thermal_management import LawOption, TimeSeriesGenerationOption +from antarest.study.business.binding_constraint_management import BindingConstraintManager from antarest.study.business.enum_ignore_case import EnumIgnoreCase -from antarest.study.business.utils import ( - FormFieldsBaseModel, - execute_or_add_commands, -) -from antarest.study.common.default_values import ( - FilteringOptions, - LinkProperties, - NodalOptimization, -) +from antarest.study.business.utils import FormFieldsBaseModel, execute_or_add_commands +from antarest.study.common.default_values import FilteringOptions, LinkProperties, NodalOptimization from antarest.study.model import RawStudy from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.update_binding_constraint import ( - UpdateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_binding_constraint import UpdateBindingConstraint +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class TableTemplateType(EnumIgnoreCase): diff --git a/antarest/study/business/thematic_trimming_management.py b/antarest/study/business/thematic_trimming_management.py index ad1bb19e76..e2d49cee7c 100644 --- a/antarest/study/business/thematic_trimming_management.py +++ b/antarest/study/business/thematic_trimming_management.py @@ -2,17 +2,10 @@ from pydantic.types import StrictBool -from antarest.study.business.utils import ( - GENERAL_DATA_PATH, - FieldInfo, - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import GENERAL_DATA_PATH, FieldInfo, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class ThematicTrimmingFormFields(FormFieldsBaseModel): diff --git a/antarest/study/business/timeseries_config_management.py b/antarest/study/business/timeseries_config_management.py index c3bd6138f1..10bce4771c 100644 --- a/antarest/study/business/timeseries_config_management.py +++ b/antarest/study/business/timeseries_config_management.py @@ -4,20 +4,12 @@ from antarest.core.model import JSON from antarest.study.business.enum_ignore_case import EnumIgnoreCase -from antarest.study.business.utils import ( - GENERAL_DATA_PATH, - FormFieldsBaseModel, - execute_or_add_commands, -) +from antarest.study.business.utils import GENERAL_DATA_PATH, FormFieldsBaseModel, execute_or_add_commands from antarest.study.model import Study -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - ENR_MODELLING, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import ENR_MODELLING from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig class TSType(EnumIgnoreCase): diff --git a/antarest/study/business/utils.py b/antarest/study/business/utils.py index c7a49bb124..cdc2988ae4 100644 --- a/antarest/study/business/utils.py +++ b/antarest/study/business/utils.py @@ -1,14 +1,4 @@ -from typing import ( - Any, - Callable, - Dict, - MutableSequence, - Optional, - Sequence, - Tuple, - Type, - TypedDict, -) +from typing import Any, Callable, Dict, MutableSequence, Optional, Sequence, Tuple, Type, TypedDict import pydantic from pydantic import BaseModel, Extra @@ -21,9 +11,7 @@ from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.utils import is_managed -from antarest.study.storage.variantstudy.business.utils import ( - transform_command_to_dto, -) +from antarest.study.storage.variantstudy.business.utils import transform_command_to_dto from antarest.study.storage.variantstudy.model.command.icommand import ICommand # noinspection SpellCheckingInspection diff --git a/antarest/study/business/xpansion_management.py b/antarest/study/business/xpansion_management.py index bd3842b048..bae71b50d1 100644 --- a/antarest/study/business/xpansion_management.py +++ b/antarest/study/business/xpansion_management.py @@ -13,17 +13,10 @@ from antarest.core.utils.utils import suppress_exception from antarest.study.business.enum_ignore_case import EnumIgnoreCase from antarest.study.model import Study -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, - FolderNode, -) -from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.expansion import ( - Expansion, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError, FolderNode +from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.expansion import Expansion from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.utils import fix_study_root diff --git a/antarest/study/common/studystorage.py b/antarest/study/common/studystorage.py index 55c00a3e3f..566e870edd 100644 --- a/antarest/study/common/studystorage.py +++ b/antarest/study/common/studystorage.py @@ -5,15 +5,8 @@ from antarest.core.exceptions import StudyNotFoundError from antarest.core.model import JSON from antarest.core.requests import RequestParameters -from antarest.study.model import ( - Study, - StudyMetadataDTO, - StudyMetadataPatchDTO, - StudySimResultDTO, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfigDTO, -) +from antarest.study.model import Study, StudyMetadataDTO, StudyMetadataPatchDTO, StudySimResultDTO +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfigDTO from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy T = TypeVar("T", bound=Study) diff --git a/antarest/study/main.py b/antarest/study/main.py index 6df780a368..f9db289360 100644 --- a/antarest/study/main.py +++ b/antarest/study/main.py @@ -13,27 +13,17 @@ from antarest.study.repository import StudyMetadataRepository from antarest.study.service import StudyService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.factory import StudyFactory from antarest.study.storage.rawstudy.raw_study_service import RawStudyService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.repository import ( - VariantStudyRepository, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.repository import VariantStudyRepository +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService from antarest.study.web.raw_studies_blueprint import create_raw_study_routes from antarest.study.web.studies_blueprint import create_study_routes from antarest.study.web.study_data_blueprint import create_study_data_routes from antarest.study.web.variant_blueprint import create_study_variant_routes -from antarest.study.web.xpansion_studies_blueprint import ( - create_xpansion_routes, -) +from antarest.study.web.xpansion_studies_blueprint import create_xpansion_routes def build_study_service( diff --git a/antarest/study/model.py b/antarest/study/model.py index 4948ddcc7e..793a8d37be 100644 --- a/antarest/study/model.py +++ b/antarest/study/model.py @@ -6,16 +6,7 @@ from typing import Any, Dict, List, Optional, Tuple from pydantic import BaseModel -from sqlalchemy import ( # type: ignore - Boolean, - Column, - DateTime, - Enum, - ForeignKey, - Integer, - String, - Table, -) +from sqlalchemy import Boolean, Column, DateTime, Enum, ForeignKey, Integer, String, Table # type: ignore from sqlalchemy.orm import relationship # type: ignore from antarest.core.exceptions import ShouldNotHappenException diff --git a/antarest/study/service.py b/antarest/study/service.py index 9715dae13a..2ebe96db60 100644 --- a/antarest/study/service.py +++ b/antarest/study/service.py @@ -32,81 +32,39 @@ from antarest.core.interfaces.cache import CacheConstants, ICache from antarest.core.interfaces.eventbus import Event, EventType, IEventBus from antarest.core.jwt import DEFAULT_ADMIN_USER, JWTUser -from antarest.core.model import ( - JSON, - SUB_JSON, - PermissionInfo, - PublicMode, - StudyPermissionType, -) +from antarest.core.model import JSON, SUB_JSON, PermissionInfo, PublicMode, StudyPermissionType from antarest.core.requests import RequestParameters, UserHasNotPermissionError from antarest.core.roles import RoleType -from antarest.core.tasks.model import ( - TaskListFilter, - TaskResult, - TaskStatus, - TaskType, -) -from antarest.core.tasks.service import ( - ITaskService, - TaskUpdateNotifier, - noop_notifier, -) +from antarest.core.tasks.model import TaskListFilter, TaskResult, TaskStatus, TaskType +from antarest.core.tasks.service import ITaskService, TaskUpdateNotifier, noop_notifier from antarest.core.utils.fastapi_sqlalchemy import db from antarest.core.utils.utils import StopWatch from antarest.login.model import Group from antarest.login.service import LoginService from antarest.matrixstore.matrix_editor import MatrixEditInstruction -from antarest.study.business.adequacy_patch_management import ( - AdequacyPatchManager, -) -from antarest.study.business.advanced_parameters_management import ( - AdvancedParamsManager, -) +from antarest.study.business.adequacy_patch_management import AdequacyPatchManager +from antarest.study.business.advanced_parameters_management import AdvancedParamsManager from antarest.study.business.allocation_management import AllocationManager -from antarest.study.business.area_management import ( - AreaCreationDTO, - AreaInfoDTO, - AreaManager, - AreaType, - AreaUI, -) +from antarest.study.business.area_management import AreaCreationDTO, AreaInfoDTO, AreaManager, AreaType, AreaUI from antarest.study.business.areas.hydro_management import HydroManager -from antarest.study.business.areas.properties_management import ( - PropertiesManager, -) +from antarest.study.business.areas.properties_management import PropertiesManager from antarest.study.business.areas.renewable_management import RenewableManager from antarest.study.business.areas.thermal_management import ThermalManager -from antarest.study.business.binding_constraint_management import ( - BindingConstraintManager, -) +from antarest.study.business.binding_constraint_management import BindingConstraintManager from antarest.study.business.config_management import ConfigManager from antarest.study.business.district_manager import DistrictManager from antarest.study.business.general_management import GeneralManager from antarest.study.business.link_management import LinkInfoDTO, LinkManager -from antarest.study.business.matrix_management import ( - MatrixManager, - MatrixManagerError, -) +from antarest.study.business.matrix_management import MatrixManager, MatrixManagerError from antarest.study.business.optimization_management import OptimizationManager from antarest.study.business.playlist_management import PlaylistManager -from antarest.study.business.scenario_builder_management import ( - ScenarioBuilderManager, -) +from antarest.study.business.scenario_builder_management import ScenarioBuilderManager from antarest.study.business.st_storage_manager import STStorageManager from antarest.study.business.table_mode_management import TableModeManager -from antarest.study.business.thematic_trimming_management import ( - ThematicTrimmingManager, -) -from antarest.study.business.timeseries_config_management import ( - TimeSeriesConfigManager, -) +from antarest.study.business.thematic_trimming_management import ThematicTrimmingManager +from antarest.study.business.timeseries_config_management import TimeSeriesConfigManager from antarest.study.business.utils import execute_or_add_commands -from antarest.study.business.xpansion_management import ( - XpansionCandidateDTO, - XpansionManager, - XpansionSettingsDTO, -) +from antarest.study.business.xpansion_management import XpansionCandidateDTO, XpansionManager, XpansionSettingsDTO from antarest.study.model import ( DEFAULT_WORKSPACE_NAME, NEW_DEFAULT_STUDY_VERSION, @@ -129,35 +87,17 @@ StudySimResultDTO, ) from antarest.study.repository import StudyMetadataRepository -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfigDTO, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfigDTO +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode from antarest.study.storage.rawstudy.model.filesystem.inode import INode -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - OutputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import OutputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.study_download_utils import ( - StudyDownloader, - get_output_variables_information, -) -from antarest.study.storage.study_upgrader import ( - find_next_version, - upgrade_study, -) +from antarest.study.storage.study_download_utils import StudyDownloader, get_output_variables_information +from antarest.study.storage.study_upgrader import find_next_version, upgrade_study from antarest.study.storage.utils import ( assert_permission, get_default_workspace_path, @@ -167,23 +107,13 @@ study_matcher, ) from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command.update_comments import ( - UpdateComments, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command.update_raw_file import ( - UpdateRawFile, -) +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command.update_comments import UpdateComments +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command.update_raw_file import UpdateRawFile from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy from antarest.study.storage.variantstudy.model.model import CommandDTO -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService from antarest.worker.archive_worker import ArchiveTaskArgs from antarest.worker.simulator_worker import GenerateTimeseriesTaskArgs diff --git a/antarest/study/storage/abstract_storage_service.py b/antarest/study/storage/abstract_storage_service.py index 41c418829c..5bbf5ef0d5 100644 --- a/antarest/study/storage/abstract_storage_service.py +++ b/antarest/study/storage/abstract_storage_service.py @@ -23,22 +23,11 @@ StudySimSettingsDTO, ) from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.files import ( - get_playlist, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Simulation, -) -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - FileStudy, - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.config.files import get_playlist +from antarest.study.storage.rawstudy.model.filesystem.config.model import Simulation +from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy, StudyFactory from antarest.study.storage.rawstudy.model.helpers import FileStudyHelpers -from antarest.study.storage.utils import ( - extract_output_name, - fix_study_root, - remove_from_cache, -) +from antarest.study.storage.utils import extract_output_name, fix_study_root, remove_from_cache logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/patch_service.py b/antarest/study/storage/patch_service.py index ebb918a9c0..2a7eedf9d9 100644 --- a/antarest/study/storage/patch_service.py +++ b/antarest/study/storage/patch_service.py @@ -2,12 +2,7 @@ from pathlib import Path from typing import Optional, Union -from antarest.study.model import ( - Patch, - PatchOutputs, - RawStudy, - StudyAdditionalData, -) +from antarest.study.model import Patch, PatchOutputs, RawStudy, StudyAdditionalData from antarest.study.repository import StudyMetadataRepository from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy diff --git a/antarest/study/storage/rawstudy/io/reader/__init__.py b/antarest/study/storage/rawstudy/io/reader/__init__.py index d646c76b4c..b3b4346414 100644 --- a/antarest/study/storage/rawstudy/io/reader/__init__.py +++ b/antarest/study/storage/rawstudy/io/reader/__init__.py @@ -1,6 +1,3 @@ -from antarest.study.storage.rawstudy.io.reader.ini_reader import ( - IniReader, - MultipleSameKeysIniReader, -) +from antarest.study.storage.rawstudy.io.reader.ini_reader import IniReader, MultipleSameKeysIniReader __all__ = ["IniReader", "MultipleSameKeysIniReader"] diff --git a/antarest/study/storage/rawstudy/model/filesystem/bucket_node.py b/antarest/study/storage/rawstudy/model/filesystem/bucket_node.py index b2e1a1c223..bb2fdb455d 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/bucket_node.py +++ b/antarest/study/storage/rawstudy/model/filesystem/bucket_node.py @@ -1,19 +1,11 @@ from typing import Any, Callable, Dict, List, Optional from antarest.core.model import JSON, SUB_JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE, INode -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode class RegisteredFile: diff --git a/antarest/study/storage/rawstudy/model/filesystem/common/area_matrix_list.py b/antarest/study/storage/rawstudy/model/filesystem/common/area_matrix_list.py index c814933ad0..604a170849 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/common/area_matrix_list.py +++ b/antarest/study/storage/rawstudy/model/filesystem/common/area_matrix_list.py @@ -1,18 +1,10 @@ from typing import Any, Callable, Dict, Optional -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE, INode -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class AreaMatrixList(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/common/prepro.py b/antarest/study/storage/rawstudy/model/filesystem/common/prepro.py index 5c7ad5f3b3..15a5fd3684 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/common/prepro.py +++ b/antarest/study/storage/rawstudy/model/filesystem/common/prepro.py @@ -1,19 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class PreproCorrelation(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/config/files.py b/antarest/study/storage/rawstudy/model/filesystem/config/files.py index f9bf2fbd5d..8262884c3a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/config/files.py +++ b/antarest/study/storage/rawstudy/model/filesystem/config/files.py @@ -9,10 +9,7 @@ from antarest.core.model import JSON from antarest.core.utils.utils import extract_file_to_tmp_dir -from antarest.study.storage.rawstudy.io.reader import ( - IniReader, - MultipleSameKeysIniReader, -) +from antarest.study.storage.rawstudy.io.reader import IniReader, MultipleSameKeysIniReader from antarest.study.storage.rawstudy.model.filesystem.config.exceptions import ( SimulationParsingError, XpansionParsingError, @@ -27,12 +24,8 @@ Simulation, transform_name_to_id, ) -from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import ( - STStorageConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import STStorageConfig +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/rawstudy/model/filesystem/config/st_storage.py b/antarest/study/storage/rawstudy/model/filesystem/config/st_storage.py index bea3bb89f5..0d69433dd3 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/config/st_storage.py +++ b/antarest/study/storage/rawstudy/model/filesystem/config/st_storage.py @@ -102,9 +102,7 @@ def calculate_storage_id(cls, values: Dict[str, Any]) -> Dict[str, Any]: The updated values. """ # Avoid circular imports - from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, - ) + from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id if values.get("id") or not values.get("name"): return values diff --git a/antarest/study/storage/rawstudy/model/filesystem/factory.py b/antarest/study/storage/rawstudy/model/filesystem/factory.py index 651fdd52f4..58024784ce 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/factory.py +++ b/antarest/study/storage/rawstudy/model/filesystem/factory.py @@ -8,16 +8,9 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService from antarest.study.storage.rawstudy.model.filesystem.config.files import build -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - FileStudyTreeConfigDTO, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, FileStudyTreeConfigDTO +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/rawstudy/model/filesystem/folder_node.py b/antarest/study/storage/rawstudy/model/filesystem/folder_node.py index e7283f231c..569613cc27 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/folder_node.py +++ b/antarest/study/storage/rawstudy/model/filesystem/folder_node.py @@ -6,12 +6,8 @@ from fastapi import HTTPException from antarest.core.model import JSON, SUB_JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.inode import TREE, INode diff --git a/antarest/study/storage/rawstudy/model/filesystem/ini_file_node.py b/antarest/study/storage/rawstudy/model/filesystem/ini_file_node.py index 6ca18d6f25..5b44e5a16c 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/ini_file_node.py +++ b/antarest/study/storage/rawstudy/model/filesystem/ini_file_node.py @@ -16,12 +16,8 @@ from antarest.study.storage.rawstudy.io.reader import IniReader from antarest.study.storage.rawstudy.io.reader.ini_reader import IReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.inode import INode diff --git a/antarest/study/storage/rawstudy/model/filesystem/inode.py b/antarest/study/storage/rawstudy/model/filesystem/inode.py index 117655f91c..37c4b90cf4 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/inode.py +++ b/antarest/study/storage/rawstudy/model/filesystem/inode.py @@ -2,14 +2,9 @@ from pathlib import Path from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar -from antarest.core.exceptions import ( - ShouldNotHappenException, - WritingInsideZippedFileException, -) +from antarest.core.exceptions import ShouldNotHappenException, WritingInsideZippedFileException from antarest.core.utils.utils import extract_file_to_tmp_dir -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig G = TypeVar("G") S = TypeVar("S") diff --git a/antarest/study/storage/rawstudy/model/filesystem/json_file_node.py b/antarest/study/storage/rawstudy/model/filesystem/json_file_node.py index 78e006c38a..d0b759761a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/json_file_node.py +++ b/antarest/study/storage/rawstudy/model/filesystem/json_file_node.py @@ -5,15 +5,9 @@ from antarest.core.model import JSON from antarest.study.storage.rawstudy.io.reader.ini_reader import IReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class JsonReader(IReader): diff --git a/antarest/study/storage/rawstudy/model/filesystem/lazy_node.py b/antarest/study/storage/rawstudy/model/filesystem/lazy_node.py index 90bda9f070..280cb16c66 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/lazy_node.py +++ b/antarest/study/storage/rawstudy/model/filesystem/lazy_node.py @@ -5,18 +5,9 @@ from typing import Any, Dict, Generic, List, Optional, Tuple, Union, cast from zipfile import ZipFile -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.inode import ( - G, - INode, - S, - V, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.inode import G, INode, S, V @dataclass diff --git a/antarest/study/storage/rawstudy/model/filesystem/matrix/input_series_matrix.py b/antarest/study/storage/rawstudy/model/filesystem/matrix/input_series_matrix.py index 148f12c232..5209fc9849 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/matrix/input_series_matrix.py +++ b/antarest/study/storage/rawstudy/model/filesystem/matrix/input_series_matrix.py @@ -9,16 +9,9 @@ from antarest.core.model import JSON from antarest.core.utils.utils import StopWatch -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, - MatrixNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency, MatrixNode logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/rawstudy/model/filesystem/matrix/matrix.py b/antarest/study/storage/rawstudy/model/filesystem/matrix/matrix.py index 2f232ec2a8..b7b59e471b 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/matrix/matrix.py +++ b/antarest/study/storage/rawstudy/model/filesystem/matrix/matrix.py @@ -7,15 +7,9 @@ import pandas as pd from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.exceptions import ( - DenormalizationException, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.exceptions import DenormalizationException from antarest.study.storage.rawstudy.model.filesystem.lazy_node import LazyNode logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/rawstudy/model/filesystem/matrix/output_series_matrix.py b/antarest/study/storage/rawstudy/model/filesystem/matrix/output_series_matrix.py index ce26c2116c..f2c53d0add 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/matrix/output_series_matrix.py +++ b/antarest/study/storage/rawstudy/model/filesystem/matrix/output_series_matrix.py @@ -6,15 +6,9 @@ from pandas import DataFrame from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError from antarest.study.storage.rawstudy.model.filesystem.lazy_node import LazyNode from antarest.study.storage.rawstudy.model.filesystem.matrix.date_serializer import ( FactoryDateSerializer, @@ -26,9 +20,7 @@ HeadWriter, LinkHeadWriter, ) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/rawstudy/model/filesystem/raw_file_node.py b/antarest/study/storage/rawstudy/model/filesystem/raw_file_node.py index 230f2dabce..a93acc87e1 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/raw_file_node.py +++ b/antarest/study/storage/rawstudy/model/filesystem/raw_file_node.py @@ -1,12 +1,8 @@ import logging from typing import List, Optional -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.lazy_node import LazyNode logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/desktop.py b/antarest/study/storage/rawstudy/model/filesystem/root/desktop.py index 2793263280..c506d2872b 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/desktop.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/desktop.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class Desktop(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/filestudytree.py b/antarest/study/storage/rawstudy/model/filesystem/root/filestudytree.py index eb346541f5..907a9e4ba3 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/filestudytree.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/filestudytree.py @@ -1,31 +1,15 @@ import logging -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.desktop import ( - Desktop, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.input import ( - Input, -) -from antarest.study.storage.rawstudy.model.filesystem.root.layers.layers import ( - Layers, -) +from antarest.study.storage.rawstudy.model.filesystem.root.desktop import Desktop +from antarest.study.storage.rawstudy.model.filesystem.root.input.input import Input +from antarest.study.storage.rawstudy.model.filesystem.root.layers.layers import Layers from antarest.study.storage.rawstudy.model.filesystem.root.logs import Logs -from antarest.study.storage.rawstudy.model.filesystem.root.output.output import ( - Output, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.settings import ( - Settings, -) -from antarest.study.storage.rawstudy.model.filesystem.root.study_antares import ( - StudyAntares, -) -from antarest.study.storage.rawstudy.model.filesystem.root.user.user import ( - User, -) +from antarest.study.storage.rawstudy.model.filesystem.root.output.output import Output +from antarest.study.storage.rawstudy.model.filesystem.root.settings.settings import Settings +from antarest.study.storage.rawstudy.model.filesystem.root.study_antares import StudyAntares +from antarest.study.storage.rawstudy.model.filesystem.root.user.user import User logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/areas.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/areas.py index 10bd6c9fe4..e52680cc91 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/areas.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/areas.py @@ -1,22 +1,10 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.item.item import ( - InputAreasItem, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.list import ( - InputAreasList, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.sets import ( - InputAreasSets, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.item.item import InputAreasItem +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.list import InputAreasList +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.sets import InputAreasSets class InputAreas(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/adequacy_patch.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/adequacy_patch.py index b020103ed1..6e7ac3034a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/adequacy_patch.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/adequacy_patch.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputAreasAdequacyPatch(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/item.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/item.py index b2c8189dc1..2a40ab60f5 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/item.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/item.py @@ -1,16 +1,10 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.item.adequacy_patch import ( InputAreasAdequacyPatch, ) -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.item.optimization import ( - InputAreasOptimization, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.item.ui import ( - InputAreasUi, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.item.optimization import InputAreasOptimization +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.item.ui import InputAreasUi class InputAreasItem(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/optimization.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/optimization.py index 334370c44e..1219a291e4 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/optimization.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/optimization.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputAreasOptimization(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/ui.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/ui.py index cef51919f6..7a457866e2 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/ui.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/item/ui.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputAreasUi(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/list.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/list.py index f99e137602..8203f7da81 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/list.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/list.py @@ -1,11 +1,7 @@ from typing import List, Optional -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.inode import INode diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/sets.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/sets.py index 43199177b4..ddde3fd66a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/sets.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/areas/sets.py @@ -1,14 +1,8 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputAreasSets(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingconstraints_ini.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingconstraints_ini.py index eed7cdb93c..5e4059252a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingconstraints_ini.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingconstraints_ini.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class BindingConstraintsIni(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingcontraints.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingcontraints.py index 3854423c21..9077848de7 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingcontraints.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/bindingconstraints/bindingcontraints.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix from antarest.study.storage.rawstudy.model.filesystem.root.input.bindingconstraints.bindingconstraints_ini import ( BindingConstraintsIni, ) diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/allocation.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/allocation.py index 8c2ff55e18..a1e3de61dd 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/allocation.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/allocation.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.allocation.area import ( - InputHydroAllocationArea, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.allocation.area import InputHydroAllocationArea class InputHydroAllocation(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/area.py index 898c53c30f..6629de639c 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/allocation/area.py @@ -1,13 +1,7 @@ from antarest.study.storage.rawstudy.io.reader import IniReader -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputHydroAllocationArea(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/capacity/capacity.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/capacity/capacity.py index 5d14550a39..ff03155b0e 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/capacity/capacity.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/capacity/capacity.py @@ -1,15 +1,9 @@ from typing import List, TypedDict -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency class MatrixInfo(TypedDict, total=False): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/common.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/common.py index 4d5c3f0c5f..c8d02e27ac 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/common.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/common/common.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.common.capacity.capacity import ( InputHydroCommonCapacity, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro.py index 3a0526cbfc..305ad9ef4f 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro.py @@ -1,22 +1,10 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.allocation.allocation import ( - InputHydroAllocation, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.common.common import ( - InputHydroCommon, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.hydro_ini import ( - InputHydroIni, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.prepro.prepro import ( - InputHydroPrepro, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.series.series import ( - InputHydroSeries, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.allocation.allocation import InputHydroAllocation +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.common.common import InputHydroCommon +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.hydro_ini import InputHydroIni +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.prepro.prepro import InputHydroPrepro +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.series.series import InputHydroSeries class InputHydro(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro_ini.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro_ini.py index 602c981b17..95f48a48f3 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro_ini.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/hydro_ini.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputHydroIni(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/area.py index 8d50b8048a..4b505e06d2 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/area.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.prepro.area.prepro import ( InputHydroPreproAreaPrepro, ) diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/prepro.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/prepro.py index 802109d07a..37403cd412 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/prepro.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/area/prepro.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputHydroPreproAreaPrepro(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/prepro.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/prepro.py index e82957f09d..244a26e634 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/prepro.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/prepro/prepro.py @@ -1,13 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.common.prepro import ( - PreproCorrelation, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.common.prepro import PreproCorrelation +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.prepro.area.area import ( - InputHydroPreproArea, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.prepro.area.area import InputHydroPreproArea class InputHydroPrepro(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/area/area.py index 616230b285..0325de0633 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/area/area.py @@ -1,20 +1,14 @@ from typing import Any, Dict -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE, INode from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( default_scenario_daily, default_scenario_hourly, default_scenario_monthly, ) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency class InputHydroSeriesArea(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/series.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/series.py index 1175bd54fb..42ddd737fd 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/series.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/hydro/series/series.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.series.area.area import ( - InputHydroSeriesArea, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.series.area.area import InputHydroSeriesArea class InputHydroSeries(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/input.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/input.py index 2b71fd6684..6c9f1c58c1 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/input.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/input.py @@ -1,46 +1,20 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - ENR_MODELLING, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import ENR_MODELLING +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.areas import ( - InputAreas, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.areas import InputAreas from antarest.study.storage.rawstudy.model.filesystem.root.input.bindingconstraints.bindingcontraints import ( BindingConstraints, ) -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.hydro import ( - InputHydro, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.link.link import ( - InputLink, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.load.load import ( - InputLoad, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.miscgen.miscgen import ( - InputMiscGen, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.renewables.renewable import ( - ClusteredRenewables, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.reserves.reserves import ( - InputReserves, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.solar.solar import ( - InputSolar, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.st_storage import ( - InputSTStorage, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.thermal import ( - InputThermal, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.wind.wind import ( - InputWind, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.hydro import InputHydro +from antarest.study.storage.rawstudy.model.filesystem.root.input.link.link import InputLink +from antarest.study.storage.rawstudy.model.filesystem.root.input.load.load import InputLoad +from antarest.study.storage.rawstudy.model.filesystem.root.input.miscgen.miscgen import InputMiscGen +from antarest.study.storage.rawstudy.model.filesystem.root.input.renewables.renewable import ClusteredRenewables +from antarest.study.storage.rawstudy.model.filesystem.root.input.reserves.reserves import InputReserves +from antarest.study.storage.rawstudy.model.filesystem.root.input.solar.solar import InputSolar +from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.st_storage import InputSTStorage +from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.thermal import InputThermal +from antarest.study.storage.rawstudy.model.filesystem.root.input.wind.wind import InputWind class Input(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/area.py index a77ce4983e..ba50d8e5d1 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/area.py @@ -1,22 +1,12 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix from antarest.study.storage.rawstudy.model.filesystem.root.input.link.area.capacities.capacities import ( InputLinkAreaCapacities, ) -from antarest.study.storage.rawstudy.model.filesystem.root.input.link.area.properties import ( - InputLinkAreaProperties, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.link.area.properties import InputLinkAreaProperties class InputLinkArea(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/capacities/capacities.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/capacities/capacities.py index c3ae6e0f43..db07796678 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/capacities/capacities.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/capacities/capacities.py @@ -1,16 +1,8 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class InputLinkAreaCapacities(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/properties.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/properties.py index 1a97aed84b..955f6ba39d 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/properties.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/area/properties.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputLinkAreaProperties(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/link.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/link.py index 1a8228f48d..aa3d8af065 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/link/link.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/link/link.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.link.area.area import ( - InputLinkArea, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.link.area.area import InputLinkArea class InputLink(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/load/load.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/load/load.py index 26e5191af0..b88f592468 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/load/load.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/load/load.py @@ -1,16 +1,8 @@ -from antarest.study.storage.rawstudy.model.filesystem.common.area_matrix_list import ( - AreaMatrixList, -) -from antarest.study.storage.rawstudy.model.filesystem.common.prepro import ( - InputPrepro, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.common.area_matrix_list import AreaMatrixList +from antarest.study.storage.rawstudy.model.filesystem.common.prepro import InputPrepro +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( - default_scenario_hourly, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import default_scenario_hourly class InputLoad(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/miscgen/miscgen.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/miscgen/miscgen.py index bd43479922..b6d50dec4a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/miscgen/miscgen.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/miscgen/miscgen.py @@ -1,13 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( - default_8_fixed_hourly, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import default_8_fixed_hourly +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class InputMiscGen(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/clusters.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/clusters.py index b75f9773de..6688555d30 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/clusters.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/clusters.py @@ -1,15 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/renewable.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/renewable.py index 66060e2f00..3c6061929c 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/renewable.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/renewable.py @@ -1,13 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.renewables.clusters import ( ClusteredRenewableAreaCluster, ) -from antarest.study.storage.rawstudy.model.filesystem.root.input.renewables.series import ( - ClusteredRenewableAreaSeries, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.renewables.series import ClusteredRenewableAreaSeries class ClusteredRenewables(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/series.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/series.py index 6ffb0aa8a8..725899b3af 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/series.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/renewables/series.py @@ -1,19 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( - default_scenario_hourly, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import default_scenario_hourly +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class ClusteredRenewableSeries(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/reserves/reserves.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/reserves/reserves.py index b2f76b82f2..41abcf7bf6 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/reserves/reserves.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/reserves/reserves.py @@ -1,13 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( - default_4_fixed_hourly, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import default_4_fixed_hourly +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class InputReserves(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/solar/solar.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/solar/solar.py index 815e41d2ea..95cb3239ee 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/solar/solar.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/solar/solar.py @@ -1,16 +1,8 @@ -from antarest.study.storage.rawstudy.model.filesystem.common.area_matrix_list import ( - AreaMatrixList, -) -from antarest.study.storage.rawstudy.model.filesystem.common.prepro import ( - InputPrepro, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.common.area_matrix_list import AreaMatrixList +from antarest.study.storage.rawstudy.model.filesystem.common.prepro import InputPrepro +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( - default_scenario_hourly, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import default_scenario_hourly class InputSolar(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/area.py index 92912c76ea..b44b5eab38 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/area.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.clusters.area.list import ( InputSTStorageAreaList, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/list.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/list.py index 70b14d266c..d640caab5a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/list.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/area/list.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputSTStorageAreaList(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/clusters.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/clusters.py index 582332486e..e1ced6bca2 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/clusters.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/clusters/clusters.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.clusters.area.area import ( - InputSTStorageArea, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.clusters.area.area import InputSTStorageArea class InputSTStorageClusters(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/area.py index 396342a4c6..ee460e2adf 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/area.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.series.area.st_storage.st_storage import ( InputSTStorageAreaStorage, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/st_storage/st_storage.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/st_storage/st_storage.py index cc9980f70e..0df7979558 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/st_storage/st_storage.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/area/st_storage/st_storage.py @@ -1,13 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) -from antarest.study.storage.variantstudy.business.matrix_constants.st_storage import ( - series, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix +from antarest.study.storage.variantstudy.business.matrix_constants.st_storage import series class InputSTStorageAreaStorage(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/series.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/series.py index 4118588b39..ab16f25668 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/series.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/series/series.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.series.area.area import ( InputSTStorageSeriesArea, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/st_storage.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/st_storage.py index eedde818fb..1a1e56c89d 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/st_storage.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/st_storage/st_storage.py @@ -1,13 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.clusters.clusters import ( InputSTStorageClusters, ) -from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.series.series import ( - InputSTStorageSeries, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.st_storage.series.series import InputSTStorageSeries class InputSTStorage(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/areas_ini.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/areas_ini.py index ccdaee5d2e..024a2077b1 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/areas_ini.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/areas_ini.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputThermalAreasIni(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/area.py index c7586e59ae..13e2637fa4 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/area.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.cluster.area.list import ( InputThermalClustersAreaList, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/list.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/list.py index 04e7cc4157..be1af98414 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/list.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/area/list.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class InputThermalClustersAreaList(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/cluster.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/cluster.py index 6e42d93d93..7e657d4efe 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/cluster.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/cluster/cluster.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.cluster.area.area import ( InputThermalClustersArea, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/area.py index a1e8709696..f2ff885a8f 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/area.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.prepro.area.thermal.thermal import ( InputThermalPreproAreaThermal, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/thermal/thermal.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/thermal/thermal.py index c0e365f4e8..7ac90c906f 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/thermal/thermal.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/area/thermal/thermal.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class InputThermalPreproAreaThermal(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/prepro.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/prepro.py index c9f297f7ac..36b96a22ec 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/prepro.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/prepro/prepro.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.prepro.area.area import ( - InputThermalPreproArea, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.prepro.area.area import InputThermalPreproArea class InputThermalPrepro(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/area.py index 3321219ff0..f099bc2f1f 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/area.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.series.area.thermal.thermal import ( InputThermalSeriesAreaThermal, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/thermal/thermal.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/thermal/thermal.py index 5f8853c1e2..a93c4378cb 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/thermal/thermal.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/area/thermal/thermal.py @@ -1,13 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( - default_scenario_hourly, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import default_scenario_hourly +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class InputThermalSeriesAreaThermal(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/series.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/series.py index 1ed425f702..80265b712f 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/series.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/series/series.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.series.area.area import ( - InputThermalSeriesArea, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.series.area.area import InputThermalSeriesArea class InputThermalSeries(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/thermal.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/thermal.py index c0503e98ee..ac9d376c61 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/thermal.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/thermal/thermal.py @@ -1,19 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.areas_ini import ( - InputThermalAreasIni, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.cluster.cluster import ( - InputThermalClusters, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.prepro.prepro import ( - InputThermalPrepro, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.series.series import ( - InputThermalSeries, -) +from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.areas_ini import InputThermalAreasIni +from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.cluster.cluster import InputThermalClusters +from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.prepro.prepro import InputThermalPrepro +from antarest.study.storage.rawstudy.model.filesystem.root.input.thermal.series.series import InputThermalSeries class InputThermal(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/input/wind/wind.py b/antarest/study/storage/rawstudy/model/filesystem/root/input/wind/wind.py index f58bb50c0f..be702ffe59 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/input/wind/wind.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/input/wind/wind.py @@ -1,16 +1,8 @@ -from antarest.study.storage.rawstudy.model.filesystem.common.area_matrix_list import ( - AreaMatrixList, -) -from antarest.study.storage.rawstudy.model.filesystem.common.prepro import ( - InputPrepro, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.common.area_matrix_list import AreaMatrixList +from antarest.study.storage.rawstudy.model.filesystem.common.prepro import InputPrepro +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( - default_scenario_hourly, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import default_scenario_hourly class InputWind(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/layers/layer_ini.py b/antarest/study/storage/rawstudy/model/filesystem/root/layers/layer_ini.py index f94c34b5a9..4b3fdbb85e 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/layers/layer_ini.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/layers/layer_ini.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class LayersIni(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/layers/layers.py b/antarest/study/storage/rawstudy/model/filesystem/root/layers/layers.py index c69180c685..afe792a6d6 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/layers/layers.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/layers/layers.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.layers.layer_ini import ( - LayersIni, -) +from antarest.study.storage.rawstudy.model.filesystem.root.layers.layer_ini import LayersIni class Layers(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/logs.py b/antarest/study/storage/rawstudy/model/filesystem/root/logs.py index c23fb1eb2b..7e5ba868b6 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/logs.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/logs.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode class Logs(BucketNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/output.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/output.py index 4e439b0018..6274b0772e 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/output.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/output.py @@ -1,13 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.simulation import ( - OutputSimulation, -) +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.simulation import OutputSimulation class Output(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/about.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/about.py index 66b4af436a..15fa52222d 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/about.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/about.py @@ -1,16 +1,10 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.about.study import ( OutputSimulationAboutStudy, ) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - GeneralData, -) +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import GeneralData class OutputSimulationAbout(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/study.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/study.py index 3ca2d526f2..ddc2670048 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/study.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/about/study.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class OutputSimulationAboutStudy(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/info_antares_output.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/info_antares_output.py index 9b10010e0a..cf6fbaccd5 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/info_antares_output.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/info_antares_output.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class OutputSimulationInfoAntaresOutput(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/area.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/area.py index 2af2ec9a54..f59fc5a04a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/area.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/area.py @@ -1,19 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - AreaOutputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import AreaOutputSeriesMatrix class OutputSimulationAreaItem(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/areas.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/areas.py index 8e7b8a66a3..ac35597dfa 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/areas.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/areas.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common.area import ( OutputSimulationAreaItem as Area, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py index 5bf1498e80..ec1a3e2f63 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( BindingConstraintOutputSeriesMatrix, ) diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/link.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/link.py index 55c50d079f..5fc82dc57f 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/link.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/link.py @@ -1,19 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - LinkOutputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import LinkOutputSeriesMatrix class OutputSimulationLinkItem(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/links.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/links.py index 3f459b4d1a..b05063829a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/links.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/links.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common.link import ( OutputSimulationLinkItem, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/set.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/set.py index 4070031963..7b32fc5844 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/set.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/set.py @@ -1,19 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - AreaOutputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import AreaOutputSeriesMatrix class OutputSimulationSet(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py index 6c62a19d1b..90e0dd3ff0 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py @@ -1,13 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - Simulation, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, Simulation +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.mcall.mcall import ( OutputSimulationModeMcAll, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py index b5d40d9885..8db2b3d757 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode class OutputSimulationModeMcAllGrid(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py index 8ce0395839..4c38713a35 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common.areas import ( OutputSimulationAreas, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py index 2f2aa1a9c0..b67114f222 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py @@ -1,13 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - Simulation, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, Simulation +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.mcind.scn import ( OutputSimulationModeMcIndScn, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py index 999bbe870d..2fe697ddf3 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common.areas import ( OutputSimulationAreas, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/simulation.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/simulation.py index 11ef839c05..8e3d372176 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/simulation.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/simulation.py @@ -1,41 +1,22 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - Simulation, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, Simulation +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.about.about import ( - OutputSimulationAbout, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.about.about import OutputSimulationAbout from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.info_antares_output import ( OutputSimulationInfoAntaresOutput, ) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.economy import ( - OutputSimulationMode, -) +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.economy import OutputSimulationMode from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.ts_generator.ts_generator import ( OutputSimulationTsGenerator, ) from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.ts_numbers.ts_numbers import ( OutputSimulationTsNumbers, ) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.xpansion.lp import ( - Lp, -) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.xpansion.sensitivity import ( - Sensitivity, -) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.xpansion.xpansion import ( - Xpansion, -) +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.xpansion.lp import Lp +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.xpansion.sensitivity import Sensitivity +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.xpansion.xpansion import Xpansion class OutputSimulation(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_generator/ts_generator.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_generator/ts_generator.py index 076e65b898..882d2db11f 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_generator/ts_generator.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_generator/ts_generator.py @@ -6,19 +6,11 @@ HydroMatrixList, ThermalMatrixList, ) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE, INode -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class OutputSimulationTsGeneratorSimpleMatrixList(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_numbers/ts_numbers.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_numbers/ts_numbers.py index 7370baeced..5c977c1dd4 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_numbers/ts_numbers.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/ts_numbers/ts_numbers.py @@ -3,9 +3,7 @@ AreaMultipleMatrixList, ThermalMatrixList, ) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.ts_numbers.ts_numbers_data import ( TsNumbersVector, diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/lp.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/lp.py index 167e32fa7f..e714038ef1 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/lp.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/lp.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer class Lp(BucketNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/sensitivity.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/sensitivity.py index b39b6024c2..21dc03f37b 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/sensitivity.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/sensitivity.py @@ -1,13 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.json_file_node import ( - JsonFileNode, -) -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.json_file_node import JsonFileNode +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode class Sensitivity(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/xpansion.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/xpansion.py index b353cc2951..d3af542cb0 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/xpansion.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/xpansion/xpansion.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.json_file_node import ( - JsonFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.json_file_node import JsonFileNode class Xpansion(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/settings/generaldata.py b/antarest/study/storage/rawstudy/model/filesystem/root/settings/generaldata.py index f547e29703..0f95f763a3 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/settings/generaldata.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/settings/generaldata.py @@ -3,15 +3,9 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode DUPLICATE_KEYS = [ "playlist_year_weight", diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/settings/resources/resources.py b/antarest/study/storage/rawstudy/model/filesystem/root/settings/resources/resources.py index c4b0907168..8ef3608f98 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/settings/resources/resources.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/settings/resources/resources.py @@ -1,10 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode class Resources(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/settings/scenariobuilder.py b/antarest/study/storage/rawstudy/model/filesystem/root/settings/scenariobuilder.py index 1d0726d7b6..4bfc19f263 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/settings/scenariobuilder.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/settings/scenariobuilder.py @@ -1,14 +1,8 @@ from typing import Dict, Type -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class ScenarioBuilder(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/settings/settings.py b/antarest/study/storage/rawstudy/model/filesystem/root/settings/settings.py index e6f6d438a3..a0419fc0bc 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/settings/settings.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/settings/settings.py @@ -1,22 +1,10 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - GeneralData, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.resources.resources import ( - Resources, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.scenariobuilder import ( - ScenarioBuilder, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.simulations.simulations import ( - SettingsSimulations, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import GeneralData +from antarest.study.storage.rawstudy.model.filesystem.root.settings.resources.resources import Resources +from antarest.study.storage.rawstudy.model.filesystem.root.settings.scenariobuilder import ScenarioBuilder +from antarest.study.storage.rawstudy.model.filesystem.root.settings.simulations.simulations import SettingsSimulations class Settings(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/settings/simulations/simulations.py b/antarest/study/storage/rawstudy/model/filesystem/root/settings/simulations/simulations.py index 39a2b119dd..0986233b96 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/settings/simulations/simulations.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/settings/simulations/simulations.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/study_antares.py b/antarest/study/storage/rawstudy/model/filesystem/root/study_antares.py index 8b65f4a670..45bbde670a 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/study_antares.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/study_antares.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class StudyAntares(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/candidates.py b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/candidates.py index fb8db5eed3..a42adb4a10 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/candidates.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/candidates.py @@ -1,6 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode class ExpansionCandidates(IniFileNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/constraint_resources.py b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/constraint_resources.py index 30c07eb188..93a2846392 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/constraint_resources.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/constraint_resources.py @@ -1,12 +1,6 @@ -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer class ExpansionConstraintResources(BucketNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/expansion.py b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/expansion.py index 101dbf2457..9cbce2b59d 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/expansion.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/expansion.py @@ -1,28 +1,15 @@ -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, - RegisteredFile, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.candidates import ( - ExpansionCandidates, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode, RegisteredFile +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.candidates import ExpansionCandidates from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.constraint_resources import ( ExpansionConstraintResources, ) from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.matrix_resources import ( ExpansionMatrixResources, ) -from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.sensitivity import ( - SensitivityConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.settings import ( - ExpansionSettings, -) +from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.sensitivity import SensitivityConfig +from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.settings import ExpansionSettings class Expansion(BucketNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/matrix_resources.py b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/matrix_resources.py index 27c5007b5f..06b00b1006 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/matrix_resources.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/matrix_resources.py @@ -1,15 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix class ExpansionMatrixResources(BucketNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/sensitivity.py b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/sensitivity.py index 6a8887198d..f2f8c0d5bd 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/sensitivity.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/sensitivity.py @@ -1,12 +1,8 @@ from typing import List -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE -from antarest.study.storage.rawstudy.model.filesystem.json_file_node import ( - JsonFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.json_file_node import JsonFileNode class SensitivityConfig(FolderNode): diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/settings.py b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/settings.py index 7f6554054a..23534229f8 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/settings.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/user/expansion/settings.py @@ -1,18 +1,8 @@ -from antarest.study.storage.rawstudy.io.reader.ini_reader import ( - SimpleKeyValueReader, -) -from antarest.study.storage.rawstudy.io.writer.ini_writer import ( - SimpleKeyValueWriter, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.io.reader.ini_reader import SimpleKeyValueReader +from antarest.study.storage.rawstudy.io.writer.ini_writer import SimpleKeyValueWriter +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode # noinspection SpellCheckingInspection diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/user/user.py b/antarest/study/storage/rawstudy/model/filesystem/root/user/user.py index 049c7a18b7..40a1ce7a32 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/user/user.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/user/user.py @@ -1,16 +1,7 @@ -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, - RegisteredFile, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.expansion import ( - Expansion, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode, RegisteredFile +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.root.user.expansion.expansion import Expansion class User(BucketNode): diff --git a/antarest/study/storage/rawstudy/model/helpers.py b/antarest/study/storage/rawstudy/model/helpers.py index dc6fd9d11a..d2daf775c2 100644 --- a/antarest/study/storage/rawstudy/model/helpers.py +++ b/antarest/study/storage/rawstudy/model/helpers.py @@ -2,9 +2,7 @@ from antarest.core.model import JSON from antarest.core.utils.utils import assert_this -from antarest.study.storage.rawstudy.model.filesystem.config.files import ( - get_playlist, -) +from antarest.study.storage.rawstudy.model.filesystem.config.files import get_playlist from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy diff --git a/antarest/study/storage/rawstudy/raw_study_service.py b/antarest/study/storage/rawstudy/raw_study_service.py index 1058a3c839..640f497a86 100644 --- a/antarest/study/storage/rawstudy/raw_study_service.py +++ b/antarest/study/storage/rawstudy/raw_study_service.py @@ -15,25 +15,11 @@ from antarest.core.model import PublicMode from antarest.core.requests import RequestParameters from antarest.core.utils.utils import extract_zip -from antarest.study.model import ( - DEFAULT_WORKSPACE_NAME, - Patch, - RawStudy, - Study, - StudyAdditionalData, -) -from antarest.study.storage.abstract_storage_service import ( - AbstractStorageService, -) +from antarest.study.model import DEFAULT_WORKSPACE_NAME, Patch, RawStudy, Study, StudyAdditionalData +from antarest.study.storage.abstract_storage_service import AbstractStorageService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - FileStudyTreeConfigDTO, -) -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - FileStudy, - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, FileStudyTreeConfigDTO +from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy, StudyFactory from antarest.study.storage.rawstudy.model.filesystem.lazy_node import LazyNode from antarest.study.storage.utils import ( create_new_empty_study, diff --git a/antarest/study/storage/storage_service.py b/antarest/study/storage/storage_service.py index 0dfb33d565..86c6e0ce22 100644 --- a/antarest/study/storage/storage_service.py +++ b/antarest/study/storage/storage_service.py @@ -10,9 +10,7 @@ from antarest.study.model import RawStudy, Study from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService class StudyStorageService: diff --git a/antarest/study/storage/study_download_utils.py b/antarest/study/storage/study_download_utils.py index 8458a52c69..1d71319fae 100644 --- a/antarest/study/storage/study_download_utils.py +++ b/antarest/study/storage/study_download_utils.py @@ -22,25 +22,13 @@ StudyDownloadType, TimeSerie, ) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - ENR_MODELLING, - Area, - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import ENR_MODELLING, Area, FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, - FilterError, - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError, FilterError, FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import INode from antarest.study.storage.rawstudy.model.filesystem.lazy_node import LazyNode -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - OutputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import OutputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.utils import get_start_date logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/study_upgrader/upgrader_710.py b/antarest/study/storage/study_upgrader/upgrader_710.py index 609f7f8c3f..8edc2fde0a 100644 --- a/antarest/study/storage/study_upgrader/upgrader_710.py +++ b/antarest/study/storage/study_upgrader/upgrader_710.py @@ -2,9 +2,7 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS GENERAL_DATA_PATH = "settings/generaldata.ini" diff --git a/antarest/study/storage/study_upgrader/upgrader_800.py b/antarest/study/storage/study_upgrader/upgrader_800.py index 1ddbffb572..f9432359dc 100644 --- a/antarest/study/storage/study_upgrader/upgrader_800.py +++ b/antarest/study/storage/study_upgrader/upgrader_800.py @@ -2,9 +2,7 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS GENERAL_DATA_PATH = "settings/generaldata.ini" diff --git a/antarest/study/storage/study_upgrader/upgrader_810.py b/antarest/study/storage/study_upgrader/upgrader_810.py index 04d479cf53..89711fe867 100644 --- a/antarest/study/storage/study_upgrader/upgrader_810.py +++ b/antarest/study/storage/study_upgrader/upgrader_810.py @@ -2,9 +2,7 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS GENERAL_DATA_PATH = "settings/generaldata.ini" diff --git a/antarest/study/storage/study_upgrader/upgrader_830.py b/antarest/study/storage/study_upgrader/upgrader_830.py index dbf75b1643..d2067ef137 100644 --- a/antarest/study/storage/study_upgrader/upgrader_830.py +++ b/antarest/study/storage/study_upgrader/upgrader_830.py @@ -3,9 +3,7 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS GENERAL_DATA_PATH = "settings/generaldata.ini" diff --git a/antarest/study/storage/study_upgrader/upgrader_840.py b/antarest/study/storage/study_upgrader/upgrader_840.py index 6d14bc21bb..8a2ee4a18e 100644 --- a/antarest/study/storage/study_upgrader/upgrader_840.py +++ b/antarest/study/storage/study_upgrader/upgrader_840.py @@ -2,9 +2,7 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS GENERAL_DATA_PATH = "settings/generaldata.ini" MAPPING_TRANSMISSION_CAPACITIES = { diff --git a/antarest/study/storage/study_upgrader/upgrader_850.py b/antarest/study/storage/study_upgrader/upgrader_850.py index 0193565320..148f06704f 100644 --- a/antarest/study/storage/study_upgrader/upgrader_850.py +++ b/antarest/study/storage/study_upgrader/upgrader_850.py @@ -2,9 +2,7 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS # noinspection SpellCheckingInspection GENERAL_DATA_PATH = "settings/generaldata.ini" diff --git a/antarest/study/storage/study_upgrader/upgrader_860.py b/antarest/study/storage/study_upgrader/upgrader_860.py index a958cd6fbe..4c0349d31a 100644 --- a/antarest/study/storage/study_upgrader/upgrader_860.py +++ b/antarest/study/storage/study_upgrader/upgrader_860.py @@ -2,12 +2,8 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS # noinspection SpellCheckingInspection GENERAL_DATA_PATH = "settings/generaldata.ini" diff --git a/antarest/study/storage/utils.py b/antarest/study/storage/utils.py index 117bf38683..8d945706c3 100644 --- a/antarest/study/storage/utils.py +++ b/antarest/study/storage/utils.py @@ -12,10 +12,7 @@ from zipfile import ZipFile from antarest.core.config import Config -from antarest.core.exceptions import ( - StudyValidationError, - UnsupportedStudyVersion, -) +from antarest.core.exceptions import StudyValidationError, UnsupportedStudyVersion from antarest.core.interfaces.cache import CacheConstants, ICache from antarest.core.jwt import JWTUser from antarest.core.model import PermissionInfo, StudyPermissionType @@ -32,13 +29,8 @@ ) from antarest.study.storage.rawstudy.io.reader import IniReader from antarest.study.storage.rawstudy.io.writer.ini_writer import IniWriter -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - FileStudy, - StudyFactory, -) -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy, StudyFactory +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.model.helpers import FileStudyHelpers logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/variantstudy/business/command_extractor.py b/antarest/study/storage/variantstudy/business/command_extractor.py index 9bc6343eb1..bc8f6f927b 100644 --- a/antarest/study/storage/variantstudy/business/command_extractor.py +++ b/antarest/study/storage/variantstudy/business/command_extractor.py @@ -9,67 +9,27 @@ from antarest.matrixstore.model import MatrixData from antarest.matrixstore.service import ISimpleMatrixService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.files import ( - get_playlist, -) +from antarest.study.storage.rawstudy.model.filesystem.config.files import get_playlist from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, -) -from antarest.study.storage.variantstudy.model.command.common import ( - BindingConstraintOperator, - TimeStep, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_binding_constraint import ( - CreateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.create_cluster import ( - CreateCluster, -) -from antarest.study.storage.variantstudy.model.command.create_district import ( - CreateDistrict, - DistrictBaseFilter, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import ( - CreateRenewablesCluster, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol +from antarest.study.storage.variantstudy.model.command.common import BindingConstraintOperator, TimeStep +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_binding_constraint import CreateBindingConstraint +from antarest.study.storage.variantstudy.model.command.create_cluster import CreateCluster +from antarest.study.storage.variantstudy.model.command.create_district import CreateDistrict, DistrictBaseFilter +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import CreateRenewablesCluster from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command.update_comments import ( - UpdateComments, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command.update_district import ( - UpdateDistrict, -) -from antarest.study.storage.variantstudy.model.command.update_playlist import ( - UpdatePlaylist, -) -from antarest.study.storage.variantstudy.model.command.update_raw_file import ( - UpdateRawFile, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) -from antarest.study.storage.variantstudy.model.interfaces import ( - ICommandExtractor, -) +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command.update_comments import UpdateComments +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command.update_district import UpdateDistrict +from antarest.study.storage.variantstudy.model.command.update_playlist import UpdatePlaylist +from antarest.study.storage.variantstudy.model.command.update_raw_file import UpdateRawFile +from antarest.study.storage.variantstudy.model.command_context import CommandContext +from antarest.study.storage.variantstudy.model.interfaces import ICommandExtractor logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/variantstudy/business/command_reverter.py b/antarest/study/storage/variantstudy/business/command_reverter.py index 83ed0b3fd6..92358c09e1 100644 --- a/antarest/study/storage/variantstudy/business/command_reverter.py +++ b/antarest/study/storage/variantstudy/business/command_reverter.py @@ -2,86 +2,34 @@ from pathlib import Path from typing import Callable, Dict, List -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_binding_constraint import ( - CreateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.create_cluster import ( - CreateCluster, -) -from antarest.study.storage.variantstudy.model.command.create_district import ( - CreateDistrict, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import ( - CreateRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command.create_st_storage import ( - CreateSTStorage, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol +from antarest.study.storage.variantstudy.model.command.common import CommandName +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_binding_constraint import CreateBindingConstraint +from antarest.study.storage.variantstudy.model.command.create_cluster import CreateCluster +from antarest.study.storage.variantstudy.model.command.create_district import CreateDistrict +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import CreateRenewablesCluster +from antarest.study.storage.variantstudy.model.command.create_st_storage import CreateSTStorage from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_binding_constraint import ( - RemoveBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.remove_cluster import ( - RemoveCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_district import ( - RemoveDistrict, -) -from antarest.study.storage.variantstudy.model.command.remove_link import ( - RemoveLink, -) -from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import ( - RemoveRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_st_storage import ( - RemoveSTStorage, -) -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command.update_binding_constraint import ( - UpdateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.update_comments import ( - UpdateComments, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command.update_district import ( - UpdateDistrict, -) -from antarest.study.storage.variantstudy.model.command.update_playlist import ( - UpdatePlaylist, -) -from antarest.study.storage.variantstudy.model.command.update_raw_file import ( - UpdateRawFile, -) -from antarest.study.storage.variantstudy.model.command.update_scenario_builder import ( - UpdateScenarioBuilder, -) +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_binding_constraint import RemoveBindingConstraint +from antarest.study.storage.variantstudy.model.command.remove_cluster import RemoveCluster +from antarest.study.storage.variantstudy.model.command.remove_district import RemoveDistrict +from antarest.study.storage.variantstudy.model.command.remove_link import RemoveLink +from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import RemoveRenewablesCluster +from antarest.study.storage.variantstudy.model.command.remove_st_storage import RemoveSTStorage +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command.update_binding_constraint import UpdateBindingConstraint +from antarest.study.storage.variantstudy.model.command.update_comments import UpdateComments +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command.update_district import UpdateDistrict +from antarest.study.storage.variantstudy.model.command.update_playlist import UpdatePlaylist +from antarest.study.storage.variantstudy.model.command.update_raw_file import UpdateRawFile +from antarest.study.storage.variantstudy.model.command.update_scenario_builder import UpdateScenarioBuilder logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/variantstudy/business/utils.py b/antarest/study/storage/variantstudy/business/utils.py index 79918c56f3..00e6e13d43 100644 --- a/antarest/study/storage/variantstudy/business/utils.py +++ b/antarest/study/storage/variantstudy/business/utils.py @@ -4,9 +4,7 @@ from antarest.matrixstore.model import MatrixData from antarest.matrixstore.service import ISimpleMatrixService from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - MATRIX_PROTOCOL_PREFIX, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import MATRIX_PROTOCOL_PREFIX from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/business/utils_binding_constraint.py b/antarest/study/storage/variantstudy/business/utils_binding_constraint.py index 46d456aae6..b685134574 100644 --- a/antarest/study/storage/variantstudy/business/utils_binding_constraint.py +++ b/antarest/study/storage/variantstudy/business/utils_binding_constraint.py @@ -2,16 +2,9 @@ from antarest.core.model import JSON from antarest.matrixstore.model import MatrixData -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - BindingConstraintDTO, - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import BindingConstraintDTO, FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - BindingConstraintOperator, - CommandOutput, - TimeStep, -) +from antarest.study.storage.variantstudy.model.command.common import BindingConstraintOperator, CommandOutput, TimeStep def cluster_does_not_exist( diff --git a/antarest/study/storage/variantstudy/command_factory.py b/antarest/study/storage/variantstudy/command_factory.py index 5468323b57..44ed1f007f 100644 --- a/antarest/study/storage/variantstudy/command_factory.py +++ b/antarest/study/storage/variantstudy/command_factory.py @@ -3,82 +3,32 @@ from antarest.core.model import JSON from antarest.matrixstore.service import ISimpleMatrixService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_binding_constraint import ( - CreateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.create_cluster import ( - CreateCluster, -) -from antarest.study.storage.variantstudy.model.command.create_district import ( - CreateDistrict, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import ( - CreateRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command.create_st_storage import ( - CreateSTStorage, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants +from antarest.study.storage.variantstudy.model.command.common import CommandName +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_binding_constraint import CreateBindingConstraint +from antarest.study.storage.variantstudy.model.command.create_cluster import CreateCluster +from antarest.study.storage.variantstudy.model.command.create_district import CreateDistrict +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import CreateRenewablesCluster +from antarest.study.storage.variantstudy.model.command.create_st_storage import CreateSTStorage from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_binding_constraint import ( - RemoveBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.remove_cluster import ( - RemoveCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_district import ( - RemoveDistrict, -) -from antarest.study.storage.variantstudy.model.command.remove_link import ( - RemoveLink, -) -from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import ( - RemoveRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_st_storage import ( - RemoveSTStorage, -) -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command.update_binding_constraint import ( - UpdateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.update_comments import ( - UpdateComments, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command.update_district import ( - UpdateDistrict, -) -from antarest.study.storage.variantstudy.model.command.update_playlist import ( - UpdatePlaylist, -) -from antarest.study.storage.variantstudy.model.command.update_raw_file import ( - UpdateRawFile, -) -from antarest.study.storage.variantstudy.model.command.update_scenario_builder import ( - UpdateScenarioBuilder, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_binding_constraint import RemoveBindingConstraint +from antarest.study.storage.variantstudy.model.command.remove_cluster import RemoveCluster +from antarest.study.storage.variantstudy.model.command.remove_district import RemoveDistrict +from antarest.study.storage.variantstudy.model.command.remove_link import RemoveLink +from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import RemoveRenewablesCluster +from antarest.study.storage.variantstudy.model.command.remove_st_storage import RemoveSTStorage +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command.update_binding_constraint import UpdateBindingConstraint +from antarest.study.storage.variantstudy.model.command.update_comments import UpdateComments +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command.update_district import UpdateDistrict +from antarest.study.storage.variantstudy.model.command.update_playlist import UpdatePlaylist +from antarest.study.storage.variantstudy.model.command.update_raw_file import UpdateRawFile +from antarest.study.storage.variantstudy.model.command.update_scenario_builder import UpdateScenarioBuilder +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.model import CommandDTO COMMAND_MAPPING = { diff --git a/antarest/study/storage/variantstudy/model/command/create_area.py b/antarest/study/storage/variantstudy/model/command/create_area.py index c552a490bf..bb0dcfd02e 100644 --- a/antarest/study/storage/variantstudy/model/command/create_area.py +++ b/antarest/study/storage/variantstudy/model/command/create_area.py @@ -1,10 +1,7 @@ from typing import Any, Dict, List, Tuple from antarest.core.model import JSON -from antarest.study.common.default_values import ( - FilteringOptions, - NodalOptimization, -) +from antarest.study.common.default_values import FilteringOptions, NodalOptimization from antarest.study.storage.rawstudy.model.filesystem.config.model import ( ENR_MODELLING, Area, @@ -12,14 +9,8 @@ transform_name_to_id, ) from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py b/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py index f7d0267ca3..3df80f0f38 100644 --- a/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py +++ b/antarest/study/storage/variantstudy/model/command/create_binding_constraint.py @@ -4,15 +4,9 @@ from antarest.core.utils.utils import assert_this from antarest.matrixstore.model import MatrixData -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, - validate_matrix, -) +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol, validate_matrix from antarest.study.storage.variantstudy.business.utils_binding_constraint import ( apply_binding_constraint, parse_bindings_coeffs_and_save_into_config, @@ -23,10 +17,7 @@ CommandOutput, TimeStep, ) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO @@ -131,9 +122,7 @@ def match(self, other: ICommand, equal: bool = False) -> bool: def _create_diff(self, other: "ICommand") -> List["ICommand"]: other = cast(CreateBindingConstraint, other) - from antarest.study.storage.variantstudy.model.command.update_binding_constraint import ( - UpdateBindingConstraint, - ) + from antarest.study.storage.variantstudy.model.command.update_binding_constraint import UpdateBindingConstraint bd_id = transform_name_to_id(self.name) return [ diff --git a/antarest/study/storage/variantstudy/model/command/create_cluster.py b/antarest/study/storage/variantstudy/model/command/create_cluster.py index 1cab6fa6ed..1bd99a9ad1 100644 --- a/antarest/study/storage/variantstudy/model/command/create_cluster.py +++ b/antarest/study/storage/variantstudy/model/command/create_cluster.py @@ -11,18 +11,9 @@ transform_name_to_id, ) from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, - validate_matrix, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol, validate_matrix +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO @@ -185,12 +176,8 @@ def match(self, other: ICommand, equal: bool = False) -> bool: def _create_diff(self, other: "ICommand") -> List["ICommand"]: other = cast(CreateCluster, other) - from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, - ) - from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, - ) + from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix + from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig cluster_id = transform_name_to_id(self.cluster_name) commands: List[ICommand] = [] diff --git a/antarest/study/storage/variantstudy/model/command/create_district.py b/antarest/study/storage/variantstudy/model/command/create_district.py index 60196c1aa5..d20f4a6bc6 100644 --- a/antarest/study/storage/variantstudy/model/command/create_district.py +++ b/antarest/study/storage/variantstudy/model/command/create_district.py @@ -9,14 +9,8 @@ transform_name_to_id, ) from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO @@ -130,9 +124,7 @@ def match(self, other: ICommand, equal: bool = False) -> bool: def _create_diff(self, other: "ICommand") -> List["ICommand"]: other = cast(CreateDistrict, other) district_id = transform_name_to_id(self.name) - from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, - ) + from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig base_filter = other.base_filter or DistrictBaseFilter.remove_all inverted_set = base_filter == DistrictBaseFilter.add_all diff --git a/antarest/study/storage/variantstudy/model/command/create_link.py b/antarest/study/storage/variantstudy/model/command/create_link.py index 7491e85643..5082a873ea 100644 --- a/antarest/study/storage/variantstudy/model/command/create_link.py +++ b/antarest/study/storage/variantstudy/model/command/create_link.py @@ -5,27 +5,12 @@ from antarest.core.model import JSON from antarest.core.utils.utils import assert_this from antarest.matrixstore.model import MatrixData -from antarest.study.common.default_values import ( - FilteringOptions, - LinkProperties, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - Link, -) +from antarest.study.common.default_values import FilteringOptions, LinkProperties +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, Link from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, - validate_matrix, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol, validate_matrix +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO @@ -301,12 +286,8 @@ def match(self, other: ICommand, equal: bool = False) -> bool: def _create_diff(self, other: "ICommand") -> List["ICommand"]: other = cast(CreateLink, other) - from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, - ) - from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, - ) + from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix + from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig commands: List[ICommand] = [] area_from, area_to = sorted([self.area1, self.area2]) diff --git a/antarest/study/storage/variantstudy/model/command/create_renewables_cluster.py b/antarest/study/storage/variantstudy/model/command/create_renewables_cluster.py index 8c13fbe797..4202da0217 100644 --- a/antarest/study/storage/variantstudy/model/command/create_renewables_cluster.py +++ b/antarest/study/storage/variantstudy/model/command/create_renewables_cluster.py @@ -10,14 +10,8 @@ transform_name_to_id, ) from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO @@ -142,9 +136,7 @@ def match(self, other: ICommand, equal: bool = False) -> bool: def _create_diff(self, other: "ICommand") -> List["ICommand"]: other = cast(CreateRenewablesCluster, other) - from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, - ) + from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig commands: List[ICommand] = [] if self.parameters != other.parameters: diff --git a/antarest/study/storage/variantstudy/model/command/create_st_storage.py b/antarest/study/storage/variantstudy/model/command/create_st_storage.py index 3553a54f79..924d248fd0 100644 --- a/antarest/study/storage/variantstudy/model/command/create_st_storage.py +++ b/antarest/study/storage/variantstudy/model/command/create_st_storage.py @@ -7,29 +7,13 @@ from antarest.core.model import JSON from antarest.matrixstore.model import MatrixData -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import ( - STStorageConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import STStorageConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, - validate_matrix, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol, validate_matrix +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO # noinspection SpellCheckingInspection @@ -347,12 +331,8 @@ def _create_diff(self, other: "ICommand") -> List["ICommand"]: A list of commands representing the differences between the two `ICommand` objects. """ - from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, - ) - from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, - ) + from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix + from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig other = cast(CreateSTStorage, other) commands: List[ICommand] = [ diff --git a/antarest/study/storage/variantstudy/model/command/icommand.py b/antarest/study/storage/variantstudy/model/command/icommand.py index b89ff9a5cd..a75120d32f 100644 --- a/antarest/study/storage/variantstudy/model/command/icommand.py +++ b/antarest/study/storage/variantstudy/model/command/icommand.py @@ -5,23 +5,14 @@ from pydantic import BaseModel from antarest.core.utils.utils import assert_this -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.model import CommandDTO if TYPE_CHECKING: # False at runtime, for mypy - from antarest.study.storage.variantstudy.business.command_extractor import ( - CommandExtractor, - ) + from antarest.study.storage.variantstudy.business.command_extractor import CommandExtractor MATCH_SIGNATURE_SEPARATOR = "%" logger = logging.getLogger(__name__) @@ -169,9 +160,7 @@ def get_command_extractor(self) -> "CommandExtractor": Returns: An instance of `CommandExtractor`. """ - from antarest.study.storage.variantstudy.business.command_extractor import ( - CommandExtractor, - ) + from antarest.study.storage.variantstudy.business.command_extractor import CommandExtractor return CommandExtractor( self.command_context.matrix_service, diff --git a/antarest/study/storage/variantstudy/model/command/remove_area.py b/antarest/study/storage/variantstudy/model/command/remove_area.py index c5606e8290..309fc19d8b 100644 --- a/antarest/study/storage/variantstudy/model/command/remove_area.py +++ b/antarest/study/storage/variantstudy/model/command/remove_area.py @@ -3,24 +3,14 @@ from typing import Any, Dict, List, Tuple from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError from antarest.study.storage.variantstudy.business.utils_binding_constraint import ( remove_area_cluster_from_binding_constraints, ) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/variantstudy/model/command/remove_binding_constraint.py b/antarest/study/storage/variantstudy/model/command/remove_binding_constraint.py index 254b109643..55ef24ebf6 100644 --- a/antarest/study/storage/variantstudy/model/command/remove_binding_constraint.py +++ b/antarest/study/storage/variantstudy/model/command/remove_binding_constraint.py @@ -1,18 +1,10 @@ from typing import Any, Dict, List, Tuple from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/remove_cluster.py b/antarest/study/storage/variantstudy/model/command/remove_cluster.py index 86a930d7c2..784e086a77 100644 --- a/antarest/study/storage/variantstudy/model/command/remove_cluster.py +++ b/antarest/study/storage/variantstudy/model/command/remove_cluster.py @@ -1,20 +1,12 @@ from typing import Any, Dict, List, Tuple -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.variantstudy.business.utils_binding_constraint import ( remove_area_cluster_from_binding_constraints, ) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/remove_district.py b/antarest/study/storage/variantstudy/model/command/remove_district.py index 15c933ec35..ea8906a757 100644 --- a/antarest/study/storage/variantstudy/model/command/remove_district.py +++ b/antarest/study/storage/variantstudy/model/command/remove_district.py @@ -1,17 +1,9 @@ from typing import Any, Dict, List, Tuple -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/remove_link.py b/antarest/study/storage/variantstudy/model/command/remove_link.py index 7e7a6ddac9..570928ce5e 100644 --- a/antarest/study/storage/variantstudy/model/command/remove_link.py +++ b/antarest/study/storage/variantstudy/model/command/remove_link.py @@ -1,17 +1,9 @@ from typing import Any, Dict, List, Tuple -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/remove_renewables_cluster.py b/antarest/study/storage/variantstudy/model/command/remove_renewables_cluster.py index 28d47a3e33..2d28d7c811 100644 --- a/antarest/study/storage/variantstudy/model/command/remove_renewables_cluster.py +++ b/antarest/study/storage/variantstudy/model/command/remove_renewables_cluster.py @@ -1,21 +1,12 @@ from typing import Any, Dict, List, Tuple -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.variantstudy.business.utils_binding_constraint import ( remove_area_cluster_from_binding_constraints, ) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/remove_st_storage.py b/antarest/study/storage/variantstudy/model/command/remove_st_storage.py index 921cc4acb5..588e565d7c 100644 --- a/antarest/study/storage/variantstudy/model/command/remove_st_storage.py +++ b/antarest/study/storage/variantstudy/model/command/remove_st_storage.py @@ -2,19 +2,10 @@ from pydantic import Field -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO # minimum required version. diff --git a/antarest/study/storage/variantstudy/model/command/replace_matrix.py b/antarest/study/storage/variantstudy/model/command/replace_matrix.py index cf0232b4f2..b4dfab6ec1 100644 --- a/antarest/study/storage/variantstudy/model/command/replace_matrix.py +++ b/antarest/study/storage/variantstudy/model/command/replace_matrix.py @@ -5,29 +5,13 @@ from antarest.core.model import JSON from antarest.core.utils.utils import assert_this from antarest.matrixstore.model import MatrixData -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixNode, -) -from antarest.study.storage.variantstudy.business.utils import ( - AliasDecoder, - strip_matrix_protocol, - validate_matrix, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixNode +from antarest.study.storage.variantstudy.business.utils import AliasDecoder, strip_matrix_protocol, validate_matrix +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/update_binding_constraint.py b/antarest/study/storage/variantstudy/model/command/update_binding_constraint.py index c2750d1ae1..a2398649c1 100644 --- a/antarest/study/storage/variantstudy/model/command/update_binding_constraint.py +++ b/antarest/study/storage/variantstudy/model/command/update_binding_constraint.py @@ -5,27 +5,17 @@ from antarest.core.model import JSON from antarest.core.utils.utils import assert_this from antarest.matrixstore.model import MatrixData -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, - validate_matrix, -) -from antarest.study.storage.variantstudy.business.utils_binding_constraint import ( - apply_binding_constraint, -) +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol, validate_matrix +from antarest.study.storage.variantstudy.business.utils_binding_constraint import apply_binding_constraint from antarest.study.storage.variantstudy.model.command.common import ( BindingConstraintOperator, CommandName, CommandOutput, TimeStep, ) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/update_comments.py b/antarest/study/storage/variantstudy/model/command/update_comments.py index 722f7ab280..fff04d18e9 100644 --- a/antarest/study/storage/variantstudy/model/command/update_comments.py +++ b/antarest/study/storage/variantstudy/model/command/update_comments.py @@ -1,14 +1,9 @@ from typing import Any, Dict, List, Tuple from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/update_config.py b/antarest/study/storage/variantstudy/model/command/update_config.py index 9ec91fa2bd..9d6bc56435 100644 --- a/antarest/study/storage/variantstudy/model/command/update_config.py +++ b/antarest/study/storage/variantstudy/model/command/update_config.py @@ -1,21 +1,11 @@ from typing import Any, Dict, List, Tuple, Union from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/update_district.py b/antarest/study/storage/variantstudy/model/command/update_district.py index 9cd6348629..4e88bf11d4 100644 --- a/antarest/study/storage/variantstudy/model/command/update_district.py +++ b/antarest/study/storage/variantstudy/model/command/update_district.py @@ -1,20 +1,10 @@ from typing import Any, Dict, List, Optional, Tuple -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.create_district import ( - DistrictBaseFilter, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.create_district import DistrictBaseFilter +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/update_playlist.py b/antarest/study/storage/variantstudy/model/command/update_playlist.py index d554114a4d..090e88fef0 100644 --- a/antarest/study/storage/variantstudy/model/command/update_playlist.py +++ b/antarest/study/storage/variantstudy/model/command/update_playlist.py @@ -1,14 +1,9 @@ from typing import Any, Dict, List, Optional, Tuple -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.rawstudy.model.helpers import FileStudyHelpers -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/update_raw_file.py b/antarest/study/storage/variantstudy/model/command/update_raw_file.py index b159c129ae..61aaa66c34 100644 --- a/antarest/study/storage/variantstudy/model/command/update_raw_file.py +++ b/antarest/study/storage/variantstudy/model/command/update_raw_file.py @@ -1,21 +1,11 @@ import base64 from typing import Any, Dict, List, Tuple -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) -from antarest.study.storage.variantstudy.model.command.icommand import ( - MATCH_SIGNATURE_SEPARATOR, - ICommand, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput +from antarest.study.storage.variantstudy.model.command.icommand import MATCH_SIGNATURE_SEPARATOR, ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command/update_scenario_builder.py b/antarest/study/storage/variantstudy/model/command/update_scenario_builder.py index a2a22a3b45..f7c3940085 100644 --- a/antarest/study/storage/variantstudy/model/command/update_scenario_builder.py +++ b/antarest/study/storage/variantstudy/model/command/update_scenario_builder.py @@ -1,14 +1,9 @@ from typing import Any, Dict, List, Tuple from antarest.core.utils.dict import merge_deep -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, - CommandOutput, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName, CommandOutput from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/model/command_context.py b/antarest/study/storage/variantstudy/model/command_context.py index 0efb2024d8..a361d40959 100644 --- a/antarest/study/storage/variantstudy/model/command_context.py +++ b/antarest/study/storage/variantstudy/model/command_context.py @@ -2,9 +2,7 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants class CommandContext(BaseModel): diff --git a/antarest/study/storage/variantstudy/model/dbmodel.py b/antarest/study/storage/variantstudy/model/dbmodel.py index bc8167cbd1..e4670836f4 100644 --- a/antarest/study/storage/variantstudy/model/dbmodel.py +++ b/antarest/study/storage/variantstudy/model/dbmodel.py @@ -2,14 +2,7 @@ import uuid from dataclasses import dataclass -from sqlalchemy import ( # type: ignore - Column, - DateTime, - ForeignKey, - Integer, - String, - Table, -) +from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Table # type: ignore from sqlalchemy.orm import relationship # type: ignore from antarest.core.persistence import Base diff --git a/antarest/study/storage/variantstudy/model/interfaces.py b/antarest/study/storage/variantstudy/model/interfaces.py index 3b007a37dd..b85961557d 100644 --- a/antarest/study/storage/variantstudy/model/interfaces.py +++ b/antarest/study/storage/variantstudy/model/interfaces.py @@ -4,9 +4,7 @@ from antarest.core.model import JSON from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree class ICommandExtractor(abc.ABC): diff --git a/antarest/study/storage/variantstudy/repository.py b/antarest/study/storage/variantstudy/repository.py index 8cd72ee62b..b04a7e796c 100644 --- a/antarest/study/storage/variantstudy/repository.py +++ b/antarest/study/storage/variantstudy/repository.py @@ -3,10 +3,7 @@ from antarest.core.interfaces.cache import ICache from antarest.core.utils.fastapi_sqlalchemy import db from antarest.study.repository import StudyMetadataRepository -from antarest.study.storage.variantstudy.model.dbmodel import ( - CommandBlock, - VariantStudy, -) +from antarest.study.storage.variantstudy.model.dbmodel import CommandBlock, VariantStudy class VariantStudyRepository(StudyMetadataRepository): diff --git a/antarest/study/storage/variantstudy/variant_command_extractor.py b/antarest/study/storage/variantstudy/variant_command_extractor.py index 7bb7efdd46..f5732b8684 100644 --- a/antarest/study/storage/variantstudy/variant_command_extractor.py +++ b/antarest/study/storage/variantstudy/variant_command_extractor.py @@ -5,19 +5,11 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.study.storage.patch_service import PatchService from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_extractor import ( - CommandExtractor, -) -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.command_extractor import CommandExtractor +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/antarest/study/storage/variantstudy/variant_command_generator.py b/antarest/study/storage/variantstudy/variant_command_generator.py index f0fdaa1997..ce01bd6e26 100644 --- a/antarest/study/storage/variantstudy/variant_command_generator.py +++ b/antarest/study/storage/variantstudy/variant_command_generator.py @@ -4,22 +4,13 @@ from typing import Callable, List, Optional, Tuple, Union, cast from antarest.core.utils.utils import StopWatch -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - FileStudy, - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy, StudyFactory from antarest.study.storage.utils import update_antares_info -from antarest.study.storage.variantstudy.model.command.common import ( - CommandOutput, -) +from antarest.study.storage.variantstudy.model.command.common import CommandOutput from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy -from antarest.study.storage.variantstudy.model.model import ( - GenerationResultInfoDTO, -) +from antarest.study.storage.variantstudy.model.model import GenerationResultInfoDTO logger = logging.getLogger(__name__) diff --git a/antarest/study/storage/variantstudy/variant_study_service.py b/antarest/study/storage/variantstudy/variant_study_service.py index 5bf136cccc..c9c3f38669 100644 --- a/antarest/study/storage/variantstudy/variant_study_service.py +++ b/antarest/study/storage/variantstudy/variant_study_service.py @@ -25,47 +25,19 @@ ) from antarest.core.filetransfer.model import FileDownloadTaskDTO from antarest.core.interfaces.cache import ICache -from antarest.core.interfaces.eventbus import ( - Event, - EventChannelDirectory, - EventType, - IEventBus, -) +from antarest.core.interfaces.eventbus import Event, EventChannelDirectory, EventType, IEventBus from antarest.core.jwt import DEFAULT_ADMIN_USER from antarest.core.model import JSON, PermissionInfo, StudyPermissionType from antarest.core.requests import RequestParameters, UserHasNotPermissionError -from antarest.core.tasks.model import ( - CustomTaskEventMessages, - TaskDTO, - TaskResult, - TaskType, -) -from antarest.core.tasks.service import ( - ITaskService, - TaskUpdateNotifier, - noop_notifier, -) +from antarest.core.tasks.model import CustomTaskEventMessages, TaskDTO, TaskResult, TaskType +from antarest.core.tasks.service import ITaskService, TaskUpdateNotifier, noop_notifier from antarest.core.utils.utils import assert_this, suppress_exception from antarest.matrixstore.service import MatrixService -from antarest.study.model import ( - RawStudy, - Study, - StudyAdditionalData, - StudyMetadataDTO, - StudySimResultDTO, -) -from antarest.study.storage.abstract_storage_service import ( - AbstractStorageService, -) +from antarest.study.model import RawStudy, Study, StudyAdditionalData, StudyMetadataDTO, StudySimResultDTO +from antarest.study.storage.abstract_storage_service import AbstractStorageService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, - FileStudyTreeConfigDTO, -) -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - FileStudy, - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, FileStudyTreeConfigDTO +from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy, StudyFactory from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.utils import ( assert_permission, @@ -74,28 +46,18 @@ is_managed, remove_from_cache, ) -from antarest.study.storage.variantstudy.business.utils import ( - transform_command_to_dto, -) +from antarest.study.storage.variantstudy.business.utils import transform_command_to_dto from antarest.study.storage.variantstudy.command_factory import CommandFactory from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.dbmodel import ( - CommandBlock, - VariantStudy, - VariantStudySnapshot, -) +from antarest.study.storage.variantstudy.model.dbmodel import CommandBlock, VariantStudy, VariantStudySnapshot from antarest.study.storage.variantstudy.model.model import ( CommandDTO, CommandResultDTO, GenerationResultInfoDTO, VariantTreeDTO, ) -from antarest.study.storage.variantstudy.repository import ( - VariantStudyRepository, -) -from antarest.study.storage.variantstudy.variant_command_generator import ( - VariantCommandGenerator, -) +from antarest.study.storage.variantstudy.repository import VariantStudyRepository +from antarest.study.storage.variantstudy.variant_command_generator import VariantCommandGenerator logger = logging.getLogger(__name__) diff --git a/antarest/study/web/raw_studies_blueprint.py b/antarest/study/web/raw_studies_blueprint.py index f76035cdd9..118c005e2f 100644 --- a/antarest/study/web/raw_studies_blueprint.py +++ b/antarest/study/web/raw_studies_blueprint.py @@ -7,12 +7,7 @@ from fastapi import APIRouter, Body, Depends, File, HTTPException from fastapi.params import Param -from starlette.responses import ( - JSONResponse, - PlainTextResponse, - Response, - StreamingResponse, -) +from starlette.responses import JSONResponse, PlainTextResponse, Response, StreamingResponse from antarest.core.config import Config from antarest.core.jwt import JWTUser diff --git a/antarest/study/web/studies_blueprint.py b/antarest/study/web/studies_blueprint.py index bff4d43874..eba4a52212 100644 --- a/antarest/study/web/studies_blueprint.py +++ b/antarest/study/web/studies_blueprint.py @@ -26,9 +26,7 @@ StudySimResultDTO, ) from antarest.study.service import StudyService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfigDTO, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfigDTO logger = logging.getLogger(__name__) diff --git a/antarest/study/web/study_data_blueprint.py b/antarest/study/web/study_data_blueprint.py index 0c1c2e89ec..b48d0c2cfb 100644 --- a/antarest/study/web/study_data_blueprint.py +++ b/antarest/study/web/study_data_blueprint.py @@ -12,52 +12,20 @@ from antarest.core.utils.web import APITag from antarest.login.auth import Auth from antarest.matrixstore.matrix_editor import MatrixEditInstruction -from antarest.study.business.adequacy_patch_management import ( - AdequacyPatchFormFields, -) -from antarest.study.business.advanced_parameters_management import ( - AdvancedParamsFormFields, -) -from antarest.study.business.allocation_management import ( - AllocationFormFields, - AllocationMatrix, -) -from antarest.study.business.area_management import ( - AreaCreationDTO, - AreaInfoDTO, - AreaType, - AreaUI, - LayerInfoDTO, -) -from antarest.study.business.areas.hydro_management import ( - ManagementOptionsFormFields, -) -from antarest.study.business.areas.properties_management import ( - PropertiesFormFields, -) -from antarest.study.business.areas.renewable_management import ( - RenewableFormFields, -) +from antarest.study.business.adequacy_patch_management import AdequacyPatchFormFields +from antarest.study.business.advanced_parameters_management import AdvancedParamsFormFields +from antarest.study.business.allocation_management import AllocationFormFields, AllocationMatrix +from antarest.study.business.area_management import AreaCreationDTO, AreaInfoDTO, AreaType, AreaUI, LayerInfoDTO +from antarest.study.business.areas.hydro_management import ManagementOptionsFormFields +from antarest.study.business.areas.properties_management import PropertiesFormFields +from antarest.study.business.areas.renewable_management import RenewableFormFields from antarest.study.business.areas.thermal_management import ThermalFormFields -from antarest.study.business.binding_constraint_management import ( - ConstraintTermDTO, - UpdateBindingConstProps, -) -from antarest.study.business.correlation_management import ( - CorrelationFormFields, - CorrelationManager, - CorrelationMatrix, -) -from antarest.study.business.district_manager import ( - DistrictCreationDTO, - DistrictInfoDTO, - DistrictUpdateDTO, -) +from antarest.study.business.binding_constraint_management import ConstraintTermDTO, UpdateBindingConstProps +from antarest.study.business.correlation_management import CorrelationFormFields, CorrelationManager, CorrelationMatrix +from antarest.study.business.district_manager import DistrictCreationDTO, DistrictInfoDTO, DistrictUpdateDTO from antarest.study.business.general_management import GeneralFormFields from antarest.study.business.link_management import LinkInfoDTO -from antarest.study.business.optimization_management import ( - OptimizationFormFields, -) +from antarest.study.business.optimization_management import OptimizationFormFields from antarest.study.business.playlist_management import PlaylistColumns from antarest.study.business.st_storage_manager import ( StorageCreation, @@ -66,13 +34,8 @@ STStorageMatrix, STStorageTimeSeries, ) -from antarest.study.business.table_mode_management import ( - ColumnsModelTypes, - TableTemplateType, -) -from antarest.study.business.thematic_trimming_management import ( - ThematicTrimmingFormFields, -) +from antarest.study.business.table_mode_management import ColumnsModelTypes, TableTemplateType +from antarest.study.business.thematic_trimming_management import ThematicTrimmingFormFields from antarest.study.business.timeseries_config_management import TSFormFields from antarest.study.model import PatchArea, PatchCluster from antarest.study.service import StudyService diff --git a/antarest/study/web/variant_blueprint.py b/antarest/study/web/variant_blueprint.py index 7c128e5261..fda32c4fbe 100644 --- a/antarest/study/web/variant_blueprint.py +++ b/antarest/study/web/variant_blueprint.py @@ -13,13 +13,8 @@ from antarest.login.auth import Auth from antarest.study.model import StudyMetadataDTO from antarest.study.service import StudyService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.model import ( - CommandDTO, - VariantTreeDTO, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.model import CommandDTO, VariantTreeDTO logger = logging.getLogger(__name__) diff --git a/antarest/tools/admin_lib.py b/antarest/tools/admin_lib.py index a603b41437..aaca49cdeb 100644 --- a/antarest/tools/admin_lib.py +++ b/antarest/tools/admin_lib.py @@ -3,9 +3,7 @@ from antarest.core.config import Config from antarest.core.utils.utils import get_local_path -from antarest.launcher.adapters.slurm_launcher.slurm_launcher import ( - WORKSPACE_LOCK_FILE_NAME, -) +from antarest.launcher.adapters.slurm_launcher.slurm_launcher import WORKSPACE_LOCK_FILE_NAME logger = logging.getLogger(__name__) diff --git a/antarest/tools/lib.py b/antarest/tools/lib.py index 7ee9fdab84..219d066e0d 100644 --- a/antarest/tools/lib.py +++ b/antarest/tools/lib.py @@ -17,30 +17,16 @@ from antarest.core.utils.utils import StopWatch, get_local_path from antarest.matrixstore.service import SimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.model import ( - NEW_DEFAULT_STUDY_VERSION, - STUDY_REFERENCE_TEMPLATES, -) +from antarest.study.model import NEW_DEFAULT_STUDY_VERSION, STUDY_REFERENCE_TEMPLATES from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.factory import StudyFactory from antarest.study.storage.utils import create_new_empty_study -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.model import ( - CommandDTO, - GenerationResultInfoDTO, -) -from antarest.study.storage.variantstudy.variant_command_extractor import ( - VariantCommandsExtractor, -) -from antarest.study.storage.variantstudy.variant_command_generator import ( - VariantCommandGenerator, -) +from antarest.study.storage.variantstudy.model.model import CommandDTO, GenerationResultInfoDTO +from antarest.study.storage.variantstudy.variant_command_extractor import VariantCommandsExtractor +from antarest.study.storage.variantstudy.variant_command_generator import VariantCommandGenerator logger = logging.getLogger(__name__) COMMAND_FILE = "commands.json" diff --git a/antarest/utils.py b/antarest/utils.py index 4256e2d453..0c71a3e3ae 100644 --- a/antarest/utils.py +++ b/antarest/utils.py @@ -32,9 +32,7 @@ from antarest.login.main import build_login from antarest.login.service import LoginService from antarest.matrixstore.main import build_matrix_service -from antarest.matrixstore.matrix_garbage_collector import ( - MatrixGarbageCollector, -) +from antarest.matrixstore.matrix_garbage_collector import MatrixGarbageCollector from antarest.matrixstore.service import MatrixService from antarest.study.main import build_study_service from antarest.study.service import StudyService diff --git a/antarest/worker/simulator_worker.py b/antarest/worker/simulator_worker.py index 643bc45918..5ba3cdfccc 100644 --- a/antarest/worker/simulator_worker.py +++ b/antarest/worker/simulator_worker.py @@ -15,9 +15,7 @@ from antarest.launcher.adapters.log_manager import LogTailManager from antarest.matrixstore.service import MatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.factory import StudyFactory from antarest.worker.worker import AbstractWorker, WorkerTaskCommand logger = logging.getLogger(__name__) diff --git a/tests/cache/test_local_cache.py b/tests/cache/test_local_cache.py index e3bfb752e8..da9793a430 100644 --- a/tests/cache/test_local_cache.py +++ b/tests/cache/test_local_cache.py @@ -2,15 +2,9 @@ from pathlib import Path from unittest import mock -from antarest.core.cache.business.local_chache import ( - LocalCache, - LocalCacheElement, -) +from antarest.core.cache.business.local_chache import LocalCache, LocalCacheElement from antarest.core.config import CacheConfig -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - FileStudyTreeConfigDTO, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, FileStudyTreeConfigDTO @mock.patch("time.time", mock.MagicMock(return_value=12345)) diff --git a/tests/cache/test_redis_cache.py b/tests/cache/test_redis_cache.py index f77a1b147c..40a71c8376 100644 --- a/tests/cache/test_redis_cache.py +++ b/tests/cache/test_redis_cache.py @@ -2,14 +2,8 @@ from pathlib import Path from unittest.mock import Mock -from antarest.core.cache.business.redis_cache import ( - RedisCache, - RedisCacheElement, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - FileStudyTreeConfigDTO, -) +from antarest.core.cache.business.redis_cache import RedisCache, RedisCacheElement +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, FileStudyTreeConfigDTO def test_lifecycle(): diff --git a/tests/conftest_services.py b/tests/conftest_services.py index 6a6beca432..8dc145c76b 100644 --- a/tests/conftest_services.py +++ b/tests/conftest_services.py @@ -15,34 +15,19 @@ from antarest.core.interfaces.cache import ICache from antarest.core.interfaces.eventbus import IEventBus from antarest.core.requests import RequestParameters -from antarest.core.tasks.model import ( - CustomTaskEventMessages, - TaskDTO, - TaskListFilter, - TaskResult, - TaskStatus, - TaskType, -) +from antarest.core.tasks.model import CustomTaskEventMessages, TaskDTO, TaskListFilter, TaskResult, TaskStatus, TaskType from antarest.core.tasks.service import ITaskService, Task from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware from antarest.matrixstore.service import SimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.factory import StudyFactory from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.repository import ( - VariantStudyRepository, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.repository import VariantStudyRepository +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService __all__ = ( "bucket_dir_fixture", diff --git a/tests/core/test_tasks.py b/tests/core/test_tasks.py index 3f342d5b7e..51981e88c4 100644 --- a/tests/core/test_tasks.py +++ b/tests/core/test_tasks.py @@ -13,15 +13,7 @@ from antarest.core.model import PermissionInfo, PublicMode from antarest.core.persistence import Base from antarest.core.requests import RequestParameters, UserHasNotPermissionError -from antarest.core.tasks.model import ( - TaskDTO, - TaskJob, - TaskJobLog, - TaskListFilter, - TaskResult, - TaskStatus, - TaskType, -) +from antarest.core.tasks.model import TaskDTO, TaskJob, TaskJobLog, TaskListFilter, TaskResult, TaskStatus, TaskType from antarest.core.tasks.repository import TaskJobRepository from antarest.core.tasks.service import TaskJobService from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware, db diff --git a/tests/core/test_utils.py b/tests/core/test_utils.py index 10942564d9..74f300d1c8 100644 --- a/tests/core/test_utils.py +++ b/tests/core/test_utils.py @@ -4,13 +4,7 @@ import pytest from antarest.core.exceptions import ShouldNotHappenException -from antarest.core.utils.utils import ( - concat_files, - concat_files_to_str, - read_in_zip, - retry, - suppress_exception, -) +from antarest.core.utils.utils import concat_files, concat_files_to_str, read_in_zip, retry, suppress_exception def test_retry(): diff --git a/tests/core/test_utils_bp.py b/tests/core/test_utils_bp.py index f9efb93dd4..662ae357fe 100644 --- a/tests/core/test_utils_bp.py +++ b/tests/core/test_utils_bp.py @@ -7,12 +7,7 @@ from starlette.testclient import TestClient from antarest import __version__ -from antarest.core.config import ( - Config, - SecurityConfig, - StorageConfig, - WorkspaceConfig, -) +from antarest.core.config import Config, SecurityConfig, StorageConfig, WorkspaceConfig from antarest.core.core_blueprint import create_utils_routes from antarest.study.model import DEFAULT_WORKSPACE_NAME diff --git a/tests/eventbus/test_websocket_manager.py b/tests/eventbus/test_websocket_manager.py index eb5d238c6a..d690a2ff43 100644 --- a/tests/eventbus/test_websocket_manager.py +++ b/tests/eventbus/test_websocket_manager.py @@ -5,11 +5,7 @@ from antarest.core.jwt import JWTUser from antarest.core.model import PermissionInfo -from antarest.eventbus.web import ( - ConnectionManager, - WebsocketMessage, - WebsocketMessageAction, -) +from antarest.eventbus.web import ConnectionManager, WebsocketMessage, WebsocketMessageAction class AsyncMock(MagicMock): diff --git a/tests/integration/study_data_blueprint/test_st_storage.py b/tests/integration/study_data_blueprint/test_st_storage.py index 2f2ab7d238..fa848339eb 100644 --- a/tests/integration/study_data_blueprint/test_st_storage.py +++ b/tests/integration/study_data_blueprint/test_st_storage.py @@ -6,9 +6,7 @@ from starlette.testclient import TestClient from antarest.core.tasks.model import TaskStatus -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from tests.integration.utils import wait_task_completion diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index c86e66ad73..a04d9cce23 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -28,9 +28,7 @@ TransmissionCapacity, ) from antarest.study.model import MatrixIndex, StudyDownloadLevelDTO -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName from tests.integration.utils import wait_for diff --git a/tests/integration/test_integration_variantmanager_tool.py b/tests/integration/test_integration_variantmanager_tool.py index 537120c61d..8b087c3cf9 100644 --- a/tests/integration/test_integration_variantmanager_tool.py +++ b/tests/integration/test_integration_variantmanager_tool.py @@ -14,13 +14,8 @@ default_scenario_daily, default_scenario_hourly, ) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) -from antarest.study.storage.variantstudy.model.model import ( - CommandDTO, - GenerationResultInfoDTO, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName +from antarest.study.storage.variantstudy.model.model import CommandDTO, GenerationResultInfoDTO from antarest.tools.lib import ( COMMAND_FILE, MATRIX_STORE_DIR, diff --git a/tests/integration/variant_blueprint/test_renewable_cluster.py b/tests/integration/variant_blueprint/test_renewable_cluster.py index edc77f6897..9e6c18302d 100644 --- a/tests/integration/variant_blueprint/test_renewable_cluster.py +++ b/tests/integration/variant_blueprint/test_renewable_cluster.py @@ -4,9 +4,7 @@ import pytest from starlette.testclient import TestClient -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id # noinspection SpellCheckingInspection diff --git a/tests/integration/variant_blueprint/test_st_storage.py b/tests/integration/variant_blueprint/test_st_storage.py index 611817da48..722415de2a 100644 --- a/tests/integration/variant_blueprint/test_st_storage.py +++ b/tests/integration/variant_blueprint/test_st_storage.py @@ -6,9 +6,7 @@ from starlette.testclient import TestClient from antarest.core.tasks.model import TaskStatus -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from tests.integration.utils import wait_task_completion diff --git a/tests/launcher/test_extension_adequacy_patch.py b/tests/launcher/test_extension_adequacy_patch.py index 54970088e7..4ace10884e 100644 --- a/tests/launcher/test_extension_adequacy_patch.py +++ b/tests/launcher/test_extension_adequacy_patch.py @@ -4,9 +4,7 @@ import pytest from antarest.core.config import Config, StorageConfig -from antarest.launcher.extensions.adequacy_patch.extension import ( - AdequacyPatchExtension, -) +from antarest.launcher.extensions.adequacy_patch.extension import AdequacyPatchExtension from tests.helpers import with_db_context diff --git a/tests/launcher/test_local_launcher.py b/tests/launcher/test_local_launcher.py index 9fc43f40e4..c6a66ccc9c 100644 --- a/tests/launcher/test_local_launcher.py +++ b/tests/launcher/test_local_launcher.py @@ -11,9 +11,7 @@ from antarest.core.persistence import Base from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware from antarest.launcher.adapters.abstractlauncher import LauncherInitException -from antarest.launcher.adapters.local_launcher.local_launcher import ( - LocalLauncher, -) +from antarest.launcher.adapters.local_launcher.local_launcher import LocalLauncher from antarest.launcher.model import JobStatus, LauncherParametersDTO diff --git a/tests/launcher/test_service.py b/tests/launcher/test_service.py index 0eede5320f..955661e49b 100644 --- a/tests/launcher/test_service.py +++ b/tests/launcher/test_service.py @@ -11,32 +11,16 @@ import pytest from sqlalchemy import create_engine -from antarest.core.config import ( - Config, - LauncherConfig, - LocalConfig, - SlurmConfig, - StorageConfig, -) +from antarest.core.config import Config, LauncherConfig, LocalConfig, SlurmConfig, StorageConfig from antarest.core.exceptions import StudyNotFoundError -from antarest.core.filetransfer.model import ( - FileDownload, - FileDownloadDTO, - FileDownloadTaskDTO, -) +from antarest.core.filetransfer.model import FileDownload, FileDownloadDTO, FileDownloadTaskDTO from antarest.core.interfaces.eventbus import Event, EventType from antarest.core.jwt import DEFAULT_ADMIN_USER, JWTUser from antarest.core.model import PermissionInfo from antarest.core.requests import RequestParameters, UserHasNotPermissionError from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware from antarest.dbmodel import Base -from antarest.launcher.model import ( - JobLog, - JobLogType, - JobResult, - JobStatus, - LogType, -) +from antarest.launcher.model import JobLog, JobLogType, JobResult, JobStatus, LogType from antarest.launcher.service import ( EXECUTION_INFO_FILE, LAUNCHER_PARAM_NAME_SUFFIX, diff --git a/tests/launcher/test_web.py b/tests/launcher/test_web.py index 54754b694c..6baab61941 100644 --- a/tests/launcher/test_web.py +++ b/tests/launcher/test_web.py @@ -12,13 +12,7 @@ from antarest.core.requests import RequestParameters from antarest.core.roles import RoleType from antarest.launcher.main import build_launcher -from antarest.launcher.model import ( - JobResult, - JobResultDTO, - JobStatus, - LauncherParametersDTO, - LogType, -) +from antarest.launcher.model import JobResult, JobResultDTO, JobStatus, LauncherParametersDTO, LogType ADMIN = JWTUser( id=1, diff --git a/tests/login/test_repository.py b/tests/login/test_repository.py index bdd282fb56..a52e82c6ba 100644 --- a/tests/login/test_repository.py +++ b/tests/login/test_repository.py @@ -5,22 +5,8 @@ from antarest.core.config import Config, SecurityConfig from antarest.core.persistence import Base from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware, db -from antarest.login.model import ( - Bot, - Group, - Password, - Role, - RoleType, - User, - UserLdap, -) -from antarest.login.repository import ( - BotRepository, - GroupRepository, - RoleRepository, - UserLdapRepository, - UserRepository, -) +from antarest.login.model import Bot, Group, Password, Role, RoleType, User, UserLdap +from antarest.login.repository import BotRepository, GroupRepository, RoleRepository, UserLdapRepository, UserRepository @pytest.mark.unit_test diff --git a/tests/matrixstore/conftest.py b/tests/matrixstore/conftest.py index 9567925b97..c8aaa2202e 100644 --- a/tests/matrixstore/conftest.py +++ b/tests/matrixstore/conftest.py @@ -2,11 +2,7 @@ import pytest -from antarest.matrixstore.repository import ( - MatrixContentRepository, - MatrixDataSetRepository, - MatrixRepository, -) +from antarest.matrixstore.repository import MatrixContentRepository, MatrixDataSetRepository, MatrixRepository from antarest.matrixstore.service import MatrixService diff --git a/tests/matrixstore/test_matrix_editor.py b/tests/matrixstore/test_matrix_editor.py index 8f5022b4d0..14c05e0cde 100644 --- a/tests/matrixstore/test_matrix_editor.py +++ b/tests/matrixstore/test_matrix_editor.py @@ -3,12 +3,7 @@ import pytest from pydantic import ValidationError -from antarest.matrixstore.matrix_editor import ( - OPERATIONS, - MatrixEditInstruction, - MatrixSlice, - Operation, -) +from antarest.matrixstore.matrix_editor import OPERATIONS, MatrixEditInstruction, MatrixSlice, Operation class TestMatrixSlice: diff --git a/tests/matrixstore/test_matrix_garbage_collector.py b/tests/matrixstore/test_matrix_garbage_collector.py index 82f41725fe..0298261f5a 100644 --- a/tests/matrixstore/test_matrix_garbage_collector.py +++ b/tests/matrixstore/test_matrix_garbage_collector.py @@ -7,24 +7,16 @@ from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware, db from antarest.dbmodel import Base -from antarest.matrixstore.matrix_garbage_collector import ( - MatrixGarbageCollector, -) +from antarest.matrixstore.matrix_garbage_collector import MatrixGarbageCollector from antarest.matrixstore.model import MatrixDataSet, MatrixDataSetRelation from antarest.matrixstore.repository import MatrixDataSetRepository from antarest.matrixstore.service import MatrixService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName from antarest.study.storage.variantstudy.model.dbmodel import CommandBlock -from antarest.study.storage.variantstudy.repository import ( - VariantStudyRepository, -) +from antarest.study.storage.variantstudy.repository import VariantStudyRepository @pytest.fixture diff --git a/tests/matrixstore/test_repository.py b/tests/matrixstore/test_repository.py index 745d9d79ff..60d9b7d805 100644 --- a/tests/matrixstore/test_repository.py +++ b/tests/matrixstore/test_repository.py @@ -9,17 +9,8 @@ from antarest.core.utils.fastapi_sqlalchemy import db from antarest.login.model import Group, Password, User from antarest.login.repository import GroupRepository, UserRepository -from antarest.matrixstore.model import ( - Matrix, - MatrixContent, - MatrixDataSet, - MatrixDataSetRelation, -) -from antarest.matrixstore.repository import ( - MatrixContentRepository, - MatrixDataSetRepository, - MatrixRepository, -) +from antarest.matrixstore.model import Matrix, MatrixContent, MatrixDataSet, MatrixDataSetRelation +from antarest.matrixstore.repository import MatrixContentRepository, MatrixDataSetRepository, MatrixRepository class TestMatrixRepository: diff --git a/tests/storage/business/test_antares_configparser.py b/tests/storage/business/test_antares_configparser.py index 8e0d7e0597..a587dc2060 100644 --- a/tests/storage/business/test_antares_configparser.py +++ b/tests/storage/business/test_antares_configparser.py @@ -2,10 +2,7 @@ from pathlib import Path from typing import cast -from antarest.study.storage.antares_configparser import ( - AntaresConfigParser, - AntaresSectionProxy, -) +from antarest.study.storage.antares_configparser import AntaresConfigParser, AntaresSectionProxy def test_configparser(tmp_path: Path): diff --git a/tests/storage/business/test_arealink_manager.py b/tests/storage/business/test_arealink_manager.py index 3638959b64..d3642e779c 100644 --- a/tests/storage/business/test_arealink_manager.py +++ b/tests/storage/business/test_arealink_manager.py @@ -10,20 +10,9 @@ from antarest.core.requests import RequestParameters from antarest.core.utils.fastapi_sqlalchemy import db from antarest.matrixstore.service import SimpleMatrixService -from antarest.study.business.area_management import ( - AreaCreationDTO, - AreaManager, - AreaType, - AreaUI, -) +from antarest.study.business.area_management import AreaCreationDTO, AreaManager, AreaType, AreaUI from antarest.study.business.link_management import LinkInfoDTO, LinkManager -from antarest.study.model import ( - Patch, - PatchArea, - PatchCluster, - RawStudy, - StudyAdditionalData, -) +from antarest.study.model import Patch, PatchArea, PatchCluster, RawStudy, StudyAdditionalData from antarest.study.repository import StudyMetadataRepository from antarest.study.storage.patch_service import PatchService from antarest.study.storage.rawstudy.model.filesystem.config.files import build @@ -35,23 +24,15 @@ Link, ) from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy from antarest.study.storage.variantstudy.model.model import CommandDTO -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService from tests.helpers import with_db_context from tests.storage.business.assets import ASSETS_DIR diff --git a/tests/storage/business/test_config_manager.py b/tests/storage/business/test_config_manager.py index 99cdbce189..250a06c0f2 100644 --- a/tests/storage/business/test_config_manager.py +++ b/tests/storage/business/test_config_manager.py @@ -6,25 +6,15 @@ ThematicTrimmingFormFields, ThematicTrimmingManager, ) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService def test_thematic_trimming_config(): diff --git a/tests/storage/business/test_import.py b/tests/storage/business/test_import.py index d20521bfbb..3ab505a2d1 100644 --- a/tests/storage/business/test_import.py +++ b/tests/storage/business/test_import.py @@ -7,11 +7,7 @@ import pytest from antarest.core.exceptions import BadZipBinary, StudyValidationError -from antarest.study.model import ( - DEFAULT_WORKSPACE_NAME, - RawStudy, - StudyAdditionalData, -) +from antarest.study.model import DEFAULT_WORKSPACE_NAME, RawStudy, StudyAdditionalData from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.utils import fix_study_root diff --git a/tests/storage/business/test_raw_study_service.py b/tests/storage/business/test_raw_study_service.py index a867c90405..eaf31da92d 100644 --- a/tests/storage/business/test_raw_study_service.py +++ b/tests/storage/business/test_raw_study_service.py @@ -11,17 +11,10 @@ import pytest from antarest.core.config import Config, StorageConfig, WorkspaceConfig -from antarest.core.exceptions import ( - StudyDeletionNotAllowed, - StudyNotFoundError, -) +from antarest.core.exceptions import StudyDeletionNotAllowed, StudyNotFoundError from antarest.core.interfaces.cache import CacheConstants from antarest.core.model import PublicMode -from antarest.study.model import ( - DEFAULT_WORKSPACE_NAME, - RawStudy, - StudyAdditionalData, -) +from antarest.study.model import DEFAULT_WORKSPACE_NAME, RawStudy, StudyAdditionalData from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.utils import get_default_workspace_path diff --git a/tests/storage/business/test_study_version_upgrader.py b/tests/storage/business/test_study_version_upgrader.py index 22d0596108..4606706874 100644 --- a/tests/storage/business/test_study_version_upgrader.py +++ b/tests/storage/business/test_study_version_upgrader.py @@ -11,20 +11,10 @@ import pytest from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import ( - DUPLICATE_KEYS, -) -from antarest.study.storage.study_upgrader import ( - UPGRADE_METHODS, - InvalidUpgrade, - upgrade_study, -) -from antarest.study.storage.study_upgrader.upgrader_840 import ( - MAPPING_TRANSMISSION_CAPACITIES, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id +from antarest.study.storage.rawstudy.model.filesystem.root.settings.generaldata import DUPLICATE_KEYS +from antarest.study.storage.study_upgrader import UPGRADE_METHODS, InvalidUpgrade, upgrade_study +from antarest.study.storage.study_upgrader.upgrader_840 import MAPPING_TRANSMISSION_CAPACITIES def test_end_to_end_upgrades(tmp_path: Path): diff --git a/tests/storage/business/test_timeseries_config_manager.py b/tests/storage/business/test_timeseries_config_manager.py index 9ae48e1802..97cc97cb69 100644 --- a/tests/storage/business/test_timeseries_config_manager.py +++ b/tests/storage/business/test_timeseries_config_manager.py @@ -14,18 +14,12 @@ ) from antarest.study.storage.rawstudy.model.filesystem.config.files import build from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService def get_file_study(version: int, tmpdir: Path) -> FileStudy: diff --git a/tests/storage/business/test_variant_study_service.py b/tests/storage/business/test_variant_study_service.py index 42d486bf47..67afef5784 100644 --- a/tests/storage/business/test_variant_study_service.py +++ b/tests/storage/business/test_variant_study_service.py @@ -13,16 +13,9 @@ from antarest.login.model import User from antarest.study.model import DEFAULT_WORKSPACE_NAME, StudyAdditionalData from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.dbmodel import ( - CommandBlock, - VariantStudy, -) -from antarest.study.storage.variantstudy.repository import ( - VariantStudyRepository, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.model.dbmodel import CommandBlock, VariantStudy +from antarest.study.storage.variantstudy.repository import VariantStudyRepository +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService def build_config(study_path: Path): diff --git a/tests/storage/business/test_xpansion_manager.py b/tests/storage/business/test_xpansion_manager.py index 0914657956..5854a63171 100644 --- a/tests/storage/business/test_xpansion_manager.py +++ b/tests/storage/business/test_xpansion_manager.py @@ -23,26 +23,14 @@ from antarest.study.model import RawStudy from antarest.study.storage.rawstudy.model.filesystem.config.files import build from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command_context import CommandContext +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService def make_empty_study(tmpdir: Path, version: int) -> FileStudy: diff --git a/tests/storage/conftest.py b/tests/storage/conftest.py index c5ac7aaaea..aee3675bf0 100644 --- a/tests/storage/conftest.py +++ b/tests/storage/conftest.py @@ -12,13 +12,7 @@ from antarest.core.filetransfer.service import FileTransferManager from antarest.core.model import JSON from antarest.core.requests import RequestParameters -from antarest.core.tasks.model import ( - CustomTaskEventMessages, - TaskDTO, - TaskListFilter, - TaskStatus, - TaskType, -) +from antarest.core.tasks.model import CustomTaskEventMessages, TaskDTO, TaskListFilter, TaskStatus, TaskType from antarest.core.tasks.service import ITaskService, Task diff --git a/tests/storage/integration/conftest.py b/tests/storage/integration/conftest.py index 966730d52b..2e44c31e86 100644 --- a/tests/storage/integration/conftest.py +++ b/tests/storage/integration/conftest.py @@ -7,24 +7,14 @@ from sqlalchemy import create_engine from antarest.core.cache.business.local_chache import LocalCache -from antarest.core.config import ( - CacheConfig, - Config, - SecurityConfig, - StorageConfig, - WorkspaceConfig, -) +from antarest.core.config import CacheConfig, Config, SecurityConfig, StorageConfig, WorkspaceConfig from antarest.core.tasks.service import ITaskService from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware from antarest.dbmodel import Base from antarest.login.model import User from antarest.matrixstore.service import SimpleMatrixService from antarest.study.main import build_study_service -from antarest.study.model import ( - DEFAULT_WORKSPACE_NAME, - RawStudy, - StudyAdditionalData, -) +from antarest.study.model import DEFAULT_WORKSPACE_NAME, RawStudy, StudyAdditionalData from antarest.study.service import StudyService diff --git a/tests/storage/integration/test_STA_mini.py b/tests/storage/integration/test_STA_mini.py index 48da21a18a..103f97ed7a 100644 --- a/tests/storage/integration/test_STA_mini.py +++ b/tests/storage/integration/test_STA_mini.py @@ -19,9 +19,7 @@ from antarest.study.service import StudyService from tests.helpers import assert_study from tests.storage.integration.data.de_details_hourly import de_details_hourly -from tests.storage.integration.data.de_fr_values_hourly import ( - de_fr_values_hourly, -) +from tests.storage.integration.data.de_fr_values_hourly import de_fr_values_hourly ADMIN = JWTUser( id=1, diff --git a/tests/storage/integration/test_exporter.py b/tests/storage/integration/test_exporter.py index eebd9c2c16..d926e26780 100644 --- a/tests/storage/integration/test_exporter.py +++ b/tests/storage/integration/test_exporter.py @@ -7,12 +7,7 @@ from fastapi import FastAPI from starlette.testclient import TestClient -from antarest.core.config import ( - Config, - SecurityConfig, - StorageConfig, - WorkspaceConfig, -) +from antarest.core.config import Config, SecurityConfig, StorageConfig, WorkspaceConfig from antarest.core.filetransfer.model import FileDownloadTaskDTO from antarest.core.jwt import DEFAULT_ADMIN_USER from antarest.core.requests import RequestParameters @@ -20,13 +15,8 @@ from antarest.study.main import build_study_service from antarest.study.model import DEFAULT_WORKSPACE_NAME, RawStudy from antarest.study.storage.utils import export_study_flat -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) -from tests.storage.conftest import ( - SimpleFileTransferManager, - SimpleSyncTaskService, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants +from tests.storage.conftest import SimpleFileTransferManager, SimpleSyncTaskService def assert_url_content( diff --git a/tests/storage/rawstudies/test_factory.py b/tests/storage/rawstudies/test_factory.py index 9fa4051c2c..a10d4f3b05 100644 --- a/tests/storage/rawstudies/test_factory.py +++ b/tests/storage/rawstudies/test_factory.py @@ -3,18 +3,10 @@ from antarest.core.interfaces.cache import CacheConstants from antarest.study.storage.rawstudy.model.filesystem.config.files import build -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfigDTO, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - StudyFactory, -) -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfigDTO +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.factory import StudyFactory +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree def test_renewable_subtree(): diff --git a/tests/storage/repository/antares_io/reader/test_ini_reader.py b/tests/storage/repository/antares_io/reader/test_ini_reader.py index 0782447f6f..83b78c86b6 100644 --- a/tests/storage/repository/antares_io/reader/test_ini_reader.py +++ b/tests/storage/repository/antares_io/reader/test_ini_reader.py @@ -4,9 +4,7 @@ import pytest from antarest.study.storage.rawstudy.io.reader import IniReader -from antarest.study.storage.rawstudy.io.reader.ini_reader import ( - MultipleSameKeysIniReader, -) +from antarest.study.storage.rawstudy.io.reader.ini_reader import MultipleSameKeysIniReader class TestIniReader: diff --git a/tests/storage/repository/filesystem/config/test_config_files.py b/tests/storage/repository/filesystem/config/test_config_files.py index 779720a1d7..7199c4bfda 100644 --- a/tests/storage/repository/filesystem/config/test_config_files.py +++ b/tests/storage/repository/filesystem/config/test_config_files.py @@ -21,10 +21,7 @@ Link, Simulation, ) -from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import ( - STStorageConfig, - STStorageGroup, -) +from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import STStorageConfig, STStorageGroup from tests.storage.business.assets import ASSETS_DIR diff --git a/tests/storage/repository/filesystem/config/test_files.py b/tests/storage/repository/filesystem/config/test_files.py index c59848078f..719e9fc085 100644 --- a/tests/storage/repository/filesystem/config/test_files.py +++ b/tests/storage/repository/filesystem/config/test_files.py @@ -4,15 +4,9 @@ import pytest -from antarest.study.storage.rawstudy.model.filesystem.config.exceptions import ( - SimulationParsingError, -) -from antarest.study.storage.rawstudy.model.filesystem.config.files import ( - parse_simulation_zip, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Simulation, -) +from antarest.study.storage.rawstudy.model.filesystem.config.exceptions import SimulationParsingError +from antarest.study.storage.rawstudy.model.filesystem.config.files import parse_simulation_zip +from antarest.study.storage.rawstudy.model.filesystem.config.model import Simulation PARSE_SIMULATION_NAME = "antarest.study.storage.rawstudy.model.filesystem.config.files.parse_simulation" diff --git a/tests/storage/repository/filesystem/config/test_utils.py b/tests/storage/repository/filesystem/config/test_utils.py index 59ceb1febf..617bc05ff0 100644 --- a/tests/storage/repository/filesystem/config/test_utils.py +++ b/tests/storage/repository/filesystem/config/test_utils.py @@ -2,9 +2,7 @@ import pytest -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id VALID_CHARS = "azAZ09_-(),&" diff --git a/tests/storage/repository/filesystem/matrix/head_writer_test.py b/tests/storage/repository/filesystem/matrix/head_writer_test.py index 4773848f39..82c405989d 100644 --- a/tests/storage/repository/filesystem/matrix/head_writer_test.py +++ b/tests/storage/repository/filesystem/matrix/head_writer_test.py @@ -1,7 +1,4 @@ -from antarest.study.storage.rawstudy.model.filesystem.matrix.head_writer import ( - AreaHeadWriter, - LinkHeadWriter, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.head_writer import AreaHeadWriter, LinkHeadWriter def test_area(): diff --git a/tests/storage/repository/filesystem/matrix/input_series_matrix_test.py b/tests/storage/repository/filesystem/matrix/input_series_matrix_test.py index 59bfcb0a17..496a3b3515 100644 --- a/tests/storage/repository/filesystem/matrix/input_series_matrix_test.py +++ b/tests/storage/repository/filesystem/matrix/input_series_matrix_test.py @@ -1,12 +1,8 @@ from pathlib import Path from unittest.mock import Mock -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix def test_get(tmp_path: Path) -> None: diff --git a/tests/storage/repository/filesystem/matrix/output_series_matrix_test.py b/tests/storage/repository/filesystem/matrix/output_series_matrix_test.py index ccf7c2bb82..ec1020365d 100644 --- a/tests/storage/repository/filesystem/matrix/output_series_matrix_test.py +++ b/tests/storage/repository/filesystem/matrix/output_series_matrix_test.py @@ -3,18 +3,10 @@ import pandas as pd -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.head_writer import ( - AreaHeadWriter, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - OutputSeriesMatrix, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.matrix.head_writer import AreaHeadWriter +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import OutputSeriesMatrix MATRIX_DAILY_DATA = """\ DE area va hourly diff --git a/tests/storage/repository/filesystem/matrix/test_matrix_node.py b/tests/storage/repository/filesystem/matrix/test_matrix_node.py index 35aa1d3dc8..50cc53b5c2 100644 --- a/tests/storage/repository/filesystem/matrix/test_matrix_node.py +++ b/tests/storage/repository/filesystem/matrix/test_matrix_node.py @@ -6,16 +6,9 @@ import pandas as pd # type: ignore from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, - MatrixNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency, MatrixNode MOCK_MATRIX_JSON = { "index": ["1", "2"], diff --git a/tests/storage/repository/filesystem/root/input/hydro/common/capacity/test_capacity.py b/tests/storage/repository/filesystem/root/input/hydro/common/capacity/test_capacity.py index cc06d45535..cedf260840 100644 --- a/tests/storage/repository/filesystem/root/input/hydro/common/capacity/test_capacity.py +++ b/tests/storage/repository/filesystem/root/input/hydro/common/capacity/test_capacity.py @@ -6,22 +6,11 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.common.capacity import ( - capacity, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.common.capacity import capacity # noinspection SpellCheckingInspection BEFORE_650 = { diff --git a/tests/storage/repository/filesystem/root/input/hydro/series/area/test_area.py b/tests/storage/repository/filesystem/root/input/hydro/series/area/test_area.py index 394e94d644..312f1d9b2a 100644 --- a/tests/storage/repository/filesystem/root/input/hydro/series/area/test_area.py +++ b/tests/storage/repository/filesystem/root/input/hydro/series/area/test_area.py @@ -6,26 +6,16 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.matrix.constants import ( default_scenario_daily, default_scenario_hourly, default_scenario_monthly, ) -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.series.area import ( - area, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.root.input.hydro.series.area import area BEFORE_650 = { "mod": { diff --git a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_area.py b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_area.py index c0c07fd1a9..d387cbc2e6 100644 --- a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_area.py +++ b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_area.py @@ -6,21 +6,11 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - AreaOutputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import ( - area, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import AreaOutputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import area # noinspection SpellCheckingInspection MC_ALL_TRUE = { diff --git a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_binding_const.py b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_binding_const.py index 17ec74d716..a1a274eb28 100644 --- a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_binding_const.py +++ b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_binding_const.py @@ -6,21 +6,13 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( BindingConstraintOutputSeriesMatrix, ) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import ( - binding_const, -) +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import binding_const # noinspection SpellCheckingInspection NOMINAL_CASE = { diff --git a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_link.py b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_link.py index 6063d23d11..545d4e6bb6 100644 --- a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_link.py +++ b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_link.py @@ -6,21 +6,11 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - LinkOutputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import ( - link, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import LinkOutputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import link # noinspection SpellCheckingInspection MC_ALL_TRUE = { diff --git a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_set.py b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_set.py index 03adcbe76d..981b6eddee 100644 --- a/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_set.py +++ b/tests/storage/repository/filesystem/root/output/simulation/mode/common/test_set.py @@ -6,21 +6,11 @@ from antarest.matrixstore.service import ISimpleMatrixService from antarest.matrixstore.uri_resolver_service import UriResolverService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import ( - MatrixFrequency, -) -from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import ( - AreaOutputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import ( - set, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency +from antarest.study.storage.rawstudy.model.filesystem.matrix.output_series_matrix import AreaOutputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common import set # noinspection SpellCheckingInspection MC_ALL_TRUE = { diff --git a/tests/storage/repository/filesystem/special_node/input_areas_list_test.py b/tests/storage/repository/filesystem/special_node/input_areas_list_test.py index c8315bbd28..0616db9a5c 100644 --- a/tests/storage/repository/filesystem/special_node/input_areas_list_test.py +++ b/tests/storage/repository/filesystem/special_node/input_areas_list_test.py @@ -1,13 +1,8 @@ from pathlib import Path from unittest.mock import Mock -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.list import ( - InputAreasList, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.list import InputAreasList def test(tmp_path: Path): diff --git a/tests/storage/repository/filesystem/test_bucket_node.py b/tests/storage/repository/filesystem/test_bucket_node.py index 4a7cbf9e97..ba036560f8 100644 --- a/tests/storage/repository/filesystem/test_bucket_node.py +++ b/tests/storage/repository/filesystem/test_bucket_node.py @@ -1,19 +1,10 @@ from pathlib import Path from unittest.mock import Mock -from antarest.study.storage.rawstudy.model.filesystem.bucket_node import ( - BucketNode, - RegisteredFile, -) -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.bucket_node import BucketNode, RegisteredFile +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode def build_bucket(tmp: Path) -> Path: diff --git a/tests/storage/repository/filesystem/test_folder_node.py b/tests/storage/repository/filesystem/test_folder_node.py index ac2ff6f2f4..2a0a858958 100644 --- a/tests/storage/repository/filesystem/test_folder_node.py +++ b/tests/storage/repository/filesystem/test_folder_node.py @@ -3,23 +3,12 @@ import pytest -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode from antarest.study.storage.rawstudy.model.filesystem.inode import INode -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) -from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.list import ( - InputAreasList, -) -from tests.storage.repository.filesystem.utils import ( - TestMiddleNode, - TestSubNode, -) +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode +from antarest.study.storage.rawstudy.model.filesystem.root.input.areas.list import InputAreasList +from tests.storage.repository.filesystem.utils import TestMiddleNode, TestSubNode def build_tree() -> INode: diff --git a/tests/storage/repository/filesystem/test_ini_file_node.py b/tests/storage/repository/filesystem/test_ini_file_node.py index 1140183489..aa084ed3fd 100644 --- a/tests/storage/repository/filesystem/test_ini_file_node.py +++ b/tests/storage/repository/filesystem/test_ini_file_node.py @@ -7,12 +7,8 @@ import pytest from antarest.core.model import JSON -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode def build_dataset(study_dir: Path) -> Tuple[Path, JSON]: diff --git a/tests/storage/repository/filesystem/test_lazy_node.py b/tests/storage/repository/filesystem/test_lazy_node.py index 4a276a7169..be68573ab3 100644 --- a/tests/storage/repository/filesystem/test_lazy_node.py +++ b/tests/storage/repository/filesystem/test_lazy_node.py @@ -2,12 +2,8 @@ from typing import List, Optional from unittest.mock import Mock -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.lazy_node import LazyNode diff --git a/tests/storage/repository/filesystem/test_raw_file_node.py b/tests/storage/repository/filesystem/test_raw_file_node.py index a436200e44..f3c3b56078 100644 --- a/tests/storage/repository/filesystem/test_raw_file_node.py +++ b/tests/storage/repository/filesystem/test_raw_file_node.py @@ -1,12 +1,8 @@ from pathlib import Path from unittest.mock import Mock -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode def test_get(tmp_path: Path) -> None: diff --git a/tests/storage/repository/filesystem/test_scenariobuilder.py b/tests/storage/repository/filesystem/test_scenariobuilder.py index f078b7844d..8ee9ed7e1b 100644 --- a/tests/storage/repository/filesystem/test_scenariobuilder.py +++ b/tests/storage/repository/filesystem/test_scenariobuilder.py @@ -1,14 +1,8 @@ from pathlib import Path from unittest.mock import Mock -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - Area, - Cluster, - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.root.settings.scenariobuilder import ( - ScenarioBuilder, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import Area, Cluster, FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.root.settings.scenariobuilder import ScenarioBuilder content = """ [Default Ruleset] diff --git a/tests/storage/repository/filesystem/test_ts_numbers_vector.py b/tests/storage/repository/filesystem/test_ts_numbers_vector.py index b59d932e0c..58ef3bf37c 100644 --- a/tests/storage/repository/filesystem/test_ts_numbers_vector.py +++ b/tests/storage/repository/filesystem/test_ts_numbers_vector.py @@ -1,9 +1,7 @@ from pathlib import Path from unittest.mock import Mock -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.ts_numbers.ts_numbers_data import ( TsNumbersVector, ) diff --git a/tests/storage/repository/filesystem/utils.py b/tests/storage/repository/filesystem/utils.py index 531af2fdfe..2c412cb0a6 100644 --- a/tests/storage/repository/filesystem/utils.py +++ b/tests/storage/repository/filesystem/utils.py @@ -2,15 +2,9 @@ from typing import List, Optional from zipfile import ZipFile -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - FolderNode, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer +from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE, INode diff --git a/tests/storage/repository/test_study.py b/tests/storage/repository/test_study.py index 8610a73d06..03293ce16c 100644 --- a/tests/storage/repository/test_study.py +++ b/tests/storage/repository/test_study.py @@ -6,13 +6,7 @@ from antarest.core.interfaces.cache import CacheConstants from antarest.login.model import Group, User from antarest.study.common.utils import get_study_information -from antarest.study.model import ( - DEFAULT_WORKSPACE_NAME, - PublicMode, - RawStudy, - Study, - StudyContentStatus, -) +from antarest.study.model import DEFAULT_WORKSPACE_NAME, PublicMode, RawStudy, Study, StudyContentStatus from antarest.study.repository import StudyMetadataRepository from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy from tests.helpers import with_db_context diff --git a/tests/storage/test_service.py b/tests/storage/test_service.py index a62a2a2ed8..ad02a53fa8 100644 --- a/tests/storage/test_service.py +++ b/tests/storage/test_service.py @@ -44,12 +44,7 @@ TimeSeriesData, ) from antarest.study.repository import StudyMetadataRepository -from antarest.study.service import ( - MAX_MISSING_STUDY_TIMEOUT, - StudyService, - StudyUpgraderTask, - UserHasNotPermissionError, -) +from antarest.study.service import MAX_MISSING_STUDY_TIMEOUT, StudyService, StudyUpgraderTask, UserHasNotPermissionError from antarest.study.storage.patch_service import PatchService from antarest.study.storage.rawstudy.model.filesystem.config.model import ( Area, @@ -59,31 +54,17 @@ Simulation, ) from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import ( - IniFileNode, -) +from antarest.study.storage.rawstudy.model.filesystem.ini_file_node import IniFileNode from antarest.study.storage.rawstudy.model.filesystem.inode import INode -from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import ( - InputSeriesMatrix, -) -from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import ( - RawFileNode, -) -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.matrix.input_series_matrix import InputSeriesMatrix +from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.utils import assert_permission, study_matcher -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService from antarest.worker.archive_worker import ArchiveTaskArgs from tests.helpers import with_db_context diff --git a/tests/storage/web/test_studies_bp.py b/tests/storage/web/test_studies_bp.py index ba838f8cba..5c55027a5c 100644 --- a/tests/storage/web/test_studies_bp.py +++ b/tests/storage/web/test_studies_bp.py @@ -11,17 +11,9 @@ from markupsafe import Markup from starlette.testclient import TestClient -from antarest.core.config import ( - Config, - SecurityConfig, - StorageConfig, - WorkspaceConfig, -) +from antarest.core.config import Config, SecurityConfig, StorageConfig, WorkspaceConfig from antarest.core.exceptions import UrlNotMatchJsonDataError -from antarest.core.filetransfer.model import ( - FileDownloadDTO, - FileDownloadTaskDTO, -) +from antarest.core.filetransfer.model import FileDownloadDTO, FileDownloadTaskDTO from antarest.core.jwt import JWTGroup, JWTUser from antarest.core.requests import RequestParameters from antarest.core.roles import RoleType diff --git a/tests/study/business/test_allocation_manager.py b/tests/study/business/test_allocation_manager.py index 0983a066d9..b0af1a8157 100644 --- a/tests/study/business/test_allocation_manager.py +++ b/tests/study/business/test_allocation_manager.py @@ -17,24 +17,14 @@ from antarest.study.business.area_management import AreaInfoDTO, AreaType from antarest.study.model import RawStudy, Study, StudyContentStatus from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService class TestAllocationField: diff --git a/tests/study/business/test_correlation_manager.py b/tests/study/business/test_correlation_manager.py index 715f2a91ee..b933dc25a2 100644 --- a/tests/study/business/test_correlation_manager.py +++ b/tests/study/business/test_correlation_manager.py @@ -17,24 +17,14 @@ ) from antarest.study.model import RawStudy, Study, StudyContentStatus from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService class TestCorrelationField: diff --git a/tests/study/business/test_district_manager.py b/tests/study/business/test_district_manager.py index d9b8956158..ccc54b4e48 100644 --- a/tests/study/business/test_district_manager.py +++ b/tests/study/business/test_district_manager.py @@ -2,11 +2,7 @@ import pytest -from antarest.core.exceptions import ( - AreaNotFound, - DistrictAlreadyExist, - DistrictNotFound, -) +from antarest.core.exceptions import AreaNotFound, DistrictAlreadyExist, DistrictNotFound from antarest.study.business.district_manager import ( DistrictCreationDTO, DistrictInfoDTO, @@ -14,31 +10,17 @@ DistrictUpdateDTO, ) from antarest.study.model import Study -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - DistrictSet, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import DistrictSet from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command.create_district import ( - CreateDistrict, -) -from antarest.study.storage.variantstudy.model.command.remove_district import ( - RemoveDistrict, -) -from antarest.study.storage.variantstudy.model.command.update_district import ( - UpdateDistrict, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.model.command.create_district import CreateDistrict +from antarest.study.storage.variantstudy.model.command.remove_district import RemoveDistrict +from antarest.study.storage.variantstudy.model.command.update_district import UpdateDistrict +from antarest.study.storage.variantstudy.model.command_context import CommandContext +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService # noinspection SpellCheckingInspection EXECUTE_OR_ADD_COMMANDS = ( diff --git a/tests/study/business/test_matrix_management.py b/tests/study/business/test_matrix_management.py index 94dbb7b590..2b81ba8be1 100644 --- a/tests/study/business/test_matrix_management.py +++ b/tests/study/business/test_matrix_management.py @@ -3,11 +3,7 @@ import pandas as pd import pytest -from antarest.matrixstore.matrix_editor import ( - MatrixEditInstruction, - MatrixSlice, - Operation, -) +from antarest.matrixstore.matrix_editor import MatrixEditInstruction, MatrixSlice, Operation from antarest.matrixstore.model import MatrixData from antarest.study.business.matrix_management import ( MatrixEditError, diff --git a/tests/study/business/test_st_storage_manager.py b/tests/study/business/test_st_storage_manager.py index e20e98a219..18a68e8191 100644 --- a/tests/study/business/test_st_storage_manager.py +++ b/tests/study/business/test_st_storage_manager.py @@ -20,22 +20,14 @@ from antarest.study.business.st_storage_manager import STStorageManager from antarest.study.model import RawStudy, Study, StudyContentStatus from antarest.study.storage.rawstudy.io.reader import IniReader -from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import ( - STStorageGroup, -) +from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import STStorageGroup from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.model.command_context import CommandContext +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService # noinspection SpellCheckingInspection LIST_INI = """ diff --git a/tests/study/storage/rawstudy/test_raw_study_service.py b/tests/study/storage/rawstudy/test_raw_study_service.py index 466dfe18df..ed80639369 100644 --- a/tests/study/storage/rawstudy/test_raw_study_service.py +++ b/tests/study/storage/rawstudy/test_raw_study_service.py @@ -14,24 +14,13 @@ from antarest.study.business.utils import execute_or_add_commands from antarest.study.model import RawStudy, StudyAdditionalData from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import ( - STStorageConfig, - STStorageGroup, -) +from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import STStorageConfig, STStorageGroup from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_st_storage import ( - CreateSTStorage, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_st_storage import CreateSTStorage +from antarest.study.storage.variantstudy.model.command_context import CommandContext from tests.helpers import with_db_context diff --git a/tests/study/storage/test_abstract_storage_service.py b/tests/study/storage/test_abstract_storage_service.py index 4d3a6f3265..49b03cb8d9 100644 --- a/tests/study/storage/test_abstract_storage_service.py +++ b/tests/study/storage/test_abstract_storage_service.py @@ -11,17 +11,10 @@ from antarest.core.utils.fastapi_sqlalchemy import db from antarest.login.model import Group, User from antarest.study.model import Study -from antarest.study.storage.abstract_storage_service import ( - AbstractStorageService, -) +from antarest.study.storage.abstract_storage_service import AbstractStorageService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfigDTO, -) -from antarest.study.storage.rawstudy.model.filesystem.factory import ( - FileStudy, - StudyFactory, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfigDTO +from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy, StudyFactory from tests.helpers import with_db_context diff --git a/tests/study/storage/variantstudy/test_variant_study_service.py b/tests/study/storage/variantstudy/test_variant_study_service.py index 2f79f3f218..83a2963ded 100644 --- a/tests/study/storage/variantstudy/test_variant_study_service.py +++ b/tests/study/storage/variantstudy/test_variant_study_service.py @@ -15,27 +15,14 @@ from antarest.study.business.utils import execute_or_add_commands from antarest.study.model import RawStudy, StudyAdditionalData from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import ( - STStorageConfig, - STStorageGroup, -) +from antarest.study.storage.rawstudy.model.filesystem.config.st_storage import STStorageConfig, STStorageGroup from antarest.study.storage.rawstudy.raw_study_service import RawStudyService from antarest.study.storage.storage_service import StudyStorageService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_st_storage import ( - CreateSTStorage, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - VariantStudyService, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_st_storage import CreateSTStorage +from antarest.study.storage.variantstudy.model.command_context import CommandContext +from antarest.study.storage.variantstudy.variant_study_service import VariantStudyService from tests.helpers import with_db_context # noinspection SpellCheckingInspection diff --git a/tests/variantstudy/conftest.py b/tests/variantstudy/conftest.py index 7c77d0707c..efc9c7bf92 100644 --- a/tests/variantstudy/conftest.py +++ b/tests/variantstudy/conftest.py @@ -10,23 +10,13 @@ from antarest.matrixstore.uri_resolver_service import UriResolverService from antarest.study.repository import StudyMetadataRepository from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - FileStudyTreeConfig, -) -from antarest.study.storage.rawstudy.model.filesystem.context import ( - ContextServer, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig +from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command_context import CommandContext from tests.variantstudy.assets import ASSETS_DIR diff --git a/tests/variantstudy/model/command/test_create_area.py b/tests/variantstudy/model/command/test_create_area.py index 228561e694..a66453b9e0 100644 --- a/tests/variantstudy/model/command/test_create_area.py +++ b/tests/variantstudy/model/command/test_create_area.py @@ -3,24 +3,13 @@ import pytest -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - ENR_MODELLING, - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import ENR_MODELLING, transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestCreateArea: diff --git a/tests/variantstudy/model/command/test_create_cluster.py b/tests/variantstudy/model/command/test_create_cluster.py index 8f77e31171..dcc45f3c5b 100644 --- a/tests/variantstudy/model/command/test_create_cluster.py +++ b/tests/variantstudy/model/command/test_create_cluster.py @@ -1,30 +1,14 @@ import configparser -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_cluster import ( - CreateCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_cluster import ( - RemoveCluster, -) -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_cluster import CreateCluster +from antarest.study.storage.variantstudy.model.command.remove_cluster import RemoveCluster +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestCreateCluster: diff --git a/tests/variantstudy/model/command/test_create_link.py b/tests/variantstudy/model/command/test_create_link.py index 70169ba5c9..5073d174b4 100644 --- a/tests/variantstudy/model/command/test_create_link.py +++ b/tests/variantstudy/model/command/test_create_link.py @@ -3,40 +3,19 @@ import pytest from pydantic import ValidationError -from antarest.study.common.default_values import ( - FilteringOptions, - LinkProperties, -) +from antarest.study.common.default_values import FilteringOptions, LinkProperties from antarest.study.storage.rawstudy.io.reader import IniReader -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_link import ( - RemoveLink, -) -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_link import RemoveLink +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestCreateLink: diff --git a/tests/variantstudy/model/command/test_create_renewables_cluster.py b/tests/variantstudy/model/command/test_create_renewables_cluster.py index 811893c966..c74d422f66 100644 --- a/tests/variantstudy/model/command/test_create_renewables_cluster.py +++ b/tests/variantstudy/model/command/test_create_renewables_cluster.py @@ -1,28 +1,13 @@ import configparser -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - ENR_MODELLING, - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import ENR_MODELLING, transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import ( - CreateRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import ( - RemoveRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import CreateRenewablesCluster +from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import RemoveRenewablesCluster +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestCreateRenewablesCluster: diff --git a/tests/variantstudy/model/command/test_create_st_storage.py b/tests/variantstudy/model/command/test_create_st_storage.py index 0e670f0ae0..934690e87a 100644 --- a/tests/variantstudy/model/command/test_create_st_storage.py +++ b/tests/variantstudy/model/command/test_create_st_storage.py @@ -4,34 +4,20 @@ import pytest from pydantic import ValidationError -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.study_upgrader import upgrade_study -from antarest.study.storage.variantstudy.business.utils import ( - strip_matrix_protocol, -) -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) +from antarest.study.storage.variantstudy.business.utils import strip_matrix_protocol +from antarest.study.storage.variantstudy.model.command.common import CommandName +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea from antarest.study.storage.variantstudy.model.command.create_st_storage import ( REQUIRED_VERSION, CreateSTStorage, STStorageConfig, ) -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/tests/variantstudy/model/command/test_manage_binding_constraints.py b/tests/variantstudy/model/command/test_manage_binding_constraints.py index 5a2184bb26..df2f39b9f9 100644 --- a/tests/variantstudy/model/command/test_manage_binding_constraints.py +++ b/tests/variantstudy/model/command/test_manage_binding_constraints.py @@ -2,43 +2,18 @@ from antarest.study.storage.rawstudy.io.reader import IniReader from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_extractor import ( - CommandExtractor, -) -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.common import ( - BindingConstraintOperator, - TimeStep, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_binding_constraint import ( - CreateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.create_cluster import ( - CreateCluster, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_binding_constraint import ( - RemoveBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.remove_link import ( - RemoveLink, -) -from antarest.study.storage.variantstudy.model.command.update_binding_constraint import ( - UpdateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.command_extractor import CommandExtractor +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.common import BindingConstraintOperator, TimeStep +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_binding_constraint import CreateBindingConstraint +from antarest.study.storage.variantstudy.model.command.create_cluster import CreateCluster +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_binding_constraint import RemoveBindingConstraint +from antarest.study.storage.variantstudy.model.command.remove_link import RemoveLink +from antarest.study.storage.variantstudy.model.command.update_binding_constraint import UpdateBindingConstraint +from antarest.study.storage.variantstudy.model.command_context import CommandContext # noinspection SpellCheckingInspection diff --git a/tests/variantstudy/model/command/test_manage_district.py b/tests/variantstudy/model/command/test_manage_district.py index 7890e65b12..9e69d5144e 100644 --- a/tests/variantstudy/model/command/test_manage_district.py +++ b/tests/variantstudy/model/command/test_manage_district.py @@ -1,35 +1,16 @@ from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader from antarest.study.storage.rawstudy.model.filesystem.config.files import build -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_district import ( - CreateDistrict, - DistrictBaseFilter, -) +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_district import CreateDistrict, DistrictBaseFilter from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_district import ( - RemoveDistrict, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command.update_district import ( - UpdateDistrict, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_district import RemoveDistrict +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command.update_district import UpdateDistrict +from antarest.study.storage.variantstudy.model.command_context import CommandContext def test_manage_district( diff --git a/tests/variantstudy/model/command/test_remove_area.py b/tests/variantstudy/model/command/test_remove_area.py index 8da627b683..b0f28e8bdf 100644 --- a/tests/variantstudy/model/command/test_remove_area.py +++ b/tests/variantstudy/model/command/test_remove_area.py @@ -1,43 +1,19 @@ import pytest -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.study_upgrader import upgrade_study -from antarest.study.storage.variantstudy.model.command.common import ( - BindingConstraintOperator, - TimeStep, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_binding_constraint import ( - CreateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.create_cluster import ( - CreateCluster, -) -from antarest.study.storage.variantstudy.model.command.create_district import ( - CreateDistrict, - DistrictBaseFilter, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) +from antarest.study.storage.variantstudy.model.command.common import BindingConstraintOperator, TimeStep +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_binding_constraint import CreateBindingConstraint +from antarest.study.storage.variantstudy.model.command.create_cluster import CreateCluster +from antarest.study.storage.variantstudy.model.command.create_district import CreateDistrict, DistrictBaseFilter +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink from antarest.study.storage.variantstudy.model.command.icommand import ICommand -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_district import ( - RemoveDistrict, -) -from antarest.study.storage.variantstudy.model.command.remove_link import ( - RemoveLink, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_district import RemoveDistrict +from antarest.study.storage.variantstudy.model.command.remove_link import RemoveLink +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestRemoveArea: diff --git a/tests/variantstudy/model/command/test_remove_cluster.py b/tests/variantstudy/model/command/test_remove_cluster.py index 8f2c74314b..2f45827949 100644 --- a/tests/variantstudy/model/command/test_remove_cluster.py +++ b/tests/variantstudy/model/command/test_remove_cluster.py @@ -1,31 +1,14 @@ from checksumdir import dirhash -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.common import ( - BindingConstraintOperator, - TimeStep, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_binding_constraint import ( - CreateBindingConstraint, -) -from antarest.study.storage.variantstudy.model.command.create_cluster import ( - CreateCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_cluster import ( - RemoveCluster, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.common import BindingConstraintOperator, TimeStep +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_binding_constraint import CreateBindingConstraint +from antarest.study.storage.variantstudy.model.command.create_cluster import CreateCluster +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_cluster import RemoveCluster +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestRemoveCluster: diff --git a/tests/variantstudy/model/command/test_remove_link.py b/tests/variantstudy/model/command/test_remove_link.py index 324dc4c94b..f37270ec4c 100644 --- a/tests/variantstudy/model/command/test_remove_link.py +++ b/tests/variantstudy/model/command/test_remove_link.py @@ -8,28 +8,14 @@ from checksumdir import dirhash from antarest.study.storage.rawstudy.model.filesystem.config.files import build -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import ( - FileStudyTree, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_link import ( - RemoveLink, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.rawstudy.model.filesystem.root.filestudytree import FileStudyTree +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_link import RemoveLink +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestRemoveLink: diff --git a/tests/variantstudy/model/command/test_remove_renewables_cluster.py b/tests/variantstudy/model/command/test_remove_renewables_cluster.py index 9e0e7efb61..138921397a 100644 --- a/tests/variantstudy/model/command/test_remove_renewables_cluster.py +++ b/tests/variantstudy/model/command/test_remove_renewables_cluster.py @@ -1,25 +1,12 @@ from checksumdir import dirhash -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - ENR_MODELLING, - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import ENR_MODELLING, transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import ( - CreateRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import ( - RemoveRenewablesCluster, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_renewables_cluster import CreateRenewablesCluster +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.remove_renewables_cluster import RemoveRenewablesCluster +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestRemoveRenewablesCluster: diff --git a/tests/variantstudy/model/command/test_remove_st_storage.py b/tests/variantstudy/model/command/test_remove_st_storage.py index 1369890b07..c97e9232fd 100644 --- a/tests/variantstudy/model/command/test_remove_st_storage.py +++ b/tests/variantstudy/model/command/test_remove_st_storage.py @@ -3,27 +3,14 @@ import pytest from pydantic import ValidationError -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy from antarest.study.storage.study_upgrader import upgrade_study -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_st_storage import ( - CreateSTStorage, -) -from antarest.study.storage.variantstudy.model.command.remove_st_storage import ( - REQUIRED_VERSION, - RemoveSTStorage, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_st_storage import CreateSTStorage +from antarest.study.storage.variantstudy.model.command.remove_st_storage import REQUIRED_VERSION, RemoveSTStorage +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/tests/variantstudy/model/command/test_replace_matrix.py b/tests/variantstudy/model/command/test_replace_matrix.py index 0f23c0ef94..6ec4c88ba2 100644 --- a/tests/variantstudy/model/command/test_replace_matrix.py +++ b/tests/variantstudy/model/command/test_replace_matrix.py @@ -1,24 +1,12 @@ from unittest.mock import Mock, patch -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.replace_matrix import ( - ReplaceMatrix, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.replace_matrix import ReplaceMatrix +from antarest.study.storage.variantstudy.model.command_context import CommandContext class TestReplaceMatrix: diff --git a/tests/variantstudy/model/command/test_update_comments.py b/tests/variantstudy/model/command/test_update_comments.py index 5817636b79..77ae7a55a7 100644 --- a/tests/variantstudy/model/command/test_update_comments.py +++ b/tests/variantstudy/model/command/test_update_comments.py @@ -3,21 +3,11 @@ import pytest from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_extractor import ( - CommandExtractor, -) -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.update_comments import ( - UpdateComments, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.command_extractor import CommandExtractor +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.update_comments import UpdateComments +from antarest.study.storage.variantstudy.model.command_context import CommandContext @pytest.mark.unit_test diff --git a/tests/variantstudy/model/command/test_update_config.py b/tests/variantstudy/model/command/test_update_config.py index cc040fb398..08c2af9761 100644 --- a/tests/variantstudy/model/command/test_update_config.py +++ b/tests/variantstudy/model/command/test_update_config.py @@ -4,28 +4,14 @@ import pytest from antarest.study.storage.rawstudy.io.reader import MultipleSameKeysIniReader -from antarest.study.storage.rawstudy.model.filesystem.config.model import ( - transform_name_to_id, -) +from antarest.study.storage.rawstudy.model.filesystem.config.model import transform_name_to_id from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.rawstudy.model.filesystem.folder_node import ( - ChildNotFoundError, -) -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.remove_area import ( - RemoveArea, -) -from antarest.study.storage.variantstudy.model.command.update_config import ( - UpdateConfig, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.rawstudy.model.filesystem.folder_node import ChildNotFoundError +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.remove_area import RemoveArea +from antarest.study.storage.variantstudy.model.command.update_config import UpdateConfig +from antarest.study.storage.variantstudy.model.command_context import CommandContext @pytest.mark.unit_test diff --git a/tests/variantstudy/model/command/test_update_rawfile.py b/tests/variantstudy/model/command/test_update_rawfile.py index 8e8e37be00..8792888659 100644 --- a/tests/variantstudy/model/command/test_update_rawfile.py +++ b/tests/variantstudy/model/command/test_update_rawfile.py @@ -4,15 +4,9 @@ from typing import cast from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy -from antarest.study.storage.variantstudy.business.command_reverter import ( - CommandReverter, -) -from antarest.study.storage.variantstudy.model.command.update_raw_file import ( - UpdateRawFile, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.command_reverter import CommandReverter +from antarest.study.storage.variantstudy.model.command.update_raw_file import UpdateRawFile +from antarest.study.storage.variantstudy.model.command_context import CommandContext def test_update_rawfile( diff --git a/tests/variantstudy/model/test_variant_model.py b/tests/variantstudy/model/test_variant_model.py index 537a33aaae..d8609250b1 100644 --- a/tests/variantstudy/model/test_variant_model.py +++ b/tests/variantstudy/model/test_variant_model.py @@ -11,24 +11,12 @@ from antarest.core.requests import RequestParameters from antarest.core.roles import RoleType from antarest.core.utils.fastapi_sqlalchemy import DBSessionMiddleware, db -from antarest.study.model import ( - DEFAULT_WORKSPACE_NAME, - RawStudy, - StudyAdditionalData, -) +from antarest.study.model import DEFAULT_WORKSPACE_NAME, RawStudy, StudyAdditionalData from antarest.study.storage.variantstudy.command_factory import CommandFactory from antarest.study.storage.variantstudy.model.dbmodel import VariantStudy -from antarest.study.storage.variantstudy.model.model import ( - CommandDTO, - GenerationResultInfoDTO, -) -from antarest.study.storage.variantstudy.repository import ( - VariantStudyRepository, -) -from antarest.study.storage.variantstudy.variant_study_service import ( - SNAPSHOT_RELATIVE_PATH, - VariantStudyService, -) +from antarest.study.storage.variantstudy.model.model import CommandDTO, GenerationResultInfoDTO +from antarest.study.storage.variantstudy.repository import VariantStudyRepository +from antarest.study.storage.variantstudy.variant_study_service import SNAPSHOT_RELATIVE_PATH, VariantStudyService # noinspection SpellCheckingInspection SADMIN = RequestParameters( diff --git a/tests/variantstudy/test_command_factory.py b/tests/variantstudy/test_command_factory.py index 18fc7bb8ca..e04b892959 100644 --- a/tests/variantstudy/test_command_factory.py +++ b/tests/variantstudy/test_command_factory.py @@ -7,13 +7,9 @@ from antarest.matrixstore.service import MatrixService from antarest.study.storage.patch_service import PatchService -from antarest.study.storage.variantstudy.business.matrix_constants_generator import ( - GeneratorMatrixConstants, -) +from antarest.study.storage.variantstudy.business.matrix_constants_generator import GeneratorMatrixConstants from antarest.study.storage.variantstudy.command_factory import CommandFactory -from antarest.study.storage.variantstudy.model.command.common import ( - CommandName, -) +from antarest.study.storage.variantstudy.model.command.common import CommandName from antarest.study.storage.variantstudy.model.command.icommand import ICommand from antarest.study.storage.variantstudy.model.model import CommandDTO diff --git a/tests/variantstudy/test_utils.py b/tests/variantstudy/test_utils.py index 8b92f0e424..c1c2d423a7 100644 --- a/tests/variantstudy/test_utils.py +++ b/tests/variantstudy/test_utils.py @@ -1,15 +1,7 @@ -from antarest.study.storage.variantstudy.business.utils import ( - transform_command_to_dto, -) -from antarest.study.storage.variantstudy.model.command.create_area import ( - CreateArea, -) -from antarest.study.storage.variantstudy.model.command.create_link import ( - CreateLink, -) -from antarest.study.storage.variantstudy.model.command_context import ( - CommandContext, -) +from antarest.study.storage.variantstudy.business.utils import transform_command_to_dto +from antarest.study.storage.variantstudy.model.command.create_area import CreateArea +from antarest.study.storage.variantstudy.model.command.create_link import CreateLink +from antarest.study.storage.variantstudy.model.command_context import CommandContext from antarest.study.storage.variantstudy.model.model import CommandDTO