import dascore as dc
spool = dc.get_example_spool("random_das")
loaded = spool.load()
assert len(loaded) == len(spool)load
load(
self ,
)-> ‘Self’
Read every patch into memory and return a spool holding them.
Before anything is read, the bytes the arrays take are added up from the spool’s contents and compared with the memory available, so a spool which will not fit is refused rather than read part way. The figure is an estimate: a patch which states its sample count is counted exactly, one a selection trimmed or a plan assembled is counted from its coordinate ranges, and one whose size cannot be told counts nothing. Patches already in memory count nothing either. Telling what is available needs psutil, which is not a dependency; without it the read goes ahead unchecked.
The loaded patches come back in a new spool, since a spool never changes under its holder; the attached inventory comes along, with any enrichment already applied to the patches.
Raises
InsufficientMemoryError When the arrays need more memory than is available. select a part of the spool and load that, or iterate the spool and keep only what each patch yields.