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

Precision check feature #347

Merged

Conversation

trsav
Copy link
Contributor

@trsav trsav commented Aug 6, 2023

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

Have added a warning using the warnings package that informs when X or y isn't of dtype float64 (if the warnings package isn't appropriate then please let me know, it's a new import within dataset.py). This is called immediately after checking the dataset shape:

    def __post_init__(self) -> None:
        r"""Checks that the shapes of $`X`$ and $`y`$ are compatible,
        and provides warnings regarding the precision of $`X`$ and $`y`$."""
        _check_shape(self.X, self.y)
       -->>  _check_precision(self.X, self.y)

I've added a test for the warning generation, but to do so I had to enable the higher precision within test_dataset.py (config.update("jax_enable_x64", True)) . I hope this solution is alright. Thanks!

Issue Number: #342

@thomaspinder thomaspinder self-requested a review August 7, 2023 05:07
@thomaspinder thomaspinder added the enhancement New feature or request label Aug 7, 2023
@thomaspinder thomaspinder added this to the v1.0.0 milestone Aug 7, 2023
@thomaspinder
Copy link
Collaborator

Wonderful. Thanks for such a clean PR @trsav!

@thomaspinder thomaspinder merged commit 39d2327 into JaxGaussianProcesses:main Aug 7, 2023
19 checks passed
Thomas-Christie added a commit to Thomas-Christie/GPJax that referenced this pull request Aug 7, 2023
Set 64 bit precision in objectives tests due to change in
JaxGaussianProcesses#347 causing tests to
fail when run in isolation.
@Thomas-Christie Thomas-Christie mentioned this pull request Aug 7, 2023
6 tasks
thomaspinder pushed a commit that referenced this pull request Aug 8, 2023
Set 64 bit precision in objectives tests due to change in
#347 causing tests to
fail when run in isolation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants