From a5ccc0fc6c1c7bd4927d0408494a85df61d88f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sat, 7 Dec 2024 19:09:22 -0500 Subject: [PATCH] DOC: Use `obj` Sphinx role to reference `NumPy` arrays consistently Use `obj` Sphinx role to reference `NumPy` arrays consistently in `gpr` module docstrings. --- src/eddymotion/model/gpr.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/eddymotion/model/gpr.py b/src/eddymotion/model/gpr.py index 3888602d..d225d1e6 100644 --- a/src/eddymotion/model/gpr.py +++ b/src/eddymotion/model/gpr.py @@ -308,10 +308,10 @@ def __call__( Returns ------- - K : ndarray of shape (n_samples_X, n_samples_Y) + K : :obj:`~numpy.ndarray` of shape (n_samples_X, n_samples_Y) Kernel k(X, Y) - K_gradient : ndarray of shape (n_samples_X, n_samples_X, n_dims),\ + K_gradient : :obj:`~numpy.ndarray` of shape (n_samples_X, n_samples_X, n_dims),\ optional The gradient of the kernel k(X, X) with respect to the log of the hyperparameter of the kernel. Only returned when `eval_gradient` @@ -339,12 +339,12 @@ def diag(self, X: np.ndarray) -> np.ndarray: Parameters ---------- - X : ndarray of shape (n_samples_X, n_features) + X : :obj:`~numpy.ndarray` of shape (n_samples_X, n_features) Left argument of the returned kernel k(X, Y) Returns ------- - K_diag : ndarray of shape (n_samples_X,) + K_diag : :obj:`~numpy.ndarray` of shape (n_samples_X,) Diagonal of kernel k(X, X) """ return self.beta_l * np.ones(X.shape[0]) @@ -414,10 +414,10 @@ def __call__( Returns ------- - K : ndarray of shape (n_samples_X, n_samples_Y) + K : :obj:`~numpy.ndarray` of shape (n_samples_X, n_samples_Y) Kernel k(X, Y) - K_gradient : ndarray of shape (n_samples_X, n_samples_X, n_dims),\ + K_gradient : :obj:`~numpy.ndarray` of shape (n_samples_X, n_samples_X, n_dims),\ optional The gradient of the kernel k(X, X) with respect to the log of the hyperparameter of the kernel. Only returned when ``eval_gradient`` @@ -450,12 +450,12 @@ def diag(self, X: np.ndarray) -> np.ndarray: Parameters ---------- - X : ndarray of shape (n_samples_X, n_features) + X : :obj:`~numpy.ndarray` of shape (n_samples_X, n_features) Left argument of the returned kernel k(X, Y) Returns ------- - K_diag : ndarray of shape (n_samples_X,) + K_diag : :obj:`~numpy.ndarray` of shape (n_samples_X,) Diagonal of kernel k(X, X) """ return self.beta_l * np.ones(X.shape[0])