Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
DOC: Use obj Sphinx role to reference NumPy arrays consistently
Browse files Browse the repository at this point in the history
Use `obj` Sphinx role to reference `NumPy` arrays consistently in `gpr`
module docstrings.
  • Loading branch information
jhlegarreta committed Dec 8, 2024
1 parent 6b9a1fa commit a5ccc0f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/eddymotion/model/gpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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``
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit a5ccc0f

Please sign in to comment.