earth2studio-create-diagnostic
Skill1.2k starsChanged 4 months agoApache-2.0View on GitHub
Create Earth2Studio diagnostic model wrappers for single-step data transformations, including simple derived diagnostics, packaged AutoModel diagnostics, and generative or diffusion diagnostics. Do NOT use for prognostic time-stepping models, data sources, or installation.
Trending
Less talk lately.about the whole repository
Who's talking about NVIDIA/earth2studio
- A Hacker News story“Earth2Studio: Nvidia's next generation of weather AI”Hacker News · Jan 26, 2026 · 5 points
- @rodrigo-gtiff.bsky.social“8/ 🛠️ A shout-out to @nvidiabot.bsky.social Earth2Studio — all model predictions in this study ran through …”Bluesky · Jul 21, 2026 · 1 likes
- NVIDIA/physicsnemo“Add torch support to zenith_angle.py”GitHub · Jun 16, 2026 · 1 reactions
- @pythonhub.dev“earth2studio Open-source deep-learning framework for exploring, building and deploying AI weather/climate …”Bluesky · Feb 5, 2026 · 1 likes
- secondlaw-ai/skyrim“Hello from Earth2Studio”GitHub · May 8, 2024 · 1 reactions
The biggest 5 of 16 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 16
Talked about on GitHub, Bluesky and Hacker News (16 times).
On GitHub · 13
- Jun 16, 2026Add torch support to zenith_angle.py — NVIDIA/physicsnemo1 reaction · 3 comments
- May 8, 2024Hello from Earth2Studio — secondlaw-ai/skyrim1 reaction · 1 comment
- Oct 1, 2026python3Packages.earth2studio: 0.18.0 -> 0.19.0 — NixOS/nixpkgs0 reactions · 1 comment
- Sep 7, 2026Expand NVIDIA Earth-2 source coverage beyond FourCastNet prototype — TusharSariya/Astraeus0 reactions · 1 comment
- Sep 2, 2026Generative downscaling of CMIP6 (CorrDiff-style) to daily catchment forcing for the climate playbook — Rekin226/aquascope0 reactions
8 more on GitHub
- Aug 18, 2026Consider serializing to Icechunk format — gaia-hazlab/gaia-cli0 reactions
- Jul 4, 2026Insitubatch — emfdavid/earth2studio0 reactions · 1 comment
- Nov 7, 2025[Ecosystem] Nvidia PhysicsNeMo — pytorch-fdn/ecosystem0 reactions · 9 comments
- Sep 30, 2025Add support for NVIDIA ML-based forecast models — google-research/weatherbenchX0 reactions · 2 comments
- Sep 10, 2025Create nvidia earth studio 2 environment for JASMIN — MetOffice/data_science_cop0 reactions · 1 comment
- Aug 7, 2025Adding seed set to infill method (do not merge) — NVlabs/cBottle0 reactions · 2 comments
- Jan 31, 2025px-cdn.net — mypdns/matrix0 reactions · 1 comment
- May 27, 2024Add Earth2Studio — protontypes/open-sustainable-technology0 reactions · 1 comment
On Bluesky · 2
- Jul 21, 20268/ 🛠️ A shout-out to @nvidiabot.bsky.social Earth2Studio — all model predictions in this study ran through it. Having a single open-source… — @rodrigo-gtiff.bsky.social1 likes and repost
- Feb 5, 2026earth2studio Open-source deep-learning framework for exploring, building and deploying AI weather/climate workflows.… — @pythonhub.dev1 likes and repost
On Hacker News · 1
- Jan 26, 2026Earth2Studio: Nvidia's next generation of weather AI5 points · 1 comment
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- developer-bump-versionSkill
- developer-release-rebaseSkill
- earth2studio-create-datasourceSkill
- earth2studio-create-prognosticSkill
- earth2studio-data-fetchSkill
- earth2studio-deterministic-forecastSkill
- earth2studio-discoverSkill
- earth2studio-installSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
40 rules. About 0 are common, 13 are distinctive, and 27 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
27
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Do these steps in order. Do not skip ahead.
- Very specific: line 36
Use uv run pytest ... and uv run python ...
- Very specific: line 37
Do not use bare pytest or python in repo workflows
- Distinctive: line 39
If the generated model is wrong, do not keep retrying the same fix.
- Very specific: line 59
Does not support time-stepping forecast models.
- Very specific: line 79
Never read evals/targets/.
- Very specific: line 98
If $ARGUMENTS provides a URL or local path, use it.
- Very specific: line 119
Add the extra alphabetically under [project.optional-dependencies] and include it in the all aggregate.
- Very specific: line 120
Use the model-extra name in OptionalDependencyFailure("model-extra") and @check_optional_dependencies().
- Very specific: line 133
After approval, edit pyproject.toml:
- Distinctive: line 135
Add the extra alphabetically.
- Very specific: line 136
Update the all aggregate.
- Distinctive: line 137
Prefer minimum supported versions from the reference package documentation.
- Distinctive: line 138
Do not add broad unpinned Git dependencies unless the reference model requires them and the user approves.
- Distinctive: line 144
Use the repo-standard SPDX/license header shown in existing model files.
- Distinctive: line 178
Avoid shared base classes or broad abstractions unless the wrapper naturally has multiple closely related variants where a small base class …
- Very specific: line 190
No diagnostic wrapper should expose lead_time.
- Very specific: line 200
Use a single-step __call__.
- Very specific: line 223
Use weights_only=False only when loading a pickled full PyTorch object is required.
- Very specific: line 225
Use loguru.logger for useful loading messages.
- Very specific: line 240
Use references/testing-guide.py.
- Distinctive: line 250
Do not omit package tests for packaged models.
- Very specific: line 264
Add to docs/modules/models_dx.md alphabetically so API docs include the generated page.
- Very specific: line 265
Add an entry to docs/userguide/about/install_options.yml if a model extra exists.
- Very specific: line 266
Update CHANGELOG.md under ### Added.
- Very specific: line 276
Follow references/validation-guide.md.
- Distinctive: line 282
Ask the user to visually inspect plots before proceeding.
- Very specific: line 286
Follow references/validation-guide.md and use:
- Very specific: line 291
Before creating the PR, verify dependency extras, all, install docs, API docs, changelog, tests, and validation artifacts are consistent.
- Very specific: line 338
Use uv run python and uv run pytest for all Python commands.
- Very specific: line 339
Use @batch_coords() on output_coords.
- Very specific: line 340
Use @torch.inference_mode() and @batch_func() on __call__.
- Very specific: line 341
Keep batch as the first coordinate with np.empty(0) in input_coords.
- Very specific: line 343
Add sample in generative output_coords.
- Very specific: line 345
Use loguru.logger, never print(), inside earth2studio/.
- Distinctive: line 352
Create general base classes for a single wrapper without a clear multi-variant need.
- Distinctive: line 353
Commit API keys, credentials, validation scripts, plots, or generated outputs.
- Distinctive: line 358
If this skill produces incorrect outputs, update it before continuing:
- Distinctive: line 362
Run focused validation for the changed skill files.
- Distinctive: line 363
Commit the skill fix separately when working in a branch that expects commits.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Quick Start Checklist
Do these steps in order. Do not skip ahead. Before editing, read this SKILL.md and load the relevant reference files for the model type. After implementation, run the focused pytest command before saying tests pass. If tests cannot run, report the exact command and failure instead of claiming success.
- Read this SKILL.md completely first
- Get the reference script, repo, paper, or model documentation (Step 0)
- Classify the diagnostic as simple, AutoModel, or generative (Step 1)
- Propose dependency extras before editing dependency files (Step 1)
- Create
earth2studio/models/dx/<name>.pywith diagnostic-only APIs - Create
test/models/dx/test_<name>.pywith mock tests - Run:
uv run pytest test/models/dx/test_<name>.py -m "not package" -v - Add/update model extra, install docs, API docs, and changelog when required
- Run:
make format && make lint && make license
Critical command rule: always use uv run for Python commands:
- Use
uv run pytest ...anduv run python ... - Do not use bare
pytestorpythonin repo workflows
If the generated model is wrong, do not keep retrying the same fix. Follow Self-Improvement, patch this skill or its references, then continue with the corrected workflow.
Purpose
Implement a diagnostic model wrapper connecting third-party or derived ML transforms to Earth2Studio. Diagnostic models transform data at a single time point: input fields in, output fields out, no forecast integration.
Prerequisites
- Earth2Studio installed via
uvwith dev dependencies (uv sync --all-extras) - Python 3.10+ environment
- Reference inference script, repo, paper, or model documentation
- Checkpoint source and license information for packaged models
Limitations
- Handles single-step transformations only
- Does not support time-stepping forecast models; use
earth2studio-create-prognostic - Real package tests can require network access to NGC, HuggingFace, S3, or other registries
- Generative validation can require GPU and fixed seeds for meaningful comparison
Diagnostic Model Types
| Type | Inheritance | Dependency extra | Example |
| Simple derived diagnostic | torch.nn.Module only | Usually none | Identity, wind speed |
| Packaged AutoModel diagnostic | torch.nn.Module, AutoModelMixin | Required, even if empty | PrecipitationAFNO |
| Generative diagnostic | torch.nn.Module, AutoModelMixin | Required, even if empty | CorrDiff |
Workspace
| Context | Location |
| Harbor eval | Write to /workspace/output/earth2studio/models/dx/... |
Harbor + --copy-repo | Full checkout at /workspace/repo |
| Local clone | Directory with pyproject.toml |
Never read evals/targets/; those files are grader references only.
Reference Files
Load these files on demand during the matching workflow:
| File | Content | Load at |
references/skeleton-template.py | Full diagnostic skeletons for simple, AutoModel, and generative wrappers | Steps 3-6 |
references/method-templates.py | Focused coordinate, loading, forward, and device method snippets | Steps 4-6 |
references/testing-guide.py | Mock, package, exception, sample, and seed test patterns | Step 7 |
references/validation-guide.md | Reference comparison, plots, PR hygiene, and review follow-up | Steps 10-11 |
references/pr-body-template.md | PR body template | Step 11 |
references/pr-comment-template.md | Validation comment template | Step 11 |
Instructions
Step 0 - Get Reference Material
If $ARGUMENTS provides a URL or local path, use it. Otherwise ask:
Please provide a reference inference script, repository, paper, or model documentation.
Capture the reference model's input variables, output variables, tensor shapes, normalization, grid, checkpoint source, dependency requirements, and license.
Step 1 - Analyze Type and Propose Dependencies
Classify the requested diagnostic before editing files:
| If the model... | Then use... |
| Computes a derived quantity with no checkpoint | Simple diagnostic |
Loads weights from Package or an external checkpoint | AutoModel diagnostic |
| Produces multiple samples, diffusion outputs, VAE samples, or stochastic super-resolution | Generative diagnostic |
Dependency policy:
- Simple derived diagnostics usually do not need a
pyproject.tomlextra. - AutoModel and generative diagnostics must have a named optional dependency extra, even if the list is empty.
- Add the extra alphabetically under
[project.optional-dependencies]and include it in theallaggregate. - Use the model-extra name in
OptionalDependencyFailure("model-extra")and@check_optional_dependencies().
Present the proposed dependency extra and ask the user to approve before editing
pyproject.toml:
model-name = ["package1>=version", "package2"]
# or, when the packaged diagnostic needs no extra runtime packages:
model-name = []Step 2 - Add Dependencies
After approval, edit pyproject.toml:
- Add the extra alphabetically.
- Update the
allaggregate. - Prefer minimum supported versions from the reference package documentation.
- Do not add broad unpinned Git dependencies unless the reference model requires them and the user approves.
Step 3 - Create Model File
File: earth2studio/models/dx/<lowercase>.py
Use the repo-standard SPDX/license header shown in existing model files.
Simple diagnostic imports commonly include:
from collections import OrderedDict
import numpy as np
import torch
from earth2studio.models.batch import batch_coords, batch_func
from earth2studio.utils import handshake_coords, handshake_dim
from earth2studio.utils.type import CoordSystemPackaged and generative diagnostics commonly also include:
from earth2studio.models.auto import AutoModelMixin, Package
from earth2studio.models.dx.base import DiagnosticModel
from earth2studio.utils.imports import OptionalDependencyFailure, check_optional_dependencies
from loguru import loggerCanonical method order:
__init__input_coordsoutput_coordsdecorated with@batch_coords()__str__if usefulload_default_packagefor AutoModel/generative diagnosticsload_modelfor AutoModel/generative diagnosticstoonly when non-PyTorch state must move devices- Private/support methods
__call__decorated with@torch.inference_mode()and@batch_func()
Avoid shared base classes or broad abstractions unless the wrapper naturally has multiple closely related variants where a small base class reduces duplication.
Step 4 - Implement Coordinates
Diagnostic input coordinates usually use this public Earth2Studio order:
batch:np.empty(0)and first in theOrderedDictvariable: input variable names using Earth2Studio vocabulary nameslat: public latitude convention north-to-south, usually90to-90lon: public longitude convention0to360, endpoint normally false
No diagnostic wrapper should expose lead_time. If a diagnostic needs validity
time metadata, document it as per-sample metadata in coords["time"]; do not make
it a tensor dimension unless an existing dx pattern requires it.
output_coords must validate inputs with handshake_dim and handshake_coords.
Then update output variables and, when needed, output lat/lon resolution.
Generative diagnostics must add a sample dimension after batch.
Step 5 - Implement Forward Pass
Use a single-step __call__; never create an iterator. Validate coordinates
before model execution, then return (output_tensor, output_coords).
@torch.inference_mode()
@batch_func()
def __call__(self, x: torch.Tensor, coords: CoordSystem) -> tuple[torch.Tensor, CoordSystem]:
output_coords = self.output_coords(coords)
x = (x - self.center) / self.scale
out = self.core_model(x)
return out, output_coordsFor generative diagnostics, loop over the batch dimension and generate
number_of_samples per input item. Use explicit seeds for reproducibility when
the reference implementation supports seeded sampling.
Step 6 - Implement Model Loading
For packaged diagnostics:
load_default_packageshould lock HuggingFace URLs to a commit (hf://org/repo@commit) or NGC/S3 versions to an immutable release.load_modelshould callpackage.resolve(...), load checkpoints on CPU first, set modules toeval(), and disable gradients where appropriate.- Use
weights_only=Falseonly when loading a pickled full PyTorch object is required. - Decorate optional model classes and
load_modelwith@check_optional_dependencies(). - Use
loguru.loggerfor useful loading messages; do not useprint()insideearth2studio/.
Step 7 - Write Tests
File: test/models/dx/test_<name>.py
Required tests:
| Function | Purpose |
test_<model>_call | Forward pass with mock or simple model |
test_<model>_exceptions | Invalid coordinate order, values, or variables raise errors |
test_<model>_package | Real weights with @pytest.mark.package for AutoModel/generative diagnostics |
Generative diagnostics also require sample-count and deterministic-seed tests.
Use references/testing-guide.py. Create a Phoo<ModelName> dummy that matches
the real core model's interface and produces deterministic output.
Run focused tests:
uv run pytest test/models/dx/test_<name>.py -m "not package" -v
uv run pytest test/models/dx/test_<name>.py::test_<model>_package --package -vDo not omit package tests for packaged models. If arbitrary random inputs are not physically valid for the real checkpoint, build a stable model-appropriate input while still loading real weights and running a forward pass.
Step 8 - Register Model
For public models, update earth2studio/models/dx/__init__.py alphabetically.
Skip registration only when the user explicitly wants an internal or experimental
file that should not be exported.
Step 9 - Documentation
For public models:
- Add to
docs/modules/models_dx.mdalphabetically so API docs include the generated page. - Add an entry to
docs/userguide/about/install_options.ymlif a model extra exists. Include model notes, source-specific preinstall commands, andapi_refsfor any model classes that should show a View Install Notes button in the generated API docs. - Update
CHANGELOG.mdunder### Added.
Format and lint:
make format && make lint && make licenseStep 10 - Validation (if requested)
Follow references/validation-guide.md. Create uncommitted vanilla,
Earth2Studio, comparison, and sanity-check scripts. Do not commit generated
outputs, checkpoints, images, or local validation scripts.
For generative diagnostics, fix seeds and compare matching samples or report statistical/tolerance-based agreement when exact equality is impossible. Ask the user to visually inspect plots before proceeding.
Step 11 - PR (if requested)
Follow references/validation-guide.md and use:
references/pr-body-template.mdreferences/pr-comment-template.md
Before creating the PR, verify dependency extras, all, install docs, API docs,
changelog, tests, and validation artifacts are consistent. Do not include machine
names, hostnames, absolute paths, cache paths, device inventory, or uploaded image
links in PR text. Use plot placeholders for manual image upload.
Examples
Simple Diagnostic
User: Create a diagnostic that computes wind speed from u10m and v10m.
Agent: Reads SKILL.md, classifies as simple, creates windspeed.py with only
torch.nn.Module, writes call and exception tests, runs focused pytest.AutoModel Diagnostic
User: Add a precipitation estimator from this reference script.
Agent: Reads SKILL.md and references, proposes dependency extra, creates a
torch.nn.Module + AutoModelMixin wrapper, writes mock/package tests,
updates docs/changelog/dependencies, and runs validation commands.Generative Diagnostic
User: Wrap this diffusion super-resolution model.
Agent: Classifies as generative, adds sample output coordinates, supports seed
handling, writes sample and deterministic-seed tests, and prepares seeded
validation comparisons.Troubleshooting
| Error | Solution |
OptionalDependencyFailure | Install with uv sync --extra <model-extra> or fix the extra name |
| Coordinate handshake fails | Check OrderedDict order and handshake_dim indices |
| Wrong output shape | Verify output_coords lengths match returned tensor shape |
ModuleNotFoundError: pytest | Use uv run pytest, not bare pytest |
| Package test fails on random input | Use a stable physically plausible input while still loading real weights |
Reminders
Do:
- Use
uv run pythonanduv run pytestfor all Python commands. - Use
@batch_coords()onoutput_coords. - Use
@torch.inference_mode()and@batch_func()on__call__. - Keep
batchas the first coordinate withnp.empty(0)ininput_coords. - Validate coordinates with
handshake_dim()andhandshake_coords(). - Add
samplein generativeoutput_coords. - Include the repo-standard SPDX/license header in every Python file.
- Use
loguru.logger, neverprint(), insideearth2studio/.
Do not:
- Inherit from
PrognosticMixin. - Include
lead_timecoordinates. - Create
create_iterator. - Create general base classes for a single wrapper without a clear multi-variant need.
- Commit API keys, credentials, validation scripts, plots, or generated outputs.
- Read from
evals/targets/.
Self-Improvement
If this skill produces incorrect outputs, update it before continuing:
- Identify the issue in the generated code or workflow.
- Edit
SKILL.mdor the relevant file inreferences/to fix the guidance. - Run focused validation for the changed skill files.
- Commit the skill fix separately when working in a branch that expects commits.
- Continue the model implementation with the corrected workflow.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

