diff --git a/source/extensions/omni.isaac.orbit/test/test_dict_utils.py b/source/extensions/omni.isaac.orbit/test/test_dict_utils.py index c01a22f891..f1e3fb1c56 100644 --- a/source/extensions/omni.isaac.orbit/test/test_dict_utils.py +++ b/source/extensions/omni.isaac.orbit/test/test_dict_utils.py @@ -19,7 +19,7 @@ def test_print_dict(self): "b": 2, "c": {"d": 3, "e": 4, "f": {"g": 5, "h": 6}}, "i": 7, - "j": lambda x: x ** 2, + "j": lambda x: x**2, "k": dict_utils.class_to_dict, } # print the dictionary diff --git a/source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/utils/parse_cfg.py b/source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/utils/parse_cfg.py index da759a6d2f..bb5b51ad84 100644 --- a/source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/utils/parse_cfg.py +++ b/source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/utils/parse_cfg.py @@ -27,7 +27,13 @@ def load_default_env_cfg(task_name: str) -> Union[dict, Any]: Returns: Union[dict, Any]: The parsed configuration object. + + Raises: + ValueError: If the task name is not provided, i.e. None. """ + # check if a task name is provided + if task_name is None: + raise ValueError("Please provide a valid task name. Hint: Use --task .") # retrieve the configuration file to load cfg_entry_point: str = gym.spec(task_name)._kwargs.pop("cfg_entry_point") @@ -74,7 +80,13 @@ def parse_env_cfg(task_name: str, use_gpu: bool = True, num_envs: int = None, ** Returns: Union[dict, Any]: The parsed configuration object. + + Raises: + ValueError: If the task name is not provided, i.e. None. """ + # check if a task name is provided + if task_name is None: + raise ValueError("Please provide a valid task name. Hint: Use --task .") # create a dictionary to update from args_cfg = {"sim": {"physx": dict()}, "env": dict()} # resolve pipeline to use (based on input)