coverage

function of dascore.viz.spool source

coverage(
    spool ,
    tolerance: float = 1.5,
    group: str | collections.abc.Sequence[str, collections.abc.Sequence[str], None] = None,
    color = None,
    ax: matplotlib.axes._axes.Axes | None[Axes, None] = None,
    figsize: tuple[tuple[float, float], None] = None,
    show: bool = False,
    **kwargs ,
)-> ‘plt.Axes’

Plot what a spool covers along a dimension, and where it does not.

One lane per group of patches which could combine, drawn as the runs the group holds and the holes between them. The holes are the ones get_gaps reports, so a gap drawn here is exactly a boundary chunk would refuse to close, and the percentage on each lane is that group’s get_coverage.

Parameters

Parameter Description
spool The spool to measure.
tolerance How many samples patches may be spaced and still count as
contiguous. Same meaning as chunk’s tolerance.
group Attributes which separate patches into unrelated groups; a gap
is never reported between two groups. Defaults to the config
option patch_kind_attrs.
color A mapping of “data” and “gap” to colors, overriding the default.
ax A matplotlib Axes; one is created when None.
figsize Size of the figure built when ax is None.
show Whether to call plt.show.
**kwargs The dimension to measure along, optionally with the window to
draw: time=("2020-01-01", None). time=... states the
dimension and asks for all of it. Defaults to the whole of time.
Note

Coverage is measured between patches, from the envelopes the index records, so a hole inside a patch is not visible here. A lane reading 100% says “nothing chunk would refuse to merge”, not “nothing missing”.

Examples

import dascore as dc
from dascore.viz.spool import coverage

spool = dc.get_example_spool("diverse_das")
_ = coverage(spool)
_ = coverage(spool, time=("2020-01-03", "2020-01-04"))