morphology_workflows.utils

Util functions.

Module Contents

Classes

StrIndexMixin

Mixin to ensure the dataset index is casted to str.

Functions

is_morphology(filename)

Returns True if the extension is supported.

silent_warnings(*warning_classes)

A context manager to silent warnings during the body execution.

silent_loggers(*logger_names)

A context manager to silent loggers during the body execution.

create_dataset_from_dir(dir_path, output_path)

Generate a dataset from a directory.

create_inputs([source_db, input_dir, output_dir, ...])

Create inputs for the workflows.

placeholders_to_nested_dict(→ dict)

Convert a DataFrame containing placeholders into a nested dict.

Attributes

EXTS

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.