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.

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.

classproperty(func)

Decorator for class-level properties.

Developer warnings#

EfficiencyWarning

Warn about potentially accidental use of inefficient code.

RepresentationWarning

Warn about assumptions made for the successful completion of a process.

Details#

exception skbio.util.EfficiencyWarning[source]#

Warn about potentially accidental use of inefficient code.

For example, if a user doesn’t have an optimized version of a function/algorithm available in their scikit-bio installation, a slower, pure-Python implementation may be used instead. This warning can be used to let the user know they are using a version of the function that could be potentially orders of magnitude slower.

exception skbio.util.RepresentationWarning[source]#

Warn about assumptions made for the successful completion of a process.

Warn about substitutions, assumptions, or particular alterations that were made for the successful completion of a process. For example, if a value that is required for a task is not present, a best guess or least deleterious value could be used, accompanied by this warning.