import numpy as np
from dascore.core.source import ArraySource
from dascore.core.lazy_array import LazyArray, LazyTable
flat = LazyArray.from_source(ArraySource.full((4, 3), 1.0))
cube = LazyArray.from_source(ArraySource.full((2, 3, 4), 2.0))
table = LazyTable.from_arrays([flat, cube])
assert [x.ndim for x in table] == [2, 3]LazyTable
LazyTable(
member_offsets: ndarray ,
axis_offsets: ndarray ,
shape_offsets: ndarray ,
shapes: ndarray ,
dtypes: _Column ,
concat_axes: ndarray ,
members: _Members ,
axes: collections.abc.Mapping[str, ndarray] ,
_ids: dict[int, str] =
)-> None
The storage many lazy arrays share.
Members of array k are the rows member_offsets[k]:member_offsets[k+1] of every member column, and its axis rows start at axis_offsets[k] in each flat placement array. Arrays of different ndim therefore sit in one table: the placement array is flat and ragged, one row per member per output axis, which is the shape the database tables take.
Every array here is read only, so views may share all of them and an id worked out once stays true.