Python SDK /fastsim.configs

fastsim.configs

1 个类

Unified configuration management: load YAML/JSON configs, validate against schemas, export working configs, and generate starter templates.

class

ConfigManager

静态类13 个方法
fastsim.configs.config_manager.ConfigManager

Static class managing the global configuration for all subsystems.

ConfigManager holds the parsed config for the simulator, simulation, scene, task, extension, and general sections. All methods are static — no instantiation is needed.

load_configstaticmethod
@staticmethod def load_config(config_path: str, format: str = 'yaml', disable_validation: bool = False)None

Parse and load a YAML or JSON file into the global config.

参数名类型默认值说明
config_pathstrPath to the configuration file.
formatoptstr'yaml'File format: 'yaml' or 'json'.
disable_validationoptboolFalseSkip schema validation after loading.
update_configstaticmethod
@staticmethod def update_config(config_path: str, format: str = 'yaml', disable_validation: bool = False, clear_old_config: bool = False)None

Merge a second config file on top of the current loaded config.

参数名类型默认值说明
config_pathstrPath to the update config file.
formatoptstr'yaml'File format: 'yaml' or 'json'.
disable_validationoptboolFalseSkip schema validation after merge.
clear_old_configoptboolFalseIf True, discard the existing config before merging.
clear_configstaticmethod
@staticmethod def clear_config()None

Reset the global config to an empty state.

validate_configstaticmethod
@staticmethod def validate_config()None

Run schema validation on the currently loaded config; raises on failure.

export_configstaticmethod
@staticmethod def export_config(is_template: bool = False)dict

Return the current config as a plain Python dict.

参数名类型默认值说明
is_templateoptboolFalseIf True, include all optional fields with their defaults.
dict — Serializable dict of the active configuration.
save_configstaticmethod
@staticmethod def save_config(config_path: str, format: str = 'yaml', is_template: bool = False)None

Serialize and write the active config to a file.

参数名类型默认值说明
config_pathstrDestination file path.
formatoptstr'yaml'Output format: 'yaml' or 'json'.
is_templateoptboolFalseIf True, include all optional fields.
generate_config_templatestaticmethod
@staticmethod def generate_config_template(target_dir: str, format: str = 'yaml')None

Write a full-featured template config to a target directory.

参数名类型默认值说明
target_dirstrDirectory where template files will be created.
formatoptstr'yaml'Template file format: 'yaml' or 'json'.
Useful for bootstrapping a new project — generates all section files.
simulatorproperty
@property def simulator(self)dict

Parsed simulator section of the loaded config.

dict — Simulator backend configuration.
simulation_configproperty
@property def simulation_config(self)dict

Parsed simulation section (physics settings, timestep, etc.).

scene_configproperty
@property def scene_config(self)dict

Parsed scene section (robots, objects, sensors, lights).

task_configproperty
@property def task_config(self)dict

Parsed task section (task name, parameters).

extension_configproperty
@property def extension_config(self)dict

Parsed extension section (enabled extensions and their configs).

general_configproperty
@property def general_config(self)dict

Parsed general section (logging level, seed, etc.).