computed
# Pre-computed data components
In order to make the API work, CF prepares some data and saves it in quick-load format. Most of this data are the features, but there is some extra data needed for the special functions of the `cfabric.parameters.WARP` features and the `cfabric.locality.Locality` API.
Normally, you do not use this data, but since it is there, it might be valuable, so we have made it accessible in the `cfabric.computed.Computeds`-API.
!!! explanation "Pre-computed data storage" Pre-computed data is stored in a `.cfm` directory (Context Fabric Mmap format) inside the directory where the `otype` feature is encountered.
The `.cfm` format uses memory-mapped numpy arrays for: - Shared memory across async workers - Reduced memory footprint - Near-zero startup time after initial compilation
Use `CF.compile()` to generate the `.cfm` directory from `.tf` source files. Subsequent calls to `CF.load()` will automatically use the compiled format.
Classes
BoundaryComputed
(Computed)C.boundary: first/last slot boundary data.
Computed
Provides access to pre-computed data.
Attributes
| Name | Type | Description |
|---|---|---|
| api | — | — |
| data | — | — |
Methods
__init__(self, api: Api, data: Any) → NoneParameters
api: Apidata: Any
Computeds
LevDownComputed
(Computed)C.levDown: embeddees of each node.
Attributes
| Name | Type | Description |
|---|---|---|
| is_cached | bool | Return True if data is cached in RAM. |
Methods
preload(self) → NonePreload embedding data into RAM for faster queries.
release(self) → NoneRelease cached RAM, returning to memory-mapped access.
LevUpComputed
(Computed)C.levUp: embedders of each node.
Attributes
| Name | Type | Description |
|---|---|---|
| is_cached | bool | Return True if data is cached in RAM. |
Methods
preload(self) → NonePreload embedding data into RAM for faster queries.
release(self) → NoneRelease cached RAM, returning to memory-mapped access.
LevelsComputed
(Computed)C.levels: node type hierarchy data.
OrderComputed
(Computed)C.order: nodes in canonical order.
RankComputed
(Computed)C.rank: canonical position of each node.