ReadCoverage#

class scikitplot.corpus.ReadCoverage(unit='part', read=0, empty=0, skipped=<factory>)[source]#

What one read of a source covered: parts read, empty and skipped.

Parameters:
unitstr

What a part is ("member", "page", "file"), for messages.

readint

Parts that gave text.

emptyint

Parts that were read and gave no text.

skippeddict of str to int

Parts not read, by reason ("unsupported", "hidden", "unsafe-path", "error", "symlink").

Parameters:

Notes

User note: A reader that fills one exposes it as reader.coverage after iteration; a new read starts a new record, so reading twice gives the same counts. Messages hold counts and reasons only, never text.

empty: int = 0#
is_poor(warn_share=0.5)[source]#

Return whether the read deserves a warning.

True when parts were seen but none gave text, or when the share of parts skipped or empty is above warn_share (0 < share <= 1; 1 warns only when nothing was read).

Parameters:

warn_share (float)

Return type:

bool

merge(other)[source]#

Add another record’s counts (a nested archive’s) to this one.

Parameters:

other (ReadCoverage)

Return type:

None

read: int = 0#
skip(reason, count=1)[source]#

Count count parts skipped for reason.

Parameters:
Return type:

None

skipped: dict[str, int][source]#
summary()[source]#

Return "2 read, 1 empty, 3 skipped (2 unsupported, 1 hidden)".

Return type:

str

property total: int#

read, empty and skipped.

Type:

Return every part seen

unit: str = 'part'#