Trackers API
ArrayTracker
Bases: BaseTracker
A tracker optimized for resolving sequences and unstructured arrays of IDs.
Source code in src/packed_data_structures/trackers.py
BaseTracker
Bases: ABC
Base class for explicit ID reification trackers.
Trackers are used to map original or staged IDs to their final physical locations after a transaction has committed.
Source code in src/packed_data_structures/trackers.py
query
abstractmethod
Queries the final physical ID of a single specific original ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
original_id
|
int
|
The original ID to lookup. |
required |
Returns:
| Type | Description |
|---|---|
generic
|
np.generic: The physical ID mapped to the table's index dtype. |
Source code in src/packed_data_structures/trackers.py
query_array
abstractmethod
Queries the final physical IDs of a bulk list of original IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
original_ids
|
ndarray
|
The original IDs to lookup. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: The physical IDs mapped to the table's index dtype. |
Source code in src/packed_data_structures/trackers.py
reify
abstractmethod
Returns the fully mapped IDs as a new, explicit copy.
Returns:
| Type | Description |
|---|---|
ndarray | generic
|
np.ndarray | np.generic: The fully mapped IDs in a new array or scalar. |
RangeTracker
Bases: BaseTracker
A tracker mathematically optimized for Python range objects.
Particularly efficient for O(1) tracking of newly staged IDs.
Source code in src/packed_data_structures/trackers.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
SingleTracker
Bases: BaseTracker
A tracker optimized for resolving a single specific ID.