Skip to content

Commit

Permalink
Fix SciPy warnings and errors (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet authored Jan 21, 2025
1 parent cd86d69 commit c316ff1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_coreg/test_biascorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def test_biascorr__bin_2d(self, fit_args, bin_sizes, bin_statistic) -> None:
scipy.optimize.curve_fit,
],
) # type: ignore
@pytest.mark.parametrize("bin_sizes", (10, {"elevation": np.arange(0, 1000, 100)})) # type: ignore
@pytest.mark.parametrize("bin_sizes", (100, {"elevation": np.arange(0, 1000, 100)})) # type: ignore
@pytest.mark.parametrize("bin_statistic", [np.median, np.nanmean]) # type: ignore
def test_biascorr__bin_and_fit_1d(self, fit_args, fit_func, fit_optimizer, bin_sizes, bin_statistic) -> None:
"""Test the _fit_func and apply_func methods of BiasCorr for the bin_and_fit case (called by all subclasses)."""
Expand Down Expand Up @@ -377,6 +377,10 @@ def test_biascorr__bin_and_fit_1d(self, fit_args, fit_func, fit_optimizer, bin_s
def test_biascorr__bin_and_fit_2d(self, fit_args, fit_func, fit_optimizer, bin_sizes, bin_statistic) -> None:
"""Test the _fit_func and apply_func methods of BiasCorr for the bin_and_fit case (called by all subclasses)."""

# Curve fit can be unhappy in certain circumstances for numerical estimation of covariance
# We don't care for this test
warnings.filterwarnings("ignore", message="Covariance of the parameters could not be estimated*")

# Create a bias correction object
bcorr = biascorr.BiasCorr(
fit_or_bin="bin_and_fit",
Expand Down

0 comments on commit c316ff1

Please sign in to comment.