The one door every source goes through, as dascore.spool is for patches: a set comes back from a set, a directory, a table on disk, or anything a dataframe can be built from.
Parameters
Parameter
Description
source
An AnnotationSet, a dataframe of one row per annotation, or a path to a CSV table, a set directory, a directory of set directories, or a directory of data carrying either under .annotations.
dims
The patch dimensions the annotations are stated in. Required unless the source states them itself – in its attributes, or in a # dims: distance, time line above its table. A source which states them takes them again only if the two agree.
**kwargs
Passed to AnnotationSet. A source already holding what one states – a set, or a directory holding its own attributes and vertices – refuses it rather than dropping it.
Examples
import pandas as pdimport dascore as dcframe = pd.DataFrame({"group": ["event"], "distance": [10.0]})picks = dc.annotations(frame, dims=("distance",))len(picks)dc.annotations(picks) is picksimport tempfilefrom pathlib import Pathwith tempfile.TemporaryDirectory() as folder: root = Path(folder) /"sets" _ = picks.io.save(root /"hand") _ = picks.io.save(root /"phasenet") together = dc.annotations(root)len(together), together[0].set, sorted(together.attrs.sets)with tempfile.TemporaryDirectory() as folder: data = Path(folder) _ = picks.io.save(data /".annotations") carried = dc.annotations(data)carried == picks