Skip to content

Commit

Permalink
Cleaned up imports to match the new linting rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigurd-Borge committed Sep 24, 2024
1 parent fd7453e commit f462b74
Show file tree
Hide file tree
Showing 33 changed files with 142 additions and 157 deletions.
6 changes: 3 additions & 3 deletions src/antares/model/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"""

from types import MappingProxyType
from typing import Optional, Dict, List, Any, Mapping, Set
from typing import Any, Dict, List, Mapping, Optional, Set

import pandas as pd
from pydantic import BaseModel, computed_field
from pydantic.alias_generators import to_camel

from antares.model.commons import FilterOption, sort_filter_values
from antares.model.hydro import HydroProperties, HydroMatrixName, Hydro
from antares.model.hydro import Hydro, HydroMatrixName, HydroProperties
from antares.model.load import Load
from antares.model.misc_gen import MiscGen
from antares.model.renewable import RenewableCluster, RenewableClusterProperties
Expand All @@ -34,7 +34,7 @@
from antares.model.thermal import ThermalCluster, ThermalClusterProperties
from antares.model.wind import Wind
from antares.tools.all_optional_meta import all_optional_model
from antares.tools.contents_tool import transform_name_to_id, EnumIgnoreCase
from antares.tools.contents_tool import EnumIgnoreCase, transform_name_to_id


class AdequacyPatchMode(EnumIgnoreCase):
Expand Down
4 changes: 2 additions & 2 deletions src/antares/model/binding_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# This file is part of the Antares project.

from enum import Enum
from typing import Optional, Union, List, Any, Dict
from typing import Any, Dict, List, Optional, Union

import pandas as pd
from pydantic import BaseModel, Field, model_validator, computed_field
from pydantic import BaseModel, Field, computed_field, model_validator
from pydantic.alias_generators import to_camel

from antares.tools.all_optional_meta import all_optional_model
Expand Down
2 changes: 1 addition & 1 deletion src/antares/model/hydro.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# This file is part of the Antares project.

from enum import Enum
from typing import Optional, Dict
from typing import Dict, Optional

import pandas as pd
from pydantic import BaseModel, computed_field
Expand Down
2 changes: 1 addition & 1 deletion src/antares/model/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# This file is part of the Antares project.

from enum import Enum
from typing import Optional, Set, Mapping
from typing import Mapping, Optional, Set

from pydantic import BaseModel, computed_field

Expand Down
4 changes: 2 additions & 2 deletions src/antares/model/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import time
from pathlib import Path
from types import MappingProxyType
from typing import Optional, Dict, List, Any
from typing import Any, Dict, List, Optional

import pandas as pd

Expand All @@ -25,7 +25,7 @@
from antares.exceptions.exceptions import APIError, StudyCreationError
from antares.model.area import Area, AreaProperties, AreaUi
from antares.model.binding_constraint import BindingConstraint, BindingConstraintProperties, ConstraintTerm
from antares.model.link import Link, LinkUi, LinkProperties
from antares.model.link import Link, LinkProperties, LinkUi
from antares.model.settings import StudySettings
from antares.service.api_services.study_api import _returns_study_settings
from antares.service.base_services import BaseStudyService
Expand Down
28 changes: 14 additions & 14 deletions src/antares/service/api_services/area_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# This file is part of the Antares project.

from pathlib import PurePosixPath
from typing import Optional, Dict, Union, List
from typing import Dict, List, Optional, Union

import pandas as pd

Expand All @@ -20,35 +20,35 @@
from antares.exceptions.exceptions import (
APIError,
AreaCreationError,
AreaPropertiesUpdateError,
AreaDeletionError,
AreaPropertiesUpdateError,
AreaUiUpdateError,
MatrixUploadError,
HydroCreationError,
ThermalCreationError,
LoadMatrixDownloadError,
LoadMatrixUploadError,
MatrixUploadError,
RenewableCreationError,
STStorageCreationError,
ThermalDeletionError,
RenewableDeletionError,
STStorageCreationError,
STStorageDeletionError,
LoadMatrixUploadError,
LoadMatrixDownloadError,
ThermalCreationError,
ThermalDeletionError,
)
from antares.model.area import AreaProperties, AreaUi, Area
from antares.model.hydro import HydroProperties, HydroMatrixName, Hydro
from antares.model.area import Area, AreaProperties, AreaUi
from antares.model.hydro import Hydro, HydroMatrixName, HydroProperties
from antares.model.load import Load
from antares.model.misc_gen import MiscGen
from antares.model.renewable import RenewableClusterProperties, RenewableCluster
from antares.model.renewable import RenewableCluster, RenewableClusterProperties
from antares.model.reserves import Reserves
from antares.model.solar import Solar
from antares.model.st_storage import STStorageProperties, STStorage
from antares.model.thermal import ThermalClusterProperties, ThermalCluster
from antares.model.st_storage import STStorage, STStorageProperties
from antares.model.thermal import ThermalCluster, ThermalClusterProperties
from antares.model.wind import Wind
from antares.service.base_services import (
BaseAreaService,
BaseRenewableService,
BaseShortTermStorageService,
BaseThermalService,
BaseRenewableService,
)
from antares.tools.contents_tool import AreaUiResponse
from antares.tools.matrix_tool import prepare_args_replace_matrix
Expand Down
8 changes: 4 additions & 4 deletions src/antares/service/api_services/binding_constraint_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# This file is part of the Antares project.

from pathlib import PurePosixPath
from typing import Optional, List
from typing import List, Optional

import pandas as pd

Expand All @@ -20,17 +20,17 @@
from antares.exceptions.exceptions import (
APIError,
BindingConstraintCreationError,
ConstraintTermDeletionError,
ConstraintPropertiesUpdateError,
ConstraintMatrixDownloadError,
ConstraintMatrixUpdateError,
ConstraintPropertiesUpdateError,
ConstraintTermAdditionError,
ConstraintTermDeletionError,
)
from antares.model.binding_constraint import (
BindingConstraint,
BindingConstraintProperties,
ConstraintTerm,
ConstraintMatrixName,
ConstraintTerm,
)
from antares.service.api_services.utils import get_matrix
from antares.service.base_services import BaseBindingConstraintService
Expand Down
2 changes: 1 addition & 1 deletion src/antares/service/api_services/link_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
LinkUiUpdateError,
)
from antares.model.area import Area
from antares.model.link import LinkProperties, LinkUi, Link
from antares.model.link import Link, LinkProperties, LinkUi
from antares.service.base_services import BaseLinkService


Expand Down
2 changes: 1 addition & 1 deletion src/antares/service/api_services/renewable_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from antares.api_conf.api_conf import APIconf
from antares.api_conf.request_wrapper import RequestWrapper
from antares.exceptions.exceptions import APIError, RenewablePropertiesUpdateError, RenewableMatrixDownloadError
from antares.exceptions.exceptions import APIError, RenewableMatrixDownloadError, RenewablePropertiesUpdateError
from antares.model.renewable import RenewableCluster, RenewableClusterProperties
from antares.service.api_services.utils import get_matrix
from antares.service.base_services import BaseRenewableService
Expand Down
6 changes: 3 additions & 3 deletions src/antares/service/api_services/st_storage_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
from antares.api_conf.request_wrapper import RequestWrapper
from antares.exceptions.exceptions import (
APIError,
STStoragePropertiesUpdateError,
STStorageMatrixUploadError,
STStorageMatrixDownloadError,
STStorageMatrixUploadError,
STStoragePropertiesUpdateError,
)
from antares.model.st_storage import STStorage, STStorageProperties, STStorageMatrixName
from antares.model.st_storage import STStorage, STStorageMatrixName, STStorageProperties
from antares.service.base_services import BaseShortTermStorageService


Expand Down
10 changes: 5 additions & 5 deletions src/antares/service/api_services/study_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
from antares.api_conf.request_wrapper import RequestWrapper
from antares.exceptions.exceptions import (
APIError,
StudySettingsUpdateError,
BindingConstraintDeletionError,
StudyDeletionError,
StudySettingsUpdateError,
)
from antares.model.binding_constraint import BindingConstraint
from antares.model.settings import (
StudySettings,
GeneralProperties,
ThematicTrimming,
TimeSeriesProperties,
AdequacyPatchProperties,
AdvancedProperties,
GeneralProperties,
OptimizationProperties,
StudySettings,
ThematicTrimming,
TimeSeriesProperties,
)
from antares.service.base_services import BaseStudyService

Expand Down
4 changes: 2 additions & 2 deletions src/antares/service/api_services/thermal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

from antares.api_conf.api_conf import APIconf
from antares.api_conf.request_wrapper import RequestWrapper
from antares.exceptions.exceptions import APIError, ThermalPropertiesUpdateError, ThermalMatrixDownloadError
from antares.model.thermal import ThermalCluster, ThermalClusterProperties, ThermalClusterMatrixName
from antares.exceptions.exceptions import APIError, ThermalMatrixDownloadError, ThermalPropertiesUpdateError
from antares.model.thermal import ThermalCluster, ThermalClusterMatrixName, ThermalClusterProperties
from antares.service.api_services.utils import get_matrix
from antares.service.base_services import BaseThermalService

Expand Down
18 changes: 9 additions & 9 deletions src/antares/service/base_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@

from abc import ABC, abstractmethod
from types import MappingProxyType
from typing import Optional, Dict, List
from typing import Dict, List, Optional

import pandas as pd

from antares.config.base_configuration import BaseConfiguration
from antares.model.area import AreaProperties, Area, AreaUi
from antares.model.area import Area, AreaProperties, AreaUi
from antares.model.binding_constraint import (
BindingConstraintProperties,
ConstraintTerm,
BindingConstraint,
BindingConstraintProperties,
ConstraintMatrixName,
ConstraintTerm,
)
from antares.model.hydro import HydroProperties, HydroMatrixName, Hydro
from antares.model.link import LinkProperties, LinkUi, Link
from antares.model.hydro import Hydro, HydroMatrixName, HydroProperties
from antares.model.link import Link, LinkProperties, LinkUi
from antares.model.load import Load
from antares.model.misc_gen import MiscGen
from antares.model.renewable import RenewableClusterProperties, RenewableCluster
from antares.model.renewable import RenewableCluster, RenewableClusterProperties
from antares.model.reserves import Reserves
from antares.model.settings import StudySettings
from antares.model.solar import Solar
from antares.model.st_storage import STStorageProperties, STStorage
from antares.model.thermal import ThermalClusterProperties, ThermalCluster, ThermalClusterMatrixName
from antares.model.st_storage import STStorage, STStorageProperties
from antares.model.thermal import ThermalCluster, ThermalClusterMatrixName, ThermalClusterProperties
from antares.model.wind import Wind


Expand Down
16 changes: 8 additions & 8 deletions src/antares/service/local_services/area_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@
import logging
import os
from configparser import ConfigParser
from typing import Optional, Dict, List, Any
from typing import Any, Dict, List, Optional

import pandas as pd

from antares.config.local_configuration import LocalConfiguration
from antares.exceptions.exceptions import CustomError
from antares.model.area import AreaProperties, AreaUi, Area, AreaPropertiesLocal, AreaUiLocal
from antares.model.hydro import HydroProperties, HydroMatrixName, Hydro, HydroPropertiesLocal
from antares.model.area import Area, AreaProperties, AreaPropertiesLocal, AreaUi, AreaUiLocal
from antares.model.hydro import Hydro, HydroMatrixName, HydroProperties, HydroPropertiesLocal
from antares.model.load import Load
from antares.model.misc_gen import MiscGen
from antares.model.renewable import RenewableClusterProperties, RenewableCluster, RenewableClusterPropertiesLocal
from antares.model.renewable import RenewableCluster, RenewableClusterProperties, RenewableClusterPropertiesLocal
from antares.model.reserves import Reserves
from antares.model.solar import Solar
from antares.model.st_storage import STStorageProperties, STStorage, STStoragePropertiesLocal
from antares.model.thermal import ThermalClusterProperties, ThermalCluster, ThermalClusterPropertiesLocal
from antares.model.st_storage import STStorage, STStorageProperties, STStoragePropertiesLocal
from antares.model.thermal import ThermalCluster, ThermalClusterProperties, ThermalClusterPropertiesLocal
from antares.model.wind import Wind
from antares.service.base_services import (
BaseAreaService,
BaseRenewableService,
BaseShortTermStorageService,
BaseThermalService,
BaseRenewableService,
)
from antares.tools.ini_tool import IniFileTypes, IniFile
from antares.tools.ini_tool import IniFile, IniFileTypes
from antares.tools.time_series_tool import TimeSeriesFile, TimeSeriesFileType


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
#
# This file is part of the Antares project.

from typing import Optional, Any
from typing import Any, Optional

import pandas as pd

from antares.config.local_configuration import LocalConfiguration
from antares.model.binding_constraint import (
BindingConstraintProperties,
ConstraintTerm,
BindingConstraint,
BindingConstraintProperties,
ConstraintMatrixName,
ConstraintTerm,
)
from antares.service.base_services import BaseBindingConstraintService
from antares.tools.ini_tool import IniFile, IniFileTypes
Expand Down
6 changes: 3 additions & 3 deletions src/antares/service/local_services/link_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import configparser
import os
from types import MappingProxyType
from typing import Optional, Any, Dict
from typing import Any, Dict, Optional

from antares.config.local_configuration import LocalConfiguration
from antares.exceptions.exceptions import LinkCreationError, CustomError
from antares.exceptions.exceptions import CustomError, LinkCreationError
from antares.model.area import Area
from antares.model.link import LinkProperties, LinkUi, Link, LinkPropertiesLocal, LinkUiLocal
from antares.model.link import Link, LinkProperties, LinkPropertiesLocal, LinkUi, LinkUiLocal
from antares.service.base_services import BaseLinkService
from antares.tools.contents_tool import sort_ini_sections

Expand Down
2 changes: 1 addition & 1 deletion src/antares/service/local_services/study_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# This file is part of the Antares project.

from typing import Optional, Any
from typing import Any, Optional

from antares.config.local_configuration import LocalConfiguration
from antares.model.binding_constraint import BindingConstraint
Expand Down
6 changes: 3 additions & 3 deletions src/antares/service/service_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
from antares.service.api_services.thermal_api import ThermalApiService
from antares.service.base_services import (
BaseAreaService,
BaseLinkService,
BaseThermalService,
BaseBindingConstraintService,
BaseStudyService,
BaseLinkService,
BaseRenewableService,
BaseShortTermStorageService,
BaseStudyService,
BaseThermalService,
)
from antares.service.local_services.area_local import AreaLocalService
from antares.service.local_services.binding_constraint_local import BindingConstraintLocalService
Expand Down
1 change: 1 addition & 0 deletions src/antares/tools/all_optional_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import copy
import typing as t

from pydantic import BaseModel, create_model

ModelClass = t.TypeVar("ModelClass", bound=BaseModel)
Expand Down
2 changes: 1 addition & 1 deletion src/antares/tools/ini_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from configparser import ConfigParser
from enum import Enum
from pathlib import Path
from typing import Optional, Any, overload, Union
from typing import Any, Optional, Union, overload


class IniFileTypes(Enum):
Expand Down
4 changes: 2 additions & 2 deletions src/antares/tools/prepro_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import numpy as np
import pandas as pd

from antares.tools.ini_tool import IniFileTypes, IniFile
from antares.tools.time_series_tool import TimeSeriesFileType, TimeSeries, TimeSeriesFile
from antares.tools.ini_tool import IniFile, IniFileTypes
from antares.tools.time_series_tool import TimeSeries, TimeSeriesFile, TimeSeriesFileType


class PreproFolder:
Expand Down
Loading

0 comments on commit f462b74

Please sign in to comment.