(self)
| 204 | self.assertIn(clipped, microgrid.microgrid_action_space.unnormalized) |
| 205 | |
| 206 | def test_sample_action(self): |
| 207 | microgrid = get_modular_microgrid() |
| 208 | action = microgrid.sample_action() |
| 209 | |
| 210 | for module_name, action_list in action.items(): |
| 211 | for module_num, _act in enumerate(action_list): |
| 212 | with self.subTest(module_name=module_name, module_num=module_num): |
| 213 | action_arr = np.array(_act) |
| 214 | if not action_arr.shape: |
| 215 | action_arr = np.array([_act]) |
| 216 | self.assertTrue(microgrid.modules[module_name][module_num].action_space.shape[0]) |
| 217 | self.assertIn(action_arr, microgrid.modules[module_name][module_num].action_space.normalized) |
| 218 | |
| 219 | def test_sample_action_all_modules_populated(self): |
| 220 | microgrid = get_modular_microgrid() |
nothing calls this directly
no test coverage detected