Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Residual typing issues in ULD #570

Open
lockwo opened this issue Jan 16, 2025 · 0 comments
Open

Residual typing issues in ULD #570

lockwo opened this issue Jan 16, 2025 · 0 comments

Comments

@lockwo
Copy link
Contributor

lockwo commented Jan 16, 2025

#542 seems to still have some residual typing issues in dev. Running the checks on a fresh dev branch yields

pre-commit run --all-files
ruff-format..............................................................Passed
ruff.....................................................................Passed
pyright..................................................................Failed
- hook id: pyright
- exit code: 1

WARNING: there is a new pyright version available (v1.1.350 -> v1.1.392.post0).
Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`

/diffrax/_solver/foster_langevin_srk.py
  /diffrax/_solver/foster_langevin_srk.py:66:64 - error: Expression of type "tuple[PyTree, PyTree, PyTree, PyTree, (UnderdampedLangevinX, PyTree) -> UnderdampedLangevinX]" cannot be assigned to return type "tuple[PyTree, PyTree, PyTree, PyTree, (UnderdampedLangevinX) -> UnderdampedLangevinX]"
    Type "(UnderdampedLangevinX, PyTree) -> UnderdampedLangevinX" cannot be assigned to type "(UnderdampedLangevinX) -> UnderdampedLangevinX" (reportReturnType)
/test/test_underdamped_langevin.py
 /test/test_underdamped_langevin.py:260:63 - error: Argument of type "(x: Unknown) -> Unknown" cannot be assigned to parameter "grad_f" of type "(UnderdampedLangevinX, PyTree) -> UnderdampedLangevinX" in function "__init__"
    Type "(x: Unknown) -> Unknown" cannot be assigned to type "(UnderdampedLangevinX, PyTree) -> UnderdampedLangevinX"
      Function accepts too many positional parameters; expected 1 but received 2 (reportArgumentType)
2 errors, 0 warnings, 0 informations

Also, I think the examples will fail since

drift_term = diffrax.UnderdampedLangevinDriftTerm(gamma, u, lambda x: 2 * x) is no longer correct (since the Args is required?)

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

No branches or pull requests

1 participant