Session
session
Persistent, bounded decoded-cube reuse for successive trajectory queries.
WeatherSession
Reuse decoded weather across successive point queries, without extrapolation.
source supplies a fixed set of fields. Optional fields selects a
subset through its select_fields capability (currently GridSource);
unsupported sources must be configured with their own field selection.
vertical is required: choose "linear" or "log" in pressure.
The LRU budget bounds retained array payload, including coordinates, not
Python overhead or temporary cubes held by the active enrichment call.
Calls on one session are serialized; its normal source I/O stays parallel.
Treat a session as a snapshot: call :meth:clear to refresh decoded mutable
forecasts or ERA5T. The existing on-disk byte cache retains its own rules.
Do not mutate the source configuration while using the session.
Source code in packages/barograph-met/src/baro/met/session.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 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 | |
cache_info()
Retained array bytes, entry count and lifetime LRU counters.
Source code in packages/barograph-met/src/baro/met/session.py
clear()
Release decoded arrays after any active call; preserve lifetime counters.
sample(time_utc, lat, lon, *, pressure_pa)
Sample 1-D points using nanosecond time and explicit pressure in Pa.
Missing coverage retains Enricher flags; callers must check valid
before interpreting missing meteorology as a physical disappearance.
Time interpolation divides integer timedelta differences, never floating
epoch hours, preserving subsecond weights at modern dates.