USER_CONFIG_DIR=os.path.join(os.path.expanduser("~"),".openflexure")#: str: Default path of the user-config directory, containing runtime-config and calibration files.
USER_CONFIG_FILE=os.path.join(USER_CONFIG_DIR,"microscoperc.yaml")#: str: Default path of the user microscoperc.yaml runtime-config file.
TYPES={
'stream_resolution':tuple,
@@ -17,11 +17,16 @@ TYPES = {
'jpeg_quality':int,
'analog_gain':float,
'digital_gain':float,
}
}#: dict: Dictionary of expected types for common config parameters. Used by ``convert_config()``.
defconvert_config(config:dict)->dict:
"""Convert datatype of config based on type dictionary."""
"""
Convert datatype of top-level config parameters based on the global TYPES dictionary.
Args:
config (dict): Dictionary representation of a loaded runtime-config.