You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the ty failures the state-conditioned field introduced
CI has been failing `ty` since 3dd6ef9 and I never saw it, because I skip the
hook locally (this worktree has no type-checking env). It is reachable with
`uvx ty@0.0.56 check --python <shared pylcm tree>/.pixi/envs/type-checking`.
36 diagnostics -> 0.
Two real annotation bugs of mine:
- `_get_conditioned_weights_func` read `sc.on` / `sc.by` off a
`StateConditioned | None` without narrowing, and the call site passed
`Grid | None` into a `DiscreteGrid | None` parameter. Both go away by passing
the regime's grid mapping plus the already-narrowed `StateConditioned`, and
resolving the conditioning grid inside — the same shape `next_state.py`
already uses, so the two seams now read alike.
- `_process_family` returned `str` where `conditioned_row` wants the `Family`
literal.
The rest are fallout in four test files that splat a kwargs table into a
process constructor with `**`. Those tables were annotated `dict[str, bool]` /
inferred as `dict[str, float]`, and only ever type-checked by luck: every
constructor parameter happened to accept a number (`bool` is an `int`, and
`mu`/`sigma` take `int | float | None`). `state_conditioned: StateConditioned |
None` is the first parameter that does not, so the checker started reporting a
possible landing. `Any` is the honest value type for a splat table; the
alternative was a dozen ignore comments.
Also adds the missing `log_level` to seven `Model.solve` calls in the
state-conditioned tests, which its overloads require.
66 targeted tests pass; the full suite runs on CI.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DW9D1WhLN8JhhiEPCScbaw
0 commit comments