Store
store
Minimal zarr-v2 reader that fetches only the bytes a regional read needs.
The ARCO-ERA5 0.25 deg stores keep a global latitude x longitude field in each
chunk ([1, n_levels, 721, 1440]), so a small region never makes a chunk
smaller. Chunks are Blosc frames split into independently compressed blocks of
~512 KiB, i.e. bands of ~90 latitude rows of a single level. This reader
fetches the frame header, then only the block runs covering the requested
(level, latitude band) slabs, with HTTP range requests.
ArrayMeta
dataclass
Metadata of one zarr-v2 array.
Source code in packages/barograph-met/src/baro/met/store.py
fill
property
Fill value as a float (NaN when unset).
ByteStore
Bases: Protocol
Key/value byte access with optional [start, stop) ranges.
Source code in packages/barograph-met/src/baro/met/store.py
get(key, start=None, stop=None)
FileStore
Local directory store (tests, mirrored stores).
Source code in packages/barograph-met/src/baro/met/store.py
get(key, start=None, stop=None)
Object bytes, or the [start, stop) range of them.
Source code in packages/barograph-met/src/baro/met/store.py
HttpStore
Anonymous HTTP(S) access (honours HTTPS_PROXY), with retries.
Source code in packages/barograph-met/src/baro/met/store.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 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 | |
get(key, start=None, stop=None)
Object bytes, or the [start, stop) range of them.
Source code in packages/barograph-met/src/baro/met/store.py
MissingChunkError
TransferStats
dataclass
Thread-safe counters of what went over the wire.
Source code in packages/barograph-met/src/baro/met/store.py
add(nbytes, seconds)
Account for one request of nbytes bytes taking seconds.
snapshot()
Current counters as a dict.
ZarrStore
Consolidated zarr-v2 store with region reads over a ByteStore.
Source code in packages/barograph-met/src/baro/met/store.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | |
attrs
property
Root attributes of the store.
array(name)
Metadata of array name.
Source code in packages/barograph-met/src/baro/met/store.py
block_rows(name, lead)
Latitude rows per Blosc block of name, read from the chunk holding lead.
lead gives the leading (time, [level]) indices of an existing slab.
Blocks do not align with level slabs, so this is the typical height of
the latitude band one block holds, not an exact partition.
Source code in packages/barograph-met/src/baro/met/store.py
clear_decoded_cache()
configure_decoded_cache(max_bytes, *, immutable)
Retain exact decoded Blosc runs for explicitly immutable chunk keys.
Zero disables retention. Reconfiguration clears entries. The predicate must identify immutable objects in this reader's fixed store; mutable forecast chunks must never qualify. Do not replace the backing store without clearing/reconfiguring this cache. Payload bytes alone are bounded, excluding headers, temporary decoding and caller arrays.
Source code in packages/barograph-met/src/baro/met/store.py
decoded_cache_info()
read_1d(name, start=0, stop=None)
Values [start, stop) of a 1-D array (e.g. a coordinate).
Source code in packages/barograph-met/src/baro/met/store.py
read_rows(name, lead, rows, *, executor=None)
Read array[*lead_i, rows, :] for every leading index tuple in lead.
For an array (time, [level,] lat, lon) each lead_i gives the global
(time, level) (or (time,)) indices. The two trailing dimensions
must be stored unchunked (true for ARCO-ERA5 0.25 deg). Every header and
block-run request is independent and runs on executor if given.
Returns float32 of shape (len(lead), n_rows, n_lon).
Source code in packages/barograph-met/src/baro/met/store.py
list_s3(base, prefix, *, dirs, stats=None)
Keys (dirs=False) or sub-folder prefixes (dirs=True) under prefix.
S3 ListObjectsV2 over HTTP, following continuation tokens (a page holds
at most 1000 entries), under the per-host concurrency cap.