dir_content_diff.comparators.voxcell

Extension module to process files with Voxcell.

Functions

register()

Register Voxcell extensions.

Classes

CellCollectionComparator([...])

Comparator for any type of CellCollection file.

Mvd3Comparator([default_load_kwargs, ...])

Comparator for MVD3 files.

NrrdComparator([default_load_kwargs, ...])

Comparator for NRRD files.

class dir_content_diff.comparators.voxcell.CellCollectionComparator(default_load_kwargs=None, default_format_data_kwargs=None, default_diff_kwargs=None, default_filter_kwargs=None, default_format_diff_kwargs=None, default_sort_kwargs=None, default_concat_kwargs=None, default_report_kwargs=None, default_save_kwargs=None)

Bases: DataframeComparator

Comparator for any type of CellCollection file.

This comparator inherits from the dir_content_diff.comparators.pandas.DataframeComparator, read the doc of this comparator for details on args and kwargs.

load(path, **kwargs)

Load a CellCollection file into a pandas.DataFrame.

save(data, path, **kwargs)

Save data to a CellCollection file.

class dir_content_diff.comparators.voxcell.Mvd3Comparator(default_load_kwargs=None, default_format_data_kwargs=None, default_diff_kwargs=None, default_filter_kwargs=None, default_format_diff_kwargs=None, default_sort_kwargs=None, default_concat_kwargs=None, default_report_kwargs=None, default_save_kwargs=None)

Bases: DataframeComparator

Comparator for MVD3 files.

Note: MVD3 files can contain their creation date, so their hashes are depends on this creation date, even if the data are the same.

This comparator inherits from the dir_content_diff.comparators.pandas.DataframeComparator, read the doc of this comparator for details on args and kwargs.

load(path, **kwargs)

Load a MVD3 file into a pandas.DataFrame.

save(data, path, **kwargs)

Save data to a CellCollection file.

class dir_content_diff.comparators.voxcell.NrrdComparator(default_load_kwargs=None, default_format_data_kwargs=None, default_diff_kwargs=None, default_filter_kwargs=None, default_format_diff_kwargs=None, default_sort_kwargs=None, default_concat_kwargs=None, default_report_kwargs=None, default_save_kwargs=None)

Bases: BaseComparator

Comparator for NRRD files.

diff(ref, comp, *args, precision=None, **kwargs)

Compare data from two NRRD files.

Note: NRRD files can contain their creation date, so their hashes are depends on this creation date, even if the actual data are the same. This comparator only compares the actual data in the files.

Parameters:
  • ref_path (str) – The path to the reference CSV file.

  • comp_path (str) – The path to the compared CSV file.

  • precision (int) – The desired precision, default is exact precision.

Returns:

False if the DataFrames are considered as equal or a list of strings explaining why they are not considered as equal.

Return type:

bool or list(str)

format_diff(difference, **kwargs)

Format one element difference.

load(path, **kwargs)

Load a NRRD file into a numpy.ndarray.

report(ref_file, comp_file, formatted_differences, diff_args, diff_kwargs, **kwargs)

Create a report from the formatted differences.

save(data, path, **kwargs)

Save data to a NRRD file.

sort(differences, **kwargs)

Do not sort the entries to keep voxel dimensions as first entry.

dir_content_diff.comparators.voxcell.register()

Register Voxcell extensions.