onehealth_db.utils module⚓︎
onehealth_db.utils
⚓︎
Functions:
-
get_settings
–Get the settings for preprocessing steps.
-
is_valid_settings
–Check if the settings are valid.
-
save_settings_to_file
–Save the settings to a file.
get_settings
⚓︎
get_settings(setting_path='default', new_settings={}, updated_setting_dir=None, save_updated_settings=True)
Get the settings for preprocessing steps. If the setting path is "default", return the default settings. If the setting path is not default, read the settings from the file. If the new settings are provided, overwrite the default/loaded settings.
Parameters:
-
setting_path
(str
, default:'default'
) –Path to the settings file. Defaults to "default".
-
new_settings
(dict
, default:{}
) –New settings to overwrite the existing settings. Defaults to {}.
-
updated_setting_dir
(str
, default:None
) –Directory to save the updated settings file. Defaults to None.
-
save_updated_settings
(bool
, default:True
) –Whether to save the updated settings to a file.
Returns:
-
dict
(dict
) –The settings.
is_valid_settings
⚓︎
Check if the settings are valid. Args: settings (dict): The settings.
Returns:
-
bool
(bool
) –True if the settings are valid, False otherwise.
save_settings_to_file
⚓︎
Save the settings to a file. If dir_path is None, save to the current directory.
Parameters:
-
settings
(dict
) –The settings.
-
dir_path
(str
, default:None
) –The path to save the settings file. Defaults to None.