Skip to content

feat(projects): add weather diagnostics toolkit#71

Merged
stacknil merged 1 commit into
mainfrom
codex/python-weather-diagnostics-toolkit
May 23, 2026
Merged

feat(projects): add weather diagnostics toolkit#71
stacknil merged 1 commit into
mainfrom
codex/python-weather-diagnostics-toolkit

Conversation

@stacknil
Copy link
Copy Markdown
Owner

Summary

  • Add projects/python-weather-diagnostics-toolkit, a public-safe Python mini-lab for ERA5-style weather-field diagnostics.
  • Include reusable modules for aliases, thermodynamics, dynamics, regional features, baseline modeling, synthetic fields, and ensemble summaries.
  • Add detailed reviewer-facing docs for calculation methods, diagnostic interpretation, data policy, reproducibility, sanitization, and source-to-public mapping.
  • Add a scoped CI workflow for the new weather toolkit and a root README entry that keeps sbom-diff-and-risk as the flagship release surface.

Validation

  • python -m pip install -e .[dev]
  • python -m pytest -> 9 passed
  • python -m compileall src scripts
  • python -m ruff check .
  • CLI smoke checks for run_thermodynamic_check.py, run_dynamics_summary.py, and run_synthetic_ensemble.py
  • Synthetic ensemble output generation to ignored outputs/

Privacy and Data Boundary

  • No raw weather datasets, NetCDF/GRIB/HDF files, course documents, generated binary figures, compressed archives, or local-machine artifacts are included.
  • Public examples are synthetic and labeled synthetic.
  • Candidate-file scan returned 0 restricted artifact files, 0 text privacy matches, and 0 non-ASCII text files.

@stacknil stacknil merged commit d3574bf into main May 23, 2026
2 checks passed
@stacknil stacknil deleted the codex/python-weather-diagnostics-toolkit branch May 23, 2026 08:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fffb0709de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

dlat = np.gradient(np.deg2rad(lat))
dlon = np.gradient(np.deg2rad(lon))
dy = EARTH_RADIUS_M * dlat
dx = EARTH_RADIUS_M * np.cos(np.deg2rad(lat))[:, None] * dlon[None, :]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle polar latitudes before dividing by dx

When latitude includes ±90° (common in ERA5-style grids), np.cos(np.deg2rad(lat)) becomes zero, so dx is zero and gradient_on_latlon divides by zero, producing inf/nan derivatives at the pole rows. This propagates directly into relative_vorticity and horizontal_advection, corrupting diagnostics for full-domain datasets that include poles. Please mask pole rows, exclude poles, or enforce a minimum nonzero zonal spacing before the division.

Useful? React with 👍 / 👎.

@stacknil
Copy link
Copy Markdown
Owner Author

Addressed the polar-latitude diagnostic comment in follow-up commit 78942f9. Exact pole rows now mask undefined zonal gradients as NaN, with a regression test covering +/-90 degree latitude rows and updated calculation-method notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant