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
Revert dual-backend Constraint.__call__ returns to ArrayLike
The np/jnp constraint methods (_CorrCholesky, _LowerCholesky, _L1Ball,
_PositiveDefinite, _PositiveSemiDefinite, _IndependentConstraint) can
return a numpy array on the numpy backend, so ty infers an
`np.ndarray | Array` union that the narrowed `-> Array` annotation
rejects. A blanket `# type: ignore` was unstable across numpy stub
versions: needed under numpy 2.5.0 (py3.14) but flagged unused under
numpy 2.4.6 (py3.11), failing lint on one Python version or the other.
Revert these overrides plus the base Constraint.__call__/check and the
two _validate_sample passthroughs to ArrayLike, which typechecks under
both numpy versions. The ~20 pure-jnp constraint overrides keep their
narrowed -> Array (a valid covariant override).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments