From 8cbb5548ea0053d4a001232d27bd4e0a6f25b031 Mon Sep 17 00:00:00 2001 From: ahalev Date: Sat, 17 Dec 2022 11:01:28 -0600 Subject: [PATCH] update test_discrete for new modulecontainer methods --- tests/envs/test_discrete.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/envs/test_discrete.py b/tests/envs/test_discrete.py index 6caac168..0e5fe849 100644 --- a/tests/envs/test_discrete.py +++ b/tests/envs/test_discrete.py @@ -13,20 +13,20 @@ def test_init_from_microgrid(self): env = DiscreteMicrogridEnv(microgrid) self.assertEqual(env.modules, microgrid.modules) - self.assertIsNot(env.modules.module_tuples(), microgrid.modules.module_tuples()) + self.assertIsNot(env.modules.to_tuples(), microgrid.modules.to_tuples()) - n_obs = sum([x.observation_spaces['normalized'].shape[0] for x in microgrid.modules.module_list()]) + n_obs = sum([x.observation_spaces['normalized'].shape[0] for x in microgrid.modules.to_list()]) self.assertEqual(env.observation_space.shape, (n_obs,)) def test_init_from_modules(self): microgrid = get_modular_microgrid() - env = DiscreteMicrogridEnv(microgrid.modules.module_tuples(), add_unbalanced_module=False) + env = DiscreteMicrogridEnv(microgrid.modules.to_tuples(), add_unbalanced_module=False) self.assertEqual(env.modules, microgrid.modules) - self.assertIsNot(env.modules.module_tuples(), microgrid.modules.module_tuples()) + self.assertIsNot(env.modules.to_tuples(), microgrid.modules.to_tuples()) - n_obs = sum([x.observation_spaces['normalized'].shape[0] for x in microgrid.modules.module_list()]) + n_obs = sum([x.observation_spaces['normalized'].shape[0] for x in microgrid.modules.to_list()]) self.assertEqual(env.observation_space.shape, (n_obs,))