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

Fixed mutable default value error in VelocityKernel and HelmholtzKernel dataclasses in python 3.11 #439

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

wejpurvis
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

Oceanmodelling example notebook wasn't working in python 3.11 or 3.12:

ValueError: mutable default <class 'gpjax.kernels.stationary.rbf.RBF'> for field kernel0 is not allowed: use default_factory
Fixed this issue by replacing direct assignment of kernels with field(default_factory=...). Although checked backwards compatibility with python 3.10

Please describe your changes here. If this fixes a bug, please link to the issue, if possible.

Issue Number: N/A

Replaced direct assignments of RBF kernels in VelocityKernel dataclass with field(default_factory=...)
oceanmodelling example now works with python 3.11
Replaced direct assignments of kernels in VelocityKernel and HelmholtzKernel dataclasses with field(default_factory=...)
oceanmodelling example now works with python 3.11
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening your first PR into GPJax!

If you have not heard from us in a while, please feel free to ping @gpjax/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on Slack for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@thomaspinder thomaspinder merged commit 23a85c3 into JaxGaussianProcesses:main Feb 25, 2024
12 checks passed
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.

2 participants