Skip to content

feat(weather): add precipitation and climate diagnostics#73

Merged
stacknil merged 1 commit into
mainfrom
codex/weather-toolkit-source-doc-enrichment
May 23, 2026
Merged

feat(weather): add precipitation and climate diagnostics#73
stacknil merged 1 commit into
mainfrom
codex/weather-toolkit-source-doc-enrichment

Conversation

@stacknil
Copy link
Copy Markdown
Owner

Summary

  • Extend the weather diagnostics toolkit with public-safe methods abstracted from the local source-document themes.
  • Add station missing-value handling, IDW station-to-grid interpolation, accumulated-precipitation conversion, event totals, and threshold masks.
  • Add climate-statistics helpers for anomalies, standardized anomalies, composites, and grid-point Pearson correlations.
  • Add moisture flux divergence, specific-humidity alias support, two synthetic CLI summaries, expanded examples, and reviewer-facing documentation.

Validation

  • python -m ruff check .
  • python -m pytest -> 30 passed
  • python -m compileall src scripts
  • CLI help smoke checks for thermodynamic, dynamics, precipitation, climate-statistics, and ensemble scripts
  • Synthetic precipitation and climate-statistics scripts executed successfully

Privacy and Data Boundary

  • Candidate-file scan returned 0 restricted artifact files, 0 text privacy matches, and 0 non-ASCII text files.
  • No raw weather datasets, station files, course documents, compressed archives, generated binary artifacts, original report text, or local-machine materials are included.
  • New examples are synthetic and documented as synthetic.

@stacknil stacknil merged commit cbba6f1 into main May 23, 2026
2 checks passed
@stacknil stacknil deleted the codex/weather-toolkit-source-doc-enrichment branch May 23, 2026 10:20
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: 290e6a4f8a

ℹ️ 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".

def mark_missing_sentinel(values, *, sentinel: float = -32766.0) -> np.ndarray:
"""Replace a numeric missing-value sentinel with NaN."""

array = np.asarray(values, dtype=float)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use exact sentinel matching for missing-value code

mark_missing_sentinel uses np.isclose(array, sentinel) with NumPy’s default relative tolerance, which is very wide for a large sentinel like -32766 (about ±0.32766). That means valid values near the sentinel (e.g., -32765.8) are silently converted to NaN, corrupting downstream interpolation/threshold diagnostics whenever source data are scaled or rounded around the missing code. For sentinel-coded data this should be exact equality (or at most a tiny absolute tolerance) rather than relative tolerance.

Useful? React with 👍 / 👎.

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