Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
killian-scalian committed Jan 22, 2025
1 parent d1d2feb commit 3787580
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
5 changes: 3 additions & 2 deletions tests/antares_historic/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ def local_study(tmp_path) -> Study:
def local_study_w_areas(tmp_path, local_study) -> Study:
areas_to_create = ["fr", "it"]
for area in areas_to_create:
area_properties = AreaPropertiesLocal(energy_cost_spilled="1.000000", energy_cost_unsupplied="0.500000")
area_properties = AreaPropertiesLocal(
energy_cost_spilled="1.000000", energy_cost_unsupplied="0.500000"
)
local_study.create_area(area, properties=area_properties)
return local_study



@pytest.fixture
def local_study_w_links(tmp_path, local_study_w_areas):
local_study_w_areas.create_area("at")
Expand Down
21 changes: 15 additions & 6 deletions tests/antares_historic/test_antares_historic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
def data_dir() -> Path:
return Path(__file__).parent.parent.parent


@pytest.fixture
def study_component(local_study_with_constraint
) -> InputStudy:
def study_component(local_study_with_constraint) -> InputStudy:
logger = Logger(__name__, local_study_with_constraint.service.config.study_path)
converter = AntaresStudyConverter(study_input=local_study_with_constraint, logger=logger)
converter = AntaresStudyConverter(
study_input=local_study_with_constraint, logger=logger
)
converter.process_all()
compo_file = converter.output_path

Expand All @@ -40,15 +42,22 @@ def study_component(local_study_with_constraint
def input_library(
data_dir: Path,
) -> InputLibrary:
library = data_dir / "src" / "andromede" / "libs" / "antares_historic" / "antares_historic.yml"
library = (
data_dir
/ "src"
/ "andromede"
/ "libs"
/ "antares_historic"
/ "antares_historic.yml"
)
with library.open() as lib:
return parse_yaml_library(lib)


@pytest.skip("Missing max operator in modeleur to read thermal model")
def test_basic_balance_using_yaml(
study_component: InputStudy, input_library: InputLibrary
study_component: InputStudy, input_library: InputLibrary
) -> None:

result_lib = resolve_library([input_library])

components_input = resolve_components_and_cnx(study_component, result_lib)
Expand Down
4 changes: 3 additions & 1 deletion tests/input_converter/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def local_study(tmp_path) -> Study:
def local_study_w_areas(tmp_path, local_study) -> Study:
areas_to_create = ["fr", "it"]
for area in areas_to_create:
area_properties = AreaPropertiesLocal(energy_cost_spilled="1.000000", energy_cost_unsupplied="0.500000")
area_properties = AreaPropertiesLocal(
energy_cost_spilled="1.000000", energy_cost_unsupplied="0.500000"
)
local_study.create_area(area, properties=area_properties)
return local_study

Expand Down
4 changes: 3 additions & 1 deletion tests/input_converter/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def _init_area_reading(self, local_study):

def test_convert_study_to_input_study(self, local_study_w_areas):
logger = Logger(__name__, local_study_w_areas.service.config.study_path)
converter = AntaresStudyConverter(study_input=local_study_w_areas, logger=logger)
converter = AntaresStudyConverter(
study_input=local_study_w_areas, logger=logger
)
input_study = converter.convert_study_to_input_study()
expected_input_study = InputStudy(
nodes=[
Expand Down

0 comments on commit 3787580

Please sign in to comment.