Skip to content

Add type hints and tests for therm_inert.py#40

Open
spencerahill wants to merge 1 commit into
masterfrom
type-hints-therm-inert
Open

Add type hints and tests for therm_inert.py#40
spencerahill wants to merge 1 commit into
masterfrom
type-hints-therm-inert

Conversation

@spencerahill

Copy link
Copy Markdown
Owner

Summary

First PR in the Tier-A autonomous queue (mechanical type hints + self-verifying tests). Pairs Roadmap 003 (type hints) and Roadmap 004 (testing) for therm_inert.py.

  • Annotate all six public functions with ArrayLike/float signatures, following the thermodynamics.py pattern (cast(ArrayLike, ...) on returns per the xarray-mypy house rule).
  • Add puffins.therm_inert to the mypy strict overrides in pyproject.toml.
  • Add test_therm_inert.py (26 tests): known values, physical limiting cases (damping → 0/1, phase lag → π/2 / 0, τ ∝ T⁻³), latitude-symmetry cancellation of the annual-cycle term, and scalar/ndarray/DataArray input handling.

Verification

  • mypy puffins/therm_inert.py: clean (only the pre-existing, unrelated budget_adj.py:69 error remains).
  • Full suite: 477 passed (was 451; +26), 1 skipped, 13 xfailed, under -W error::RuntimeWarning.
  • ruff check / ruff format: clean.

Tests are self-verifying (limiting behavior and internal algebraic identities), so no external paper-value lookups were needed — this stays firmly Tier A.

🤖 Generated with Claude Code

Annotate all six public functions in therm_inert.py with ArrayLike/float
signatures (Roadmap 003 Group 5) and add puffins.therm_inert to the mypy
strict overrides. Add test_therm_inert.py with 26 tests covering known
values, physical limiting cases (damping -> 0/1, phase lag -> pi/2 / 0),
and scalar/ndarray/DataArray input handling (Roadmap 004 Phase 5).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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