cars_mesh.config ================ .. py:module:: cars_mesh.config .. autoapi-nested-parse:: Main configuration module of cars-mesh tool. Functions --------- .. autoapisummary:: cars_mesh.config.check_general_items cars_mesh.config.check_state_machine cars_mesh.config.make_relative_path_absolute cars_mesh.config.read_config cars_mesh.config.check_config cars_mesh.config.save_config_file Module Contents --------------- .. py:function:: check_general_items(cfg: dict) -> dict Check general items in configuration :param cfg: Configuration dictionary :type cfg: dict :returns: **cfg** -- Configuration dictionary updated :rtype: dict .. py:function:: check_state_machine(cfg: dict) -> dict Check state machine parameters in configuration :param cfg: Configuration dictionary :type cfg: dict :returns: **cfg** -- Configuration dictionary updated :rtype: dict .. py:function:: make_relative_path_absolute(path, directory) If path is a valid relative path with respect to directory, returns it as an absolute path :param path: The relative path :type path: string :param directory: The directory path should be relative to :type directory: string :returns: os.path.join(directory,path) if path is a valid relative path form directory, else path :rtype: string .. py:function:: read_config(cfg_path: str) -> dict Read and check if the config path is valid and readable and returns cfg if valid :param cfg_path: Path to the JSON configuration file :type cfg_path: str :returns: **cfg** -- Configuration dictionary :rtype: dict .. py:function:: check_config(cfg_path: str) -> dict Global read and check if the config is readable (read_config), with valid contents (check_general_items) and valid state machine (check_state_machine) and returns read cfg at the end if valid :param cfg_path: Path to the JSON configuration file :type cfg_path: str :returns: **cfg** -- Configuration dictionary :rtype: dict .. py:function:: save_config_file(config_file: str, config: dict) Save a json configuration file :param config_file: path to a json file :type config_file: string :param config: configuration json dictionary :type config: Dict[str, Any]