Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates type annotations across Frontx (core solvers, inverse routines, and tests/examples) to resolve ty type-checker errors by removing Any usage, tightening array/Callable signatures, and adding a few targeted ty: ignore[...] suppressions.
Changes:
- Replace broad
np.ndarray[Any, Any]annotations with more specific NumPy/JAX array typings across the public API and tests. - Adjust several return/parameter types to
jax.Array(or unions including it) to better reflect JAX-centric execution. - Add/adjust
ty: ignore[...]comments where library stubs or overload resolution still conflict with intended usage.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_neural/test_exact.py | Updates test helper typing for PINN diffusivity callable. |
| tests/test_finite.py | Tightens Callable type for parametrized diffusivity models used by the finite solver tests. |
| src/frontx/neural.py | Refines PINN and training API annotations; aligns several internal training values with JAX types. |
| src/frontx/models.py | Updates model callable signatures and parameter field types to include jax.Array and narrower NumPy dtypes. |
| src/frontx/finite.py | Refines solver/fit API typings and the Diffrax term typing; adjusts several outputs to jax.Array. |
| src/frontx/examples/neural/grenoblesand.py | Adds a ty suppression for example-only attribute access. |
| src/frontx/examples/neural/exact.py | Updates example diffusivity callable typing and removes unused Any. |
| src/frontx/_util.py | Simplifies vmap typing by removing overloads and using a single precise signature. |
| src/frontx/_inverse/sorptivity.py | Tightens input typing and allows scalar parameters to be jax.Array. |
| src/frontx/_inverse/param.py | Updates Param bounds typing and broadens some typing around optimizer integration. |
| src/frontx/_inverse/interpolated.py | Tightens array typing for interpolated solution construction and evaluation. |
| src/frontx/_inverse/fit.py | Refines inverse-fit signatures (including max_steps) and several call/return types. |
| src/frontx/_forward.py | Tightens callable signatures and adjusts several property return types to jax.Array. |
| src/frontx/_boltzmann.py | Refines Boltzmann transform overloads and AbstractSolution typing around callable solution evaluation. |
Suppressed comments (1)
src/frontx/finite.py:199
max_stepsis forwarded tode_fit(...), which ultimately passes it to SciPy'sdifferential_evolution(maxiter=...)and requires a Pythonint. Allowingjax.Arrayhere can lead to runtime type errors.
max_steps: int | jax.Array = 15,
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gerlero <15150530+gerlero@users.noreply.github.com>
|
@copilot fix the remaining typing issues |
Co-authored-by: gerlero <15150530+gerlero@users.noreply.github.com>
|
@copilot just format with Ruff |
Co-authored-by: gerlero <15150530+gerlero@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
==========================================
- Coverage 86.12% 86.05% -0.08%
==========================================
Files 13 13
Lines 555 552 -3
==========================================
- Hits 478 475 -3
Misses 77 77 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
No description provided.