Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliette-Gerbaux committed Aug 23, 2024
1 parent 4f47103 commit b21f1f0
Show file tree
Hide file tree
Showing 19 changed files with 614 additions and 613 deletions.
4 changes: 2 additions & 2 deletions src/andromede/hydro_heuristic/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class OutputHeuristic:


def build_hydro_heuristic_problem(
database: DataBase, heuristic_model: Model, timesteps: List[int], id: str = "H"
database: DataBase, heuristic_model: Model, timesteps: int, id: str = "H"
) -> OptimizationProblem:
hydro = create_component(model=heuristic_model, id=id)
network = Network("test")
Expand All @@ -55,7 +55,7 @@ def build_hydro_heuristic_problem(
problem = build_problem(
network,
database,
TimeBlock(1, timesteps),
TimeBlock(1, list(range(timesteps))),
1,
border_management=(BlockBorderManagement.CYCLE),
)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def antares_hydro_heuristic_step(
heuristic_problem = build_hydro_heuristic_problem(
database=get_database(data),
heuristic_model=hydro_heuristic_model,
timesteps=aggregator_parameters.timesteps,
timesteps=len(aggregator_parameters.timesteps),
)
status = heuristic_problem.solver.Solve(get_default_solver_parameters())
solving_output = SolvingOutput(status, heuristic_problem.solver.Objective().Value())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
152697.73105305,
438785.26894695,
392228.0,
0.0,
0.0,
0.0,
0.0,
283540.0,
811245.60160001,
939332.74547519,
961679.01031377,
1311898.64261102,
152697.73105305
438785.26894695
392228.0
0.0
0.0
0.0
0.0
283540.0
811245.60160001
939332.74547519
961679.01031377
1311898.64261102
104 changes: 52 additions & 52 deletions tests/functional/data/hydro_with_large_load/expected_weekly_target.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
30808.59868795,
34138.59595819,
33878.95450005,
37138.74177906,
68243.30211844,
109585.49868441,
116206.55310524,
106413.64170753,
106235.09659609,
94120.89889535,
87772.00295574,
86306.95398197,
72862.16102998,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
50475.29566149,
63276.90557923,
66979.26924831,
123852.52951097,
195032.417803,
183190.90389278,
186094.70977249,
225883.57013174,
183224.09230019,
188761.4662071,
195376.51984883,
237680.27684789,
242770.15796234,
194253.57880885,
211696.55361414,
237810.22449688,
257421.57201802,
202072.25316213,
256981.90893995,
375423.77165044,
390653.48131144,
30808.59868795
34138.59595819
33878.95450005
37138.74177906
68243.30211844
109585.49868441
116206.55310524
106413.64170753
106235.09659609
94120.89889535
87772.00295574
86306.95398197
72862.16102998
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
50475.29566149
63276.90557923
66979.26924831
123852.52951097
195032.417803
183190.90389278
186094.70977249
225883.57013174
183224.09230019
188761.4662071
195376.51984883
237680.27684789
242770.15796234
194253.57880885
211696.55361414
237810.22449688
257421.57201802
202072.25316213
256981.90893995
375423.77165044
390653.48131144
104 changes: 52 additions & 52 deletions tests/functional/data/hydro_with_large_load/optimal_generation.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
970769.54166667,
861569.45833333,
62812.0,
200749.91666667,
141134.41666667,
126312.5,
363693.41666667,
108870.0,
282407.75,
195624.33333333,
224115.45833333,
178595.75,
169385.41666667,
218124.83333333,
-23170.375,
-95656.125,
-14351.70833333,
-126658.0,
-505373.25,
-500585.33333333,
-506195.75,
-502971.33333333,
-233037.0,
-241259.75,
-188374.75,
-179215.0,
39146.16666667,
-57964.41666667,
34419.625,
-296548.91666667,
-363752.0,
-281616.0,
-194688.0,
-155247.0,
-174545.0,
-157275.0,
-165210.0,
-163579.0,
17827.0,
48997.0,
84822.0,
111583.0,
408906.0,
564588.0,
337915.0,
508152.0,
678530.0,
898910.0,
796024.0,
556589.12499998,
552651.0,
670764.0,
970769.54166667
861569.45833333
62812.0
200749.91666667
141134.41666667
126312.5
363693.41666667
108870.0
282407.75
195624.33333333
224115.45833333
178595.75
169385.41666667
218124.83333333
-23170.375
-95656.125
-14351.70833333
-126658.0
-505373.25
-500585.33333333
-506195.75
-502971.33333333
-233037.0
-241259.75
-188374.75
-179215.0
39146.16666667
-57964.41666667
34419.625
-296548.91666667
-363752.0
-281616.0
-194688.0
-155247.0
-174545.0
-157275.0
-165210.0
-163579.0
17827.0
48997.0
84822.0
111583.0
408906.0
564588.0
337915.0
508152.0
678530.0
898910.0
796024.0
556589.12499998
552651.0
670764.0
104 changes: 52 additions & 52 deletions tests/functional/data/hydro_with_rulecurves/expected_weekly_target.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
109351.86292514109,
111726.1238133478,
111672.02178563867,
113437.13342869015,
62616.900712692266,
23991.30072993157,
24205.8685804484,
23841.307084756725,
61261.93871434613,
89844.8189589692,
88014.90475844462,
88233.53746669635,
75513.68104089717,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
52834.94251817542,
64170.764366982155,
69887.53747203582,
117690.35564280929,
225600.3527384371,
225343.98594768142,
225396.68087341834,
269286.9804404632,
220748.07777396217,
221848.1338577599,
222669.867308102,
231799.58049729763,
235689.46113471934,
228057.0061722157,
233248.7929951121,
238444.8799521864,
242073.10581958073,
230837.7730157587,
240452.7654725604,
239759.55615180839,
239858.33673477554,
109351.86292514109
111726.1238133478
111672.02178563867
113437.13342869015
62616.900712692266
23991.30072993157
24205.8685804484
23841.307084756725
61261.93871434613
89844.8189589692
88014.90475844462
88233.53746669635
75513.68104089717
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
52834.94251817542
64170.764366982155
69887.53747203582
117690.35564280929
225600.3527384371
225343.98594768142
225396.68087341834
269286.9804404632
220748.07777396217
221848.1338577599
222669.867308102
231799.58049729763
235689.46113471934
228057.0061722157
233248.7929951121
238444.8799521864
242073.10581958073
230837.7730157587
240452.7654725604
239759.55615180839
239858.33673477554
Loading

0 comments on commit b21f1f0

Please sign in to comment.