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

Replace DeprecationWarning for FutureWarning #305

Merged
merged 3 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
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
7 changes: 2 additions & 5 deletions verde/datasets/sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
from ..version import full_version


# Otherwise, DeprecationWarning won't be shown, kind of defeating the purpose.
warnings.simplefilter("default")

REGISTRY = pooch.create(
path=pooch.os_cache("verde"),
base_url="https://github.com/fatiando/verde/raw/{version}/data/",
Expand Down Expand Up @@ -183,7 +180,7 @@ def fetch_rio_magnetic():
warnings.warn(
"The Rio magnetic anomaly dataset is deprecated and will be removed "
"in Verde v2.0.0. Use a different dataset instead.",
DeprecationWarning,
FutureWarning,
)
data_file = REGISTRY.fetch("rio-magnetic.csv.xz")
data = pd.read_csv(data_file, compression="xz")
Expand Down Expand Up @@ -216,7 +213,7 @@ def setup_rio_magnetic_map(ax, region=(-42.6, -42, -22.5, -22)):
warnings.warn(
"The Rio magnetic anomaly dataset is deprecated and will be removed "
"in Verde v2.0.0. Use a different dataset instead.",
DeprecationWarning,
FutureWarning,
)
_setup_map(
ax,
Expand Down
6 changes: 1 addition & 5 deletions verde/model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
from .utils import dispatch, partition_by_sum


# Otherwise, DeprecationWarning won't be shown, kind of defeating the purpose.
warnings.simplefilter("default")


# Pylint doesn't like X, y scikit-learn argument names.
# pylint: disable=invalid-name,unused-argument

Expand Down Expand Up @@ -758,7 +754,7 @@ def cross_val_score(
"The 'client' parameter of 'verde.cross_val_score' is deprecated "
"and will be removed in Verde 2.0.0. "
"Use the 'delayed' parameter instead.",
DeprecationWarning,
FutureWarning,
)
coordinates, data, weights = check_fit_input(
coordinates, data, weights, unpack=False
Expand Down
6 changes: 1 addition & 5 deletions verde/spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
from .utils import dummy_jit as jit


# Otherwise, DeprecationWarning won't be shown, kind of defeating the purpose.
warnings.simplefilter("default")


class SplineCV(BaseGridder):
r"""
Cross-validated biharmonic spline interpolation.
Expand Down Expand Up @@ -145,7 +141,7 @@ def __init__(
"The 'client' parameter of 'verde.SplineCV' is "
"deprecated and will be removed in Verde 2.0.0. "
"Use the 'delayed' parameter instead.",
DeprecationWarning,
FutureWarning,
)

def fit(self, coordinates, data, weights=None):
Expand Down
6 changes: 1 addition & 5 deletions verde/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
from .utils import dummy_jit as jit


# Otherwise, DeprecationWarning won't be shown, kind of defeating the purpose.
warnings.simplefilter("default")


class Vector(BaseGridder):
"""
Fit an estimator to each component of multi-component vector data.
Expand Down Expand Up @@ -234,7 +230,7 @@ def __init__(
"VectorSpline2D is deprecated and will be removed in Verde v2.0.0."
" Please use the implementation in the Erizo package instead "
"(https://github.com/fatiando/erizo).",
DeprecationWarning,
FutureWarning,
)

def fit(self, coordinates, data, weights=None):
Expand Down