Skip to content

Commit

Permalink
remove erroneously added test logic after #668
Browse files Browse the repository at this point in the history
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
  • Loading branch information
mgovers committed Aug 6, 2024
1 parent 75c024f commit 9f11250
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
4 changes: 0 additions & 4 deletions src/power_grid_model/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,3 @@ class PowerGridUnreachableHitError(PowerGridError):
"""Supposedly unreachable code was hit.
This usually means a failed assumption and may be caused by a bug in the PGM library."""


class TapSearchStrategyIncompatibleError(PowerGridError):
"""Automatic tap search method and optimization strategy is incompatible with the current configuration."""
5 changes: 0 additions & 5 deletions tests/cpp_validation_tests/test_validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ std::map<std::string, OptimizerStrategy, std::less<>> const optimizer_strategy_m
{"max_voltage_tap", OptimizerStrategy::global_maximum},
{"fast_any_tap", OptimizerStrategy::fast_any}};

std::map<std::string, SearchMethod, std::less<>> const optimizer_search_mapping = {
{"linear_search", SearchMethod::linear_search}, {"binary_search", SearchMethod::binary_search}};

// case parameters
struct CaseParam {
std::filesystem::path case_dir;
Expand All @@ -317,7 +314,6 @@ struct CaseParam {
std::string calculation_method;
std::string short_circuit_voltage_scaling;
std::string tap_changing_strategy;
std::string search_method;
bool sym{};
bool is_batch{};
double rtol{};
Expand Down Expand Up @@ -441,7 +437,6 @@ std::optional<CaseParam> construct_case(std::filesystem::path const& case_dir, j
}

param.tap_changing_strategy = calculation_method_params.value("tap_changing_strategy", "disabled");
param.search_method = calculation_method_params.value("search_method", "binary_search");
param.case_name += sym ? "-sym"s : "-asym"s;
param.case_name += "-"s + param.calculation_method;
param.case_name += is_batch ? "_batch"s : ""s;
Expand Down
22 changes: 6 additions & 16 deletions tests/unit/test_0Z_model_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,13 @@ def test_batch_validation(
for update_data, reference_result in zip(update_list, reference_output_list):
model_copy = copy(model)
model_copy.update(update_data=update_data)
try:
result = calculation_function(
model_copy, **supported_kwargs(kwargs=base_kwargs, supported=calculation_args)
)
except Exception as e:
print(f"An error occurred during calculation: {e}")
else:
compare_result(result, reference_result, rtol, atol)
result = calculation_function(model_copy, **supported_kwargs(kwargs=base_kwargs, supported=calculation_args))
compare_result(result, reference_result, rtol, atol)

# execute in batch one go
for threading in [-1, 0, 1, 2]:
kwargs = dict(base_kwargs, update_data=update_batch, threading=threading)
try:
result_batch = calculation_function(model, **supported_kwargs(kwargs=kwargs, supported=calculation_args))
except Exception as e:
print(f"An error occurred during calculation: {e}")
else:
result_list = convert_batch_dataset_to_batch_list(result_batch)
for result, reference_result in zip(result_list, reference_output_list):
compare_result(result, reference_result, rtol, atol)
result_batch = calculation_function(model, **supported_kwargs(kwargs=kwargs, supported=calculation_args))
result_list = convert_batch_dataset_to_batch_list(result_batch)
for result, reference_result in zip(result_list, reference_output_list):
compare_result(result, reference_result, rtol, atol)
1 change: 0 additions & 1 deletion tests/unit/test_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
IterationDiverge,
MissingCaseForEnumError,
NotObservableError,
TapSearchStrategyIncompatibleError,
)

from .utils import PowerGridModelWithExt
Expand Down

0 comments on commit 9f11250

Please sign in to comment.