utils
Encode patches as Arrow IPC and decode them back.
One patch is one IPC stream or file whose single column, data, holds the patch’s values flattened in C order. Dims, shape, coordinates and attrs are a JSON document in the schema metadata under dascore:patch. The format is specified in dastor’s docs/arrow-patch-format.md.
Functions
| Name | Description |
|---|---|
| arrow_type | Return the Arrow type for a data dtype, refusing unsupported ones. |
| batch_values | Return a checked batch’s values as a numpy array (a view where possible). |
| coord_to_json | Write a coordinate as the format’s coordinate document. |
| data_batches | Yield the record batches holding a patch’s values, in first-dim slices. |
| document_meta | Return the data-less patch a checked document describes. |
| json_to_coord | Rebuild a coordinate from its document. |
| patch_document |
Return the dascore:patch document for a patch.
|
| read_document |
Return the checked dascore:patch document from an Arrow schema.
|