Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SciPy warnings and errors #678

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading