Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChouaneLouis committed May 16, 2024
1 parent c96e674 commit 8b3fcb5
Showing 1 changed file with 31 additions and 21 deletions.
52 changes: 31 additions & 21 deletions tests/functional/test_andromede_yml.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pandas as pd
import pytest

from andromede.expression import literal, param, var
Expand Down Expand Up @@ -273,14 +274,17 @@ def test_min_up_down_times(lib) -> None:
database.add_data("U", "cost", ConstantData(3000))
database.add_data("S", "cost", ConstantData(10))

demand_data = TimeScenarioSeriesData(
{
TimeScenarioIndex(0, 0): 500,
TimeScenarioIndex(1, 0): 0,
TimeScenarioIndex(2, 0): 0,
}
demand_data = pd.DataFrame(
[
[500],
[0],
[0],
],
index=[0, 1, 2],
columns=[0],
)
database.add_data("D", "demand", demand_data)
demand_time_scenario_series = TimeScenarioSeriesData(demand_data)
database.add_data("D", "demand", demand_time_scenario_series)

time_block = TimeBlock(1, [0, 1, 2])
scenarios = 1
Expand Down Expand Up @@ -340,14 +344,17 @@ def test_changing_demand(lib) -> None:
database.add_data("G", "p_max", ConstantData(500))
database.add_data("G", "cost", ConstantData(100))

demand_data = TimeScenarioSeriesData(
{
TimeScenarioIndex(0, 0): 300,
TimeScenarioIndex(1, 0): 100,
TimeScenarioIndex(2, 0): 0,
}
demand_data = pd.DataFrame(
[
[300],
[100],
[0],
],
index=[0, 1, 2],
columns=[0],
)
database.add_data("D", "demand", demand_data)
demand_time_scenario_series = TimeScenarioSeriesData(demand_data)
database.add_data("D", "demand", demand_time_scenario_series)

time_block = TimeBlock(1, [0, 1, 2])
scenarios = 1
Expand Down Expand Up @@ -417,14 +424,17 @@ def test_min_up_down_times_2(lib) -> None:
database.add_data("U", "cost", ConstantData(3000))
database.add_data("S", "cost", ConstantData(10))

demand_data = TimeScenarioSeriesData(
{
TimeScenarioIndex(0, 0): 500,
TimeScenarioIndex(1, 0): 0,
TimeScenarioIndex(2, 0): 0,
}
demand_data = pd.DataFrame(
[
[500],
[0],
[0],
],
index=[0, 1, 2],
columns=[0],
)
database.add_data("D", "demand", demand_data)
demand_time_scenario_series = TimeScenarioSeriesData(demand_data)
database.add_data("D", "demand", demand_time_scenario_series)

time_block = TimeBlock(1, [0, 1, 2])
scenarios = 1
Expand Down

0 comments on commit 8b3fcb5

Please sign in to comment.