curobo.config_io module¶
File utilities for CuRobo.
- copy_file_to_path(
- source_file,
- destination_path,
Copy file from source to destination.
- file_exists(path)¶
Check if file exists.
- get_filename(
- file_path,
- remove_extension=False,
Get file name from file path, removing extension if required.
- get_files_from_dir(
- dir_path,
- extension,
- contains,
Get list of files from directory with specified extension and containing a string.
- get_path_of_dir(file_path)¶
Get path of directory containing the file.
- join_path(path1, path2)¶
Join two paths, considering OS specific path separators.
- Parameters:
- Returns:
Joined path as per standard path joining semantics: - If path2 is absolute, return path2 (ignore path1) - If path2 is relative, join path1 and path2
- Return type:
- load_yaml(file_path)¶
Load yaml file and return as dictionary. If file_path is a dictionary, return as is.
Note
This function calls
resolve_configinternally. Consider usingresolve_configdirectly for more flexibility with typed config objects.
- merge_dict_a_into_b(a, b)¶
Merge dictionary values in “a” into dictionary “b”. Overwrite values in “b” if key exists.
- resolve_config(config)¶
Resolve configuration from file path or return as-is.
If config is a string (file path), loads and returns the YAML content as a dict. Otherwise, returns config unchanged. This allows passing: - A file path (str) to load from YAML - A dict (already parsed config) - A typed config object (e.g., RobotCfg) that passes through unchanged