From 4be7629017eb0b5696ea986fe8e2d1191ae47d7f Mon Sep 17 00:00:00 2001 From: Daniel Dodd Date: Fri, 22 Mar 2024 12:29:23 +0000 Subject: [PATCH] Update oceanmodelling.py --- docs/examples/oceanmodelling.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/examples/oceanmodelling.py b/docs/examples/oceanmodelling.py index 77f125b12..5d3490495 100644 --- a/docs/examples/oceanmodelling.py +++ b/docs/examples/oceanmodelling.py @@ -195,16 +195,14 @@ def dataset_3d(pos, vel): # %% - - -@dataclass class VelocityKernel(gpx.kernels.AbstractKernel): - kernel0: gpx.kernels.AbstractKernel = field( - default_factory=lambda: gpx.kernels.RBF(active_dims=[0, 1]) - ) - kernel1: gpx.kernels.AbstractKernel = field( - default_factory=lambda: gpx.kernels.RBF(active_dims=[0, 1]) - ) + def __init__( + self, + kernel0: gpx.kernels.AbstractKernel = gpx.kernels.RBF(active_dims=[0, 1]), + kernel1: gpx.kernels.AbstractKernel = gpx.kernels.RBF(active_dims=[0, 1]), + ): + self.kernel0 = kernel0 + self.kernel1 = kernel1 def __call__( self, X: Float[Array, "1 D"], Xp: Float[Array, "1 D"]