get_unread_sources

method of dascore.core.spool.Spool source

get_unread_sources(
    self ,
)-> ‘list[Path | UPath]’

Get the files a directory spool’s index walked but got no patches from.

These include files no reader recognizes, such as a README, as well as fiber files whose scan failed (truncated, damaged, inaccessible, or hitting a reader bug), which the scan skipped with a warning. The reason a file was skipped is not recorded. Use update(retry_unreadable=True) to rescan them, such as after fixing a file or a reader.

Returns

Sorted paths under the directory the spool derives from, read from its whole index, so a selection does not narrow them. Spools not backed by a directory index return an empty list.

Examples

import tempfile
from pathlib import Path
import dascore as dc
path = Path(tempfile.mkdtemp())
_ = dc.get_example_patch().io.write(path / "patch.h5", "dasdae")
_ = (path / "README.txt").write_text("not fiber data")
spool = dc.spool(path).update()
assert spool.get_unread_sources() == [path / "README.txt"]