Skip to main content
`Ctrl`+`K`

# 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` | Return path to filename `fn` in the data folder.
`assert_ordination_results_equal` | Assert that ordination results objects are equal.
`assert_ordination_results_equal_np` | NumPy version of testing ordination results.
`assert_data_frame_almost_equal` | Raise AssertionError if `pd.DataFrame` objects are not "almost equal".
`xp_assert_close` | Assert two arrays are element-wise equal within a tolerance.
`xp_assert_equal` | Assert two arrays are element-wise exactly equal.

## Plotting utilities

`PlottableMixin` | A plottable object.

## Randomization

`get_rng` | Get a random generator.

## Decorators

`overrides` | Indicate that a member is being overridden from a specific parent class.
`classproperty` | Decorator for class-level properties.
`classonlymethod` | Just like classmethod, but it can't be called on an instance.
`deprecated` | Mark a function or a method as deprecated.
`aliased` | Create an alias for a function or method.
`register_aliases` | Register aliases of members of a module or class.
`params_aliased` | Create aliases for parameters of a function or method.
`array_api_doc` | Add an array API compatibility table to a function's documentation.

## Miscellaneous utilities

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

`cardinal_to_ordinal` | Return ordinal string version of cardinal int n.
`find_duplicates` | Find duplicate elements in an iterable.
`safe_md5` | Compute an md5 sum without loading the file into memory.