JaxGaussianProcesses / GPJax

Gaussian processes in JAX.
https://docs.jaxgaussianprocesses.com/
Apache License 2.0
436 stars 51 forks source link

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

Closed wejpurvis closed 6 months ago

wejpurvis commented 6 months ago

Type of changes

Checklist

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