quantlab.core.store_uses.StoreUse#

class quantlab.core.store_uses.StoreUse(path, relation, handle=None)[source]#

Bases: object

One store a component uses directly, and how.

Parameters:
pathstr or None

The Zarr store, as the component names it; None for a "reads" of a panel held in memory (a FrameDataset), which reads no store.

relationstr

"reads", "owns" or "source" (see the module docstring).

handleRangedStoreHandle, optional

For a store written by date range: what reads its recorded range and extends it. Required with "owns"; None for a dataset’s store.

Raises:
ValueError

If relation is not one of RELATIONS, an "owns" use has no handle, or a use other than a plain "reads" has no path.

TypeError

If handle lacks a member of RangedStoreHandle.

Examples

>>> StoreUse("data/prices.zarr", "reads")
StoreUse(path='data/prices.zarr', relation='reads', handle=None)
>>> StoreUse("data/momentum.zarr", "owns")
Traceback (most recent call last):
ValueError: StoreUse('data/momentum.zarr', 'owns'): an owned store carries the RangedStoreHandle that extends it
property ranged#

Whether the store is written by date range: the use carries a handle.

Examples

>>> StoreUse("data/prices.zarr", "reads").ranged
False