find_annotations

function of dascore.core.annotation_loader source

find_annotations(
    directory: str | os.PathLike[str, PathLike] ,
)-> ‘Path | None’

Return what a directory of data carries its annotations under, or None.

Only the name is judged, never the contents, as find_inventory judges the inventory’s: a hidden .annotations/ holds the set, or the sets, a directory of data was annotated with, and .annotations.csv is the bare-table spelling of the same thing. Hidden, so the file scanner does not read it as data, and so a directory which states a visible annotations.csv is a set rather than something carrying one.

Raises rather than answering where a directory says two things at once – both spellings present – or where what sits under the name is the wrong kind of thing for it, which is a misspelling of the convention rather than a file which owes it nothing. InvalidAnnotationError, as find_inventory raises the inventory’s own: this is a door callers use directly, so it fails the way the rest of dc.annotations fails.

Parameters

Parameter Description
directory The directory to look in.