tests\__init__.py:1:1: D104 Missing docstring in public package
tests\test_cv.py:37:10: B017 Do not assert blind exception: `Exception`
   |
35 |     - Wrong n_max
36 |     """
37 |     with pytest.raises(Exception):
   |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
38 |         check_folds_indices([[1, 3], [5, 6, 7], [0, 2], [4]], 6)  # Wrong n_max
   |

tests\test_cv.py:37:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
   |
35 |     - Wrong n_max
36 |     """
37 |     with pytest.raises(Exception):
   |                        ^^^^^^^^^ PT011
38 |         check_folds_indices([[1, 3], [5, 6, 7], [0, 2], [4]], 6)  # Wrong n_max
   |

tests\test_cv.py:46:10: B017 Do not assert blind exception: `Exception`
   |
44 |     - Not a list of lists
45 |     """
46 |     with pytest.raises(Exception):
   |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
47 |         # Not a list of lists
48 |         check_folds_indices([1, 3, 5, 6, 7, 0, 2, 4], 8)  # type: ignore
   |

tests\test_cv.py:46:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
   |
44 |     - Not a list of lists
45 |     """
46 |     with pytest.raises(Exception):
   |                        ^^^^^^^^^ PT011
47 |         # Not a list of lists
48 |         check_folds_indices([1, 3, 5, 6, 7, 0, 2, 4], 8)  # type: ignore
   |

tests\test_cv.py:48:59: PGH003 Use specific rule codes when ignoring type issues
   |
46 |     with pytest.raises(Exception):
47 |         # Not a list of lists
48 |         check_folds_indices([1, 3, 5, 6, 7, 0, 2, 4], 8)  # type: ignore
   |                                                           ^^^^^^^^^^^^^^ PGH003
   |

tests\test_cv.py:56:5: PT012 `pytest.raises()` block should contain a single simple statement
   |
54 |       - Not a list of lists of ints
55 |       """
56 | /     with pytest.raises(Exception):
57 | |         # Wrong type: str (instead of int)
58 | |         check_folds_indices([["22"]], 8)  # type: ignore
59 | |         # Wrong type: float (instead of int)
60 | |         check_folds_indices([[1, 0.5]], 8)  # type: ignore
   | |__________________________________________^ PT012
   |

tests\test_cv.py:56:10: B017 Do not assert blind exception: `Exception`
   |
54 |     - Not a list of lists of ints
55 |     """
56 |     with pytest.raises(Exception):
   |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
57 |         # Wrong type: str (instead of int)
58 |         check_folds_indices([["22"]], 8)  # type: ignore
   |

tests\test_cv.py:56:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
   |
54 |     - Not a list of lists of ints
55 |     """
56 |     with pytest.raises(Exception):
   |                        ^^^^^^^^^ PT011
57 |         # Wrong type: str (instead of int)
58 |         check_folds_indices([["22"]], 8)  # type: ignore
   |

tests\test_cv.py:58:43: PGH003 Use specific rule codes when ignoring type issues
   |
56 |     with pytest.raises(Exception):
57 |         # Wrong type: str (instead of int)
58 |         check_folds_indices([["22"]], 8)  # type: ignore
   |                                           ^^^^^^^^^^^^^^ PGH003
59 |         # Wrong type: float (instead of int)
60 |         check_folds_indices([[1, 0.5]], 8)  # type: ignore
   |

tests\test_cv.py:60:45: PGH003 Use specific rule codes when ignoring type issues
   |
58 |         check_folds_indices([["22"]], 8)  # type: ignore
59 |         # Wrong type: float (instead of int)
60 |         check_folds_indices([[1, 0.5]], 8)  # type: ignore
   |                                             ^^^^^^^^^^^^^^ PGH003
   |

tests\test_cv.py:68:5: PT012 `pytest.raises()` block should contain a single simple statement
   |
66 |       - Not exhaustive indices
67 |       """
68 | /     with pytest.raises(Exception):
69 | |         check_folds_indices([[1, 3], [5, 7], [0, 2], [4]], 8)  # Not exhaustive indices
70 | |         check_folds_indices([[1, 3], [5, 6, 7, 9], [0, 2], [4]], 8)  # Not exhaustive indices
   | |___________________________________________________________________^ PT012
   |

tests\test_cv.py:68:10: B017 Do not assert blind exception: `Exception`
   |
66 |     - Not exhaustive indices
67 |     """
68 |     with pytest.raises(Exception):
   |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
69 |         check_folds_indices([[1, 3], [5, 7], [0, 2], [4]], 8)  # Not exhaustive indices
70 |         check_folds_indices([[1, 3], [5, 6, 7, 9], [0, 2], [4]], 8)  # Not exhaustive indices
   |

tests\test_cv.py:68:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
   |
66 |     - Not exhaustive indices
67 |     """
68 |     with pytest.raises(Exception):
   |                        ^^^^^^^^^ PT011
69 |         check_folds_indices([[1, 3], [5, 7], [0, 2], [4]], 8)  # Not exhaustive indices
70 |         check_folds_indices([[1, 3], [5, 6, 7, 9], [0, 2], [4]], 8)  # Not exhaustive indices
   |

tests\test_cv.py:78:10: B017 Do not assert blind exception: `Exception`
   |
76 |     - Empty lists
77 |     """
78 |     with pytest.raises(Exception):
   |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
79 |         check_folds_indices([[1, 3], [5, 6, 7], [0, 2], [], [4]], 8)
   |

tests\test_cv.py:78:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
   |
76 |     - Empty lists
77 |     """
78 |     with pytest.raises(Exception):
   |                        ^^^^^^^^^ PT011
79 |         check_folds_indices([[1, 3], [5, 6, 7], [0, 2], [], [4]], 8)
   |

tests\test_cv.py:100:10: B017 Do not assert blind exception: `Exception`
    |
 99 |     # These should raise error
100 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
101 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 2.2, 3], [0.1, 0, 4]]))
    |

tests\test_cv.py:100:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
 99 |     # These should raise error
100 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
101 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 2.2, 3], [0.1, 0, 4]]))
    |

tests\test_cv.py:103:10: B017 Do not assert blind exception: `Exception`
    |
101 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 2.2, 3], [0.1, 0, 4]]))
102 |
103 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
104 |         check_lower_triangular(np.ones(shape=(13, 14)))
    |

tests\test_cv.py:103:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
101 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 2.2, 3], [0.1, 0, 4]]))
102 |
103 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
104 |         check_lower_triangular(np.ones(shape=(13, 14)))
    |

tests\test_cv.py:106:10: B017 Do not assert blind exception: `Exception`
    |
104 |         check_lower_triangular(np.ones(shape=(13, 14)))
105 |
106 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
107 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 0.001, "a"]]))
    |

tests\test_cv.py:106:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
104 |         check_lower_triangular(np.ones(shape=(13, 14)))
105 |
106 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
107 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 0.001, "a"]]))
    |

tests\test_cv.py:109:10: B017 Do not assert blind exception: `Exception`
    |
107 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 0.001, "a"]]))
108 |
109 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
110 |         check_lower_triangular("a")
    |

tests\test_cv.py:109:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
107 |         check_lower_triangular(np.array([[1, 2, 2.3], [0, 0.001, "a"]]))
108 |
109 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
110 |         check_lower_triangular("a")
    |

tests\test_cv.py:126:10: B017 Do not assert blind exception: `Exception`
    |
125 |     # These should raise error
126 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
127 |         check_numeric_array(np.array(4), 1)
    |

tests\test_cv.py:126:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
125 |     # These should raise error
126 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
127 |         check_numeric_array(np.array(4), 1)
    |

tests\test_cv.py:129:10: B017 Do not assert blind exception: `Exception`
    |
127 |         check_numeric_array(np.array(4), 1)
128 |
129 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
130 |         check_numeric_array(np.ones(shape=(2, 4)), 1)
    |

tests\test_cv.py:129:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
127 |         check_numeric_array(np.array(4), 1)
128 |
129 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
130 |         check_numeric_array(np.ones(shape=(2, 4)), 1)
    |

tests\test_cv.py:132:10: B017 Do not assert blind exception: `Exception`
    |
130 |         check_numeric_array(np.ones(shape=(2, 4)), 1)
131 |
132 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
133 |         check_numeric_array("a", 1)
    |

tests\test_cv.py:132:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
130 |         check_numeric_array(np.ones(shape=(2, 4)), 1)
131 |
132 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
133 |         check_numeric_array("a", 1)
    |

tests\test_cv.py:135:10: B017 Do not assert blind exception: `Exception`
    |
133 |         check_numeric_array("a", 1)
134 |
135 |     with pytest.raises(Exception):
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ B017
136 |         check_numeric_array(np.array([1, "1"]), 1)
    |

tests\test_cv.py:135:24: PT011 `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
    |
133 |         check_numeric_array("a", 1)
134 |
135 |     with pytest.raises(Exception):
    |                        ^^^^^^^^^ PT011
136 |         check_numeric_array(np.array([1, "1"]), 1)
    |

tests\test_cv.py:463:5: FBT001 Boolean-typed positional argument in function definition
    |
461 |     NUM_FOLDS: int = 8,
462 |     NOISE_VAR: float = 0.0,
463 |     SCRAMBLE: bool = True,
    |     ^^^^^^^^ FBT001
464 | ) -> tuple[
465 |     NDArray[np.float64],
    |

tests\test_cv.py:463:5: FBT002 Boolean default positional argument in function definition
    |
461 |     NUM_FOLDS: int = 8,
462 |     NOISE_VAR: float = 0.0,
463 |     SCRAMBLE: bool = True,
    |     ^^^^^^^^ FBT002
464 | ) -> tuple[
465 |     NDArray[np.float64],
    |

tests\test_cv.py:476:5: NPY002 Replace legacy `np.random.seed` call with `np.random.Generator`
    |
474 |     random.seed(42)
475 |     torch.manual_seed(42)
476 |     np.random.seed(42)
    |     ^^^^^^^^^^^^^^ NPY002
477 |
478 |     # Will generate data using a zero-mean Matern 5/2 GP with these parameters
    |

tests\test_cv.py:489:25: NPY002 Replace legacy `np.random.choice` call with `np.random.Generator`
    |
487 |             [
488 |                 X_train,
489 |                 X_train[np.random.choice(np.arange(N_TRAIN - N_DUPLICATE_X), N_DUPLICATE_X)],
    |                         ^^^^^^^^^^^^^^^^ NPY002
490 |             ]
491 |         )
    |

tests\test_cv.py:502:64: PGH003 Use specific rule codes when ignoring type issues
    |
501 |     # Covariance matrix; shape=(N_TRAIN, N_TRAIN)
502 |     K: gpytorch.lazy.LazyEvaluatedKernelTensor = ker(X_train)  # type: ignore
    |                                                                ^^^^^^^^^^^^^^ PGH003
503 |
504 |     # Distribution
    |

tests\test_cv.py:532:21: NPY002 Replace legacy `np.random.multinomial` call with `np.random.Generator`
    |
531 |         folds_end: NDArray[np.float64]
532 |         folds_end = np.random.multinomial(
    |                     ^^^^^^^^^^^^^^^^^^^^^ NPY002
533 |             N_TRAIN,
534 |             np.ones(NUM_FOLDS) / NUM_FOLDS,
    |

tests\test_cv.py:544:20: NPY002 Replace legacy `np.random.permutation` call with `np.random.Generator`
    |
543 |     if SCRAMBLE:
544 |         _rnd_idx = np.random.permutation(N_TRAIN)  # Randomized indices
    |                    ^^^^^^^^^^^^^^^^^^^^^ NPY002
545 |         FOLDS_INDICES = [list(_rnd_idx[idx]) for idx in FOLDS_INDICES]
    |

tests\test_cv.py:680:5: FBT001 Boolean-typed positional argument in function definition
    |
678 |     NOISE_VAR: float,
679 |     N_DUPLICATE_X: int,
680 |     SCRAMBLE: bool,
    |     ^^^^^^^^ FBT001
681 | ) -> None:
682 |     """Used for running multiple tests of multifold().
    |

tests\utils.py:17:9: D107 Missing docstring in `__init__`
   |
15 |     """Model for standard GP regression."""
16 |
17 |     def __init__(
   |         ^^^^^^^^ D107
18 |         self,
19 |         train_x: torch.Tensor,
   |

tests\utils.py:46:9: D102 Missing docstring in public method
   |
44 |         self.covar_module = covar_module
45 |
46 |     def forward(self, x: torch.Tensor) -> gpytorch.distributions.MultivariateNormal:
   |         ^^^^^^^ D102
47 |         mean_x = self.mean_module(x)
48 |         covar_x = self.covar_module(x)
   |

tests\utils.py:64:9: FBT001 Boolean-typed positional argument in function definition
   |
62 |         self,
63 |         x: torch.Tensor,
64 |         latent: bool = True,
   |         ^^^^^^ FBT001
65 |         CG_tol: float = 0.1,
66 |         full_cov: bool = False,
   |

tests\utils.py:64:9: FBT002 Boolean default positional argument in function definition
   |
62 |         self,
63 |         x: torch.Tensor,
64 |         latent: bool = True,
   |         ^^^^^^ FBT002
65 |         CG_tol: float = 0.1,
66 |         full_cov: bool = False,
   |

tests\utils.py:66:9: FBT001 Boolean-typed positional argument in function definition
   |
64 |         latent: bool = True,
65 |         CG_tol: float = 0.1,
66 |         full_cov: bool = False,
   |         ^^^^^^^^ FBT001
67 |     ) -> tuple[torch.Tensor, torch.Tensor]:
68 |         """Return mean and covariance at x.
   |

tests\utils.py:66:9: FBT002 Boolean default positional argument in function definition
   |
64 |         latent: bool = True,
65 |         CG_tol: float = 0.1,
66 |         full_cov: bool = False,
   |         ^^^^^^^^ FBT002
67 |     ) -> tuple[torch.Tensor, torch.Tensor]:
68 |         """Return mean and covariance at x.
   |

tests\utils.py:97:47: PGH003 Use specific rule codes when ignoring type issues
   |
95 |             mean = dist.mean.cpu()
96 |             var = (
97 |                 dist.covariance_matrix.cpu()  # type: ignore
   |                                               ^^^^^^^^^^^^^^ PGH003
98 |                 if full_cov
99 |                 else dist.variance.cpu()
   |

tests\utils.py:108:64: PGH003 Use specific rule codes when ignoring type issues
    |
106 |         _constant_mean: torch.Tensor | str = "--"
107 |         with contextlib.suppress(Exception):
108 |             _constant_mean = self.mean_module.constant.item()  # type: ignore
    |                                                                ^^^^^^^^^^^^^^ PGH003
109 |
110 |         _noise: torch.Tensor | str = "--"
    |

tests\utils.py:112:64: PGH003 Use specific rule codes when ignoring type issues
    |
110 |         _noise: torch.Tensor | str = "--"
111 |         with contextlib.suppress(Exception):
112 |             _noise = self.likelihood.noise_covar.noise.item()  # type: ignore
    |                                                                ^^^^^^^^^^^^^^ PGH003
113 |
114 |         _lengthscale: NDArray[Any] | str = "--"
    |

tests\utils.py:120:66: PGH003 Use specific rule codes when ignoring type issues
    |
118 |         _outputscale: torch.Tensor | str = "--"
119 |         with contextlib.suppress(Exception):
120 |             _outputscale = self.covar_module.outputscale.item()  # type: ignore
    |                                                                  ^^^^^^^^^^^^^^ PGH003
121 |
122 |     def save(self) -> None:
    |

tests\utils.py:151:40: FBT001 Boolean-typed positional argument in function definition
    |
151 | def gpytorch_mean_constant(val: float, fixed: bool = True) -> gpytorch.means.Mean:
    |                                        ^^^^^ FBT001
152 |     """Return a constant mean function.
    |

tests\utils.py:151:40: FBT002 Boolean default positional argument in function definition
    |
151 | def gpytorch_mean_constant(val: float, fixed: bool = True) -> gpytorch.means.Mean:
    |                                        ^^^^^ FBT002
152 |     """Return a constant mean function.
    |

tests\utils.py:165:49: FBT001 Boolean-typed positional argument in function definition
    |
164 | def gpytorch_likelihood_gaussian(
165 |     variance: float, variance_lb: float = 1e-6, fixed: bool = True
    |                                                 ^^^^^ FBT001
166 | ) -> gpytorch.likelihoods.Likelihood:
167 |     """Return a Gaussian likelihood.
    |

tests\utils.py:165:49: FBT002 Boolean default positional argument in function definition
    |
164 | def gpytorch_likelihood_gaussian(
165 |     variance: float, variance_lb: float = 1e-6, fixed: bool = True
    |                                                 ^^^^^ FBT002
166 | ) -> gpytorch.likelihoods.Likelihood:
167 |     """Return a Gaussian likelihood.
    |

Found 54 errors.
