Utilities for Developers (skbio.util)#

This package provides general exception/warning definitions used throughout scikit-bio, as well as various utility functionality, including I/O and unit-testing convenience functions.

Testing utilities#

Common functionality to support testing in skbio.

get_data_path(fn[, subfolder])

Return path to filename fn in the data folder.

assert_ordination_results_equal(left, right)

Assert that ordination results objects are equal.

assert_data_frame_almost_equal(left, right)

Raise AssertionError if pd.DataFrame objects are not "almost equal".

Plotting utilities#

PlottableMixin()

A plottable object.

Decorators#

overrides(interface_class)

Indicate that a member is being overridden from a specific parent class.

classproperty(func)

Decorator for class-level properties.

classonlymethod(function, /)

Just like classmethod, but it can't be called on an instance.

deprecated(ver[, msg, append])

Mark a function or a method as deprecated.

aliased(name[, ver, warn])

Create an alias for a function or method.

register_aliases(cls)

Register aliases of members of a module or class.

params_aliased([params])

Create aliases for parameters of a function or method.

Miscellaneous utilities#

Generally useful functionality that doesn’t fit in more specific locations.

get_rng([seed])

Get a random generator.

cardinal_to_ordinal(n)

Return ordinal string version of cardinal int n.

find_duplicates(iterable)

Find duplicate elements in an iterable.

safe_md5(open_file[, block_size])

Compute an md5 sum without loading the file into memory.