climate_ref.results.values
#
Typed, ORM-free surface for metric-value results.
Reader is the intent-named entry point that notebooks
and (eventually) the API use, via its values
sub-reader.
ValuesReader's read methods return frozen,
detached value objects wrapped in collections that offer to_pandas().
The objects are fully materialised, so they remain valid after the originating session closes.
A notebook can build a DataFrame inside a with Database(...) block and keep using it afterwards.
Everything here is a thin layer over climate_ref.results._query
(the shared Select builders) and climate_ref.results.outliers.
power users who need the raw Select or ORM rows use those modules directly.
Facet
#
Distinct values observed for one CV dimension across a filtered query.
Source code in packages/climate-ref/src/climate_ref/results/values.py
Reader
#
Typed entry point to REF query results.
Constructed from a Database, which owns the session and the
read-only story. This is a thin entry point: it exposes per-domain sub-readers as properties,
values for metric-value reads,
executions for execution-group reads,
datasets for dataset reads,
diagnostics for diagnostic reads, and
artifacts for output path resolution
(only available when a results root is supplied).
Source code in packages/climate-ref/src/climate_ref/results/values.py
artifacts
cached
property
#
Output path resolution.
Raises ValueError when no results root was supplied to the constructor.
datasets
cached
property
#
Dataset reads.
diagnostics
cached
property
#
Diagnostic reads.
executions
cached
property
#
Execution-group and execution reads.
session
property
#
The underlying database session.
values
cached
property
#
Metric-value reads (scalar/series/facets).
ScalarValue
#
A single scalar metric value, detached from the ORM.
Source code in packages/climate-ref/src/climate_ref/results/values.py
attributes
instance-attribute
#
Free-form, non-CV attributes attached to the row.
diagnostic_slug = None
class-attribute
instance-attribute
#
Owning diagnostic's slug, populated only when include_context=True.
dimensions
instance-attribute
#
CV dimension values (e.g. source_id, statistic, metric) for this row.
kind is excluded here and surfaced as the dedicated kind field instead.
execution_group_id
instance-attribute
#
The execution group the producing execution belongs to.
execution_id
instance-attribute
#
The execution that produced this value.
id
instance-attribute
#
Primary key of the underlying ScalarMetricValue row.
is_outlier = None
class-attribute
instance-attribute
#
Per-row outlier verdict; None unless outlier detection ran.
kind
instance-attribute
#
Model/reference kind, resolved from the kind CV dimension (defaults to "model").
provider_slug = None
class-attribute
instance-attribute
#
Owning provider's slug, populated only when include_context=True.
value
instance-attribute
#
The scalar value itself.
verification_status = None
class-attribute
instance-attribute
#
"verified"/"unverified" status paired with is_outlier; None unless detection ran.
ScalarValueCollection
#
An immutable page of scalar values plus collection-level, outlier-aware metadata.
Source code in packages/climate-ref/src/climate_ref/results/values.py
facets
instance-attribute
#
Distinct CV dimension values observed over the full filtered set, before pagination.
had_outliers
instance-attribute
#
Whether outlier detection ran and flagged at least one value.
items
instance-attribute
#
The scalar values on this page.
limit
instance-attribute
#
Page size requested, or None when the whole result was returned.
offset
instance-attribute
#
Rows skipped before this page.
outlier_count
instance-attribute
#
Number of values flagged as outliers, or 0 when detection did not run.
total_count
instance-attribute
#
Total values matching the filter before offset/limit (after outlier removal, if any).
facets_dict()
#
to_pandas()
#
Tidy DataFrame: one row per value, one column per CV dimension present, plus metadata.
Source code in packages/climate-ref/src/climate_ref/results/values.py
SeriesValue
#
A 1-d series metric value, detached from the ORM. The index is snapshotted from the shared axis.
Source code in packages/climate-ref/src/climate_ref/results/values.py
attributes
instance-attribute
#
Free-form, non-CV attributes attached to the row.
diagnostic_slug = None
class-attribute
instance-attribute
#
Owning diagnostic's slug, populated only when include_context=True.
dimensions
instance-attribute
#
CV dimension values (e.g. source_id, statistic, metric) for this row.
kind is excluded here and surfaced as the dedicated kind field instead.
execution_group_id
instance-attribute
#
The execution group the producing execution belongs to.
execution_id
instance-attribute
#
The execution that produced this value.
id
instance-attribute
#
Primary key of the underlying SeriesMetricValue row.
index
instance-attribute
#
The shared index axis values, snapshotted at read time.
index_name
instance-attribute
#
Name of the shared index axis (e.g. a time or latitude label).
is_reference
property
#
True for observation/reference series (reference_id is set).
kind
instance-attribute
#
Model/reference kind, resolved from the kind CV dimension (defaults to "model").
provider_slug = None
class-attribute
instance-attribute
#
Owning provider's slug, populated only when include_context=True.
reference_id
instance-attribute
#
Set for observation/reference series; None for model series.
values
instance-attribute
#
The series' y-values, in index order.
SeriesValueCollection
#
An immutable page of series values plus collection-level metadata.
Source code in packages/climate-ref/src/climate_ref/results/values.py
facets
instance-attribute
#
Distinct CV dimension values observed over the full filtered set, before pagination.
items
instance-attribute
#
The series values on this page.
limit
instance-attribute
#
Page size requested, or None when the whole result was returned.
offset
instance-attribute
#
Rows skipped before this page.
total_count
instance-attribute
#
Total values matching the filter before offset/limit.
facets_dict()
#
to_pandas(*, explode=True)
#
DataFrame of the series values.
With explode=True (default) the result is long-form: one row per (series, index point),
matching the API's CSV shape. With explode=False each series is one row with list-valued
values/index cells.
Source code in packages/climate-ref/src/climate_ref/results/values.py
ValuesReader
#
Metric-value read domain: scalar/series values and their facets.
Constructed from a Database, which owns the session and the read-only story. All read methods return detached collections that outlive the session.
Source code in packages/climate-ref/src/climate_ref/results/values.py
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 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 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 | |
session
property
#
The underlying database session.
scalar_values(filters=None, *, outliers=None, include_unverified=False, offset=0, limit=None, with_facets=True, include_context=False)
#
Query scalar values, returning an outlier-aware collection.
When outlier detection is disabled (the default) pagination and counting happen in SQL,
so cost scales with the requested page rather than the whole result set. When outliers
is enabled, detection runs over the FULL filtered set so IQR bounds are globally
consistent; with include_unverified False, flagged values are then removed before
pagination and excluded from total_count. facets are always computed over the full
filtered set (before any outlier removal and pagination).
Source code in packages/climate-ref/src/climate_ref/results/values.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | |
series_values(filters=None, *, offset=0, limit=None, with_facets=True, include_context=False)
#
Query series values with SQL-level pagination.
The shared index axis is resolved so index/index_name are populated. facets are
computed over the full filtered set before pagination.