Pre-built queries for common diagnostic plots and analysis.
All methods return pandas DataFrames for easy integration with matplotlib, seaborn, and other scientific Python libraries.
Attributes
Name
Type
Description
registry
The RunRegistry to query.
Examples
>>> queries = DiagnosticQueries(registry)>>># Time series at a location>>> df = queries.get_cell_timeseries(... longitude=-116.1,... latitude=33.9,... variable="treeCount",... )
Variable name to analyze (e.g., “treeCount”, “avg.height”).
required
param_name
str
Parameter name to group by. Use "label" to group by run labels assigned via registry.label_run(). If param_name isn’t a declared sweep parameter (i.e. not in registry.list_config_columns()), falls back to run-level attributes set via registry.set_attributes(run_hash, <param_name>=...).
required
step
int | None
Optional timestep filter (if None, groups by step).
None
aggregation
str
Aggregation function (AVG, MIN, MAX, SUM).
'AVG'
show_sql
bool
If True, print the SQL query for copy/paste modification.
False
Returns
Name
Type
Description
Any
DataFrame with columns: param_value, step, mean_value, std_value, n_cells.
Compute coefficient of variation for each replicate’s time series.
For each replicate: 1. Get spatially-averaged values at each timestep (after burn_in) 2. Compute CV = std(values) / mean(values) 3. Return inf if mean < extinction_threshold (extinction)
This is the correct way to measure stability - computing CV per replicate then averaging, rather than computing CV on cross-replicate means which can hide instability when replicates oscillate out of phase.
Parameters
Name
Type
Description
Default
variable
str
Export variable to analyze (e.g., “totalCover”)
required
run_hash
str
Run hash to filter by
required
burn_in
int
Steps to skip before measuring (default: 0)
0
extinction_threshold
float
Mean below this is considered extinction (default: 0.01)
0.01
Returns
Name
Type
Description
dict[str, Any]
Dict with keys:
dict[str, Any]
- ‘mean_cv’: Average CV across replicates (inf if any extinct)
dict[str, Any]
- ‘replicate_cvs’: List of per-replicate CVs (inf for extinct)
dict[str, Any]
- ‘n_replicates’: Number of replicates
dict[str, Any]
- ‘n_timesteps’: Timesteps per replicate after burn-in
dict[str, Any]
- ‘extinct_replicates’: List of replicate indices with extinction