oslots
# Access to `oslots` feature data.
In general, features are stored as dictionaries, but this specific feature has an optimised representation. Since it is a large feature and present in any CF dataset, this pays off.
Supports two backends: - Dict-based tuple format (.tf loading): data = (slots_tuple, maxSlot, maxNode) - CSR array format (.cfm loading): data = CSRArray instance
Classes
class
OslotsFeature
Attributes
| Name | Type | Description |
|---|---|---|
| _data | tuple[(tuple[(int, ...)], ...)] | CSRArray | — |
| _is_mmap | bool | — |
| api | Api | — |
| data | tuple[(tuple[(int, ...)], ...)] | CSRArray | Access to raw slots data. |
| maxNode | int | None | — |
| maxSlot | int | None | — |
| meta | dict[(str, str)] | Metadata of the feature. |
Methods
__init__(self, api: Api, metaData: dict[(str, str)], data: tuple[(tuple[(tuple[(int, ...)], ...)], int, int)] | CSRArray, maxSlot: int | None = None, maxNode: int | None = None) → NoneInitialize OslotsFeature with either dict-based or CSR backend.
Parameters
api: ApimetaData: dict[(str, str)]data: tuple[(tuple[(tuple[(int, ...)], ...)], int, int)] | CSRArraymaxSlot: int | None= NonemaxNode: int | None= None
items(self) → Iterator[tuple[(int, tuple[(int, ...)])]]A generator that yields the non-slot nodes with their slots.
s(self, n: int) → tuple[(int, ...)]Get the slots of a (non-slot) node.
Parameters
n: int