morphology_workflows.utils

Util functions.

Attributes

EXTS

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.

import_morph(morph_path, new_morph_path, ...)

Copy a morphology and an annotation.

seed_from_name(name)

Build a seed from the name hash.

rng_from_name(name)

Build a random number generator from the name hash.

write_neuron(neuron, filename)

Write a NEURON ordered version of the morphology.

compare_lists(l0, l1)

Compare two sets of lists, returns sets of overlap, only in l0, and only in l1.

get_points(input_file)

Get all points (soma, then neurites) from morphology.

Module Contents

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.

morphology_workflows.utils.import_morph(morph_path, new_morph_path, annotation_path, new_annotation_path)

Copy a morphology and an annotation.

morphology_workflows.utils.seed_from_name(name)

Build a seed from the name hash.

morphology_workflows.utils.rng_from_name(name)

Build a random number generator from the name hash.

morphology_workflows.utils.write_neuron(neuron: morphio.mut.Morphology, filename)

Write a NEURON ordered version of the morphology.

morphology_workflows.utils.compare_lists(l0, l1)

Compare two sets of lists, returns sets of overlap, only in l0, and only in l1.

morphology_workflows.utils.get_points(input_file)

Get all points (soma, then neurites) from morphology.