quantlab.dataset.config.BaseDatasetConfig#

class quantlab.dataset.config.BaseDatasetConfig(*, zarr_file_path, start_date=None, end_date=None, symbols=None, kwargs=None, resample_freq=None, resample_how=None, name=None)[source]#

Bases: FrozenConfig

Fields every dataset shares, whatever it holds.

Both market panels and constituent (index membership) panels build on this class. Market-specific fields live on DatasetConfig. The dates and symbols bound what the build path (from_raw_data, from_raw_data_chunked, update) converts from raw files; reading a range of the store is panel(start, end, symbols), which does not use them.

Examples

>>> cfg = BaseDatasetConfig(
...     zarr_file_path="/data/us_equity/1d/stock.zarr",
...     start_date="2020-01-01",
...     end_date="2020-12-31",
...     symbols=("AAPL", "MSFT"),
... )
>>> cfg.kwargs, cfg.name
(None, None)
end_date = None#

Last date to convert from raw files, inclusive. None means no upper bound.

kwargs = None#

Free-form options a specific dataset class may read (for example data_type for tick data). None is treated as empty.

name = None#

Dotted import path of the dataset class; filled by the config setter and used to rebuild the dataset from its serialised config.

resample_freq = None#

Bar size the panel is resampled onto when it is requested or saved; None keeps the store’s own bars. Set by resample().

resample_how = None#

How each variable is aggregated into a resampled bar: one ResampleMethod for every variable, or a {variable: method} dict naming every variable. Required when resample_freq is set.

start_date = None#

First date to convert from raw files, inclusive. None means no lower bound.

symbols = None#

Convert only these symbols. None means every symbol.

zarr_file_path#

Path of the Zarr store the dataset reads from and writes to.