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 26, 2024
1 parent a34780f commit a4534e7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_accurate_heuristic(
)

for j, cluster in enumerate(heuristic_components):
input_data = np.loadtxt(data_path / "accurate/itr1_accurate_cluster{j+1}.txt")
input_data = np.loadtxt(data_path / f"accurate/itr1_accurate_cluster{j+1}.txt")
nb_on_1 = pd.DataFrame(
np.transpose(np.ceil(np.round(input_data, 12))),
index=list(range(number_hours)),
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_accurate_heuristic(
)

expected_output = np.loadtxt(
data_path / "accurate/itr2_accurate_cluster{j+1}.txt"
data_path / f"accurate/itr2_accurate_cluster{j+1}.txt"
)
assert list(nb_on_heuristic[:, 0]) == [
pytest.approx(x) for x in expected_output
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_fast_heuristic(
pmax = thermal_problem_builder.database.get_value(
ComponentParameterIndex(cluster, "p_max"), 0, 0
)
input_data = np.loadtxt(data_path / "fast/itr1_fast_cluster{j+1}.txt")
input_data = np.loadtxt(data_path / f"fast/itr1_fast_cluster{j+1}.txt")

nb_on_1 = pd.DataFrame(
np.ceil(np.round(input_data / pmax, 12)), # type: ignore
Expand Down Expand Up @@ -188,7 +188,7 @@ def test_fast_heuristic(
param_needed_to_compute=["p_min", "max_generating"],
)

expected_output = np.loadtxt(data_path / "fast/itr2_fast_cluster{j+1}.txt")
expected_output = np.loadtxt(data_path / f"fast/itr2_fast_cluster{j+1}.txt")
for t in range(number_hours):
assert thermal_problem_builder.database.get_value(
ComponentParameterIndex(cluster, "min_generating"),
Expand Down

0 comments on commit a4534e7

Please sign in to comment.