@@ -69,30 +69,36 @@ TEST_CASE("Test get_output_type") {
6969 }
7070}
7171
72- // faults are treated specially because they are added to the topology at runtime (not model construction)
73- // and only if the calculation type is short circuit
74- // for power flow and state estimation they are never in the topology, so we shouldn't allocate buffers for them in the
75- // output dataset
7672TEST_CASE (" Test get_irrelevant_components" ) {
7773 using namespace std ::string_literals;
7874
7975 SUBCASE (" Power flow" ) {
80- auto const component_list = std::set<std::string, std::less<>>{" fault" s};
81- CHECK (component_list == detail::get_irrelevant_components (PGM_power_flow));
76+ auto const component_list = std::set<std::string, std::less<>>{" sym_voltage_sensor" s,
77+ " sym_current_sensor" s,
78+ " sym_power_sensor" s,
79+ " asym_voltage_sensor" s,
80+ " asym_current_sensor" s,
81+ " asym_power_sensor" s,
82+ " fault" s};
83+ CHECK (component_list == get_irrelevant_components (PGM_power_flow));
8284 }
8385 SUBCASE (" State estimation" ) {
84- auto const component_list = std::set<std::string, std::less<>>{" fault" s};
85- CHECK (component_list == detail::get_irrelevant_components (PGM_state_estimation));
86+ auto const component_list =
87+ std::set<std::string, std::less<>>{" fault" s, " transformer_tap_regulator" s, " voltage_regulator" s};
88+ CHECK (component_list == get_irrelevant_components (PGM_state_estimation));
8689 }
8790
8891 SUBCASE (" Short circuit" ) {
8992
90- auto const component_list = std::set<std::string, std::less<>>{};
91- CHECK (component_list == detail::get_irrelevant_components (PGM_short_circuit));
93+ auto const component_list = std::set<std::string, std::less<>>{
94+ " sym_voltage_sensor" s, " sym_current_sensor" s, " sym_power_sensor" s, " asym_voltage_sensor" s,
95+ " asym_current_sensor" s, " asym_power_sensor" s, " transformer_tap_regulator" s, " voltage_regulator" s};
96+ CHECK (component_list == get_irrelevant_components (PGM_short_circuit));
9297 }
9398}
9499
95100TEST_CASE (" OwningDataset - filter irrelevant components" ) {
101+ using namespace std ::string_literals;
96102 auto const input_dataset = load_dataset (json_data);
97103 auto options = Options{};
98104 Model model{50.0 , input_dataset.dataset };
@@ -113,7 +119,7 @@ TEST_CASE("OwningDataset - filter irrelevant components") {
113119
114120 CHECK_NOTHROW (model.calculate (options, output_dataset.dataset ));
115121 auto const & info = output_dataset.dataset .get_info ();
116- check_irrelevant_components (info, {" fault" });
122+ check_irrelevant_components (info, {" fault" , " sym_power_sensor " , " sym_voltage_sensor " , " asym_current_sensor " });
117123 }
118124
119125 SUBCASE (" State estimation filters out faults" ) {
@@ -123,7 +129,7 @@ TEST_CASE("OwningDataset - filter irrelevant components") {
123129
124130 CHECK_NOTHROW (model.calculate (options, output_dataset.dataset ));
125131 auto const & info = output_dataset.dataset .get_info ();
126- check_irrelevant_components (info, {" fault" });
132+ check_irrelevant_components (info, {" fault" , " voltage_regulator " });
127133 }
128134
129135 SUBCASE (" Short circuit filters out sensors" ) {
@@ -133,7 +139,8 @@ TEST_CASE("OwningDataset - filter irrelevant components") {
133139
134140 CHECK_NOTHROW (model.calculate (options, output_dataset.dataset ));
135141 auto const & info = output_dataset.dataset .get_info ();
136- check_irrelevant_components (info, {});
142+ check_irrelevant_components (
143+ info, {" sym_power_sensor" , " sym_voltage_sensor" , " asym_current_sensor" , " voltage_regulator" });
137144 }
138145}
139146
0 commit comments