Utility functionality (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 functionality

Common functionality to support testing in skbio.

get_data_path(fn[, subfolder]) Return path to filename fn in the data folder.
TestRunner(filename) Simple wrapper class around nosetests functionality.
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”.

Miscellaneous functionality

Generally useful functions that don’t fit in more specific locations.

cardinal_to_ordinal(n) Return ordinal string version of cardinal int n.
create_dir(dir_name[, fail_on_exist, ...]) Create a directory safely and fail meaningfully
find_duplicates(iterable) Find duplicate elements in an iterable.
is_casava_v180_or_later(header_line) Check if the header looks like it is Illumina software post-casava v1.8
remove_files(list_of_filepaths[, ...]) Remove list of filepaths, optionally raising an error if any are missing
safe_md5(open_file[, block_size]) Computes an md5 sum without loading the file into memory

Warnings

EfficiencyWarning Warn about potentially accidental use of inefficient code.
RepresentationWarning Warn about assumptions made for the successful completion of a process.