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

test(test_gps.py): fix jaxtyping.TypeCheckError #437

Closed

Conversation

stephen-huan
Copy link
Contributor

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've formatted the new code by running poetry run pre-commit run --all-files --show-diff-on-failure before committing.
  • I've added tests for new code.
  • I've added docstrings for the new code.

Description

My pytest header is as follows.

platform linux -- Python 3.11.7, pytest-7.4.4, pluggy-1.4.0
rootdir: ...
configfile: pyproject.toml
plugins: jaxtyping-0.2.25, typeguard-4.1.5

Running pytest tests/test_gps.py gives

============================================================================== short test summary info ===============================================================================
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function0-RBF-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function0-RBF-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function0-Matern52-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function0-Matern52-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function1-RBF-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function1-RBF-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function1-Matern52-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_prior_sample_approx[mean_function1-Matern52-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function0-RBF-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function0-RBF-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function0-Matern52-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function0-Matern52-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function1-RBF-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function1-RBF-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function1-Matern52-1] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
FAILED tests/test_gps.py::test_conjugate_posterior_sample_approx[mean_function1-Matern52-5] - jaxtyping.TypeCheckError: Type-check error whilst checking the parameters of sample_approx.
=========================================================================== 16 failed, 42 passed in 3.83s ============================================================================

This patch fixes the test by ignoring the warnings from jaxtyping like how beartype is already ignored.

This could be a consequence of my (updated) dependencies since the test passes on CI.

P.S. flax is declared as a dev and docs dependency but it's used in the tests so it should be also added to test.

@Thomas-Christie Thomas-Christie mentioned this pull request Mar 11, 2024
6 tasks
@stephen-huan
Copy link
Contributor Author

addressed by #442

@stephen-huan stephen-huan deleted the test-gps branch April 1, 2024 07:43
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