executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
statistics-and-extensionUse Earth2Studio statistics, metrics, perturbations, and component protocols to build and validate safe custom inference extensions.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when a request needs a reduction or verification metric, a custom prognostic/diagnostic/data source/assimilation/perturbation component, or a small workflow that composes those contracts. It targets Earth2Studio 0.18.0a0 public APIs and Python 3.11–3.14. It does not enumerate every model, data source, backend, or optional extra.
reduction_dimensions; use Statistic.x plus truth y; use Metric and validate the
non-ensemble axes before arithmetic.Perturbation; it receives and
returns a tensor/coordinate pair.Read the focused contracts before editing:
Treat a CoordSystem as an ordered mapping whose values describe tensor axes in
exactly the same order. batch is the first dynamic model axis when using
batch_coords()/batch_func(). Common public model axes are time,
lead_time, variable, lat, and lon; a prognostic has lead_time, while a
single-step diagnostic normally does not. Do not silently reorder axes to make a
broadcast work.
For every custom component:
input_coords() with fresh arrays and explicit Earth2Studio variable
names, physical units, and latitude/longitude conventions.handshake_dim and required values
with handshake_coords (or a deliberate equivalent for tabular schemas).output_coords from a copy, removing only reduced dimensions or changing
only the documented output fields. Every returned tensor axis needs a matching
coordinate variable of the same length.lead_time; a source must return xarray or DataFrame data with the required
metadata; DA may return multiple state/observation outputs.@batch_coords() and @batch_func() for ordinary tensor model patterns,
and use inference mode for inference-only perturbations/forwards.run.deterministic(time, nsteps, prognostic, data, io, output_coords=..., device=..., verbose=..., checkpoint=...),
run.diagnostic(..., diagnostic, data, io, ...), or
run.ensemble(..., nensemble, ..., perturbation, batch_size=..., ...).import torch
from earth2studio.statistics import lat_weight, mean, rmse
weights = lat_weight(torch.as_tensor(latitudes))
area_mean = mean(["lat"], weights=weights)
score = rmse(["lat", "lon"], weights=grid_weights,
ensemble_dimension="ensemble")
mean, variance, and std can maintain state with batch_update=True.
Metrics such as RMSE/MAE can reduce an ensemble mean when
ensemble_dimension is supplied. CRPS, rank histograms, and energy score expect
an ensemble axis in forecast x and no such axis in truth y. Use the exact
weight dimensionality and output-coordinate rules in the statistics reference.
From any directory, run the bundled checker by its installed skill path:
uv run python <skill-root>/scripts/contract_smoke.py --help
uv run python <skill-root>/scripts/contract_smoke.py --case all
When developing a custom component in your own project, run that project's focused tests in its managed environment after the bundled contract smoke. A missing optional Earth2Studio group is a limitation to report, not a reason to install an unbounded dependency set. See the testing reference for the local fixture expectations; the original repository's native test paths are review evidence, not runtime dependencies.
This sub-skill covers component implementation, statistics/metric axes and
weights, lexicon/time-tolerance conventions, focused tests, and safe local
validation. It intentionally excludes release/CI operations, package-wide
maintainer workflows, serving-client construction, exhaustive catalogues, and
remote data/model downloads. Preserve those limits in the downstream handoff.
Record native candidates and the two difficult synthetic cases: a diagnostic
whose returned coordinate mapping omits its output variable, and an ensemble
metric whose truth axes are reordered but retain a broadcastable shape.