feat(weather): add precipitation and climate diagnostics#73
Conversation
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Validation
Privacy and Data Boundary