morphology_workflows.utils
¶
Util functions.
Module Contents¶
Classes¶
Mixin to ensure the dataset index is casted to str. |
Functions¶
|
Returns True if the extension is supported. |
|
A context manager to silent warnings during the body execution. |
|
A context manager to silent loggers during the body execution. |
|
Generate a dataset from a directory. |
|
Create inputs for the workflows. |
|
Convert a DataFrame containing placeholders into a nested dict. |
Attributes¶
- morphology_workflows.utils.EXTS¶
- class morphology_workflows.utils.StrIndexMixin¶
Mixin to ensure the dataset index is casted to str.
- transform_index(df)¶
The index is always casted to str.
- morphology_workflows.utils.is_morphology(filename)¶
Returns True if the extension is supported.
- morphology_workflows.utils.silent_warnings(*warning_classes)¶
A context manager to silent warnings during the body execution.
- Parameters:
*warning_classes (class) – The warning classes to be filtered.
- morphology_workflows.utils.silent_loggers(*logger_names)¶
A context manager to silent loggers during the body execution.
- Parameters:
*logger_names (str) – The names of the loggers to be disabled.
- morphology_workflows.utils.create_dataset_from_dir(dir_path, output_path)¶
Generate a dataset from a directory.
- morphology_workflows.utils.create_inputs(source_db=None, input_dir=None, output_dir=None, dataset_filename='dataset.csv')¶
Create inputs for the workflows.
- morphology_workflows.utils.placeholders_to_nested_dict(df: pandas.DataFrame) dict ¶
Convert a DataFrame containing placeholders into a nested dict.