diff --git a/test/test_CARLEnv.py b/test/test_CARLEnv.py index 0b60d9b2..be98ce3b 100644 --- a/test/test_CARLEnv.py +++ b/test/test_CARLEnv.py @@ -26,90 +26,6 @@ def test_observation_reducedcontext(self): env = CARLPendulum(obs_context_features=context_keys) state, info = env.reset() self.assertEqual(len(state["context"]), n) - - - def test_get_context_key(self): - contexts = self.generate_contexts() - env = CARLPendulumEnv(contexts=contexts) - self.assertEqual(env.context_key, None) - - -class TestContextSampler(unittest.TestCase): - def test_get_defaults(self): - from carl.context.sampling import get_default_context_and_bounds - - defaults, bounds = get_default_context_and_bounds(env_name="CARLPendulumEnv") - DEFAULT_CONTEXT = { - "max_speed": 8.0, - "dt": 0.05, - "g": 10.0, - "m": 1.0, - "l": 1.0, - "initial_angle_max": np.pi, - "initial_velocity_max": 1, - } - self.assertDictEqual(defaults, DEFAULT_CONTEXT) - - def test_sample_contexts(self): - from carl.context.sampling import sample_contexts - - contexts = sample_contexts( - env_name="CARLPendulumEnv", - context_feature_args=["l"], - num_contexts=1, - default_sample_std_percentage=0.0, - ) - self.assertEqual(contexts[0]["l"], 1) - - -class TestContextAugmentation(unittest.TestCase): - def test_gaussian_noise(self): - from carl.context.augmentation import add_gaussian_noise - - c = add_gaussian_noise(default_value=1, percentage_std=0) - self.assertEqual(c, 1) - - def test_get_context_key(self): - contexts = self.generate_contexts() - env = CARLPendulumEnv(contexts=contexts) - self.assertEqual(env.context_key, None) - - -class TestContextSampler(unittest.TestCase): - def test_get_defaults(self): - from carl.context.sampling import get_default_context_and_bounds - - defaults, bounds = get_default_context_and_bounds(env_name="CARLPendulumEnv") - DEFAULT_CONTEXT = { - "max_speed": 8.0, - "dt": 0.05, - "g": 10.0, - "m": 1.0, - "l": 1.0, - "initial_angle_max": np.pi, - "initial_velocity_max": 1, - } - self.assertDictEqual(defaults, DEFAULT_CONTEXT) - - def test_sample_contexts(self): - from carl.context.sampling import sample_contexts - - contexts = sample_contexts( - env_name="CARLPendulumEnv", - context_feature_args=["l"], - num_contexts=1, - default_sample_std_percentage=0.0, - ) - self.assertEqual(contexts[0]["l"], 1) - - -class TestContextAugmentation(unittest.TestCase): - def test_gaussian_noise(self): - from carl.context.augmentation import add_gaussian_noise - - c = add_gaussian_noise(default_value=1, percentage_std=0) - self.assertEqual(c, 1) - if __name__ == "__main__":