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

Deprecate the engine argument of Spline/SplineCV #373

Merged
merged 2 commits into from
Aug 25, 2022
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
38 changes: 28 additions & 10 deletions verde/spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ class SplineCV(BaseGridder):
(default), then will be set to the data coordinates the first time
:meth:`~verde.SplineCV.fit` is called.
engine : str
Computation engine for the Jacobian matrix and prediction. Can be
``'auto'``, ``'numba'``, or ``'numpy'``. If ``'auto'``, will use numba
if it is installed or numpy otherwise. The numba version is
multi-threaded and usually faster, which makes fitting and predicting
faster.
**DEPRECATED:** This option is deprecated and will be removed in Verde
v2.0.0. The numba engine will be the only option. Computation engine
for the Jacobian matrix and prediction. Can be ``'auto'``, ``'numba'``,
or ``'numpy'``. If ``'auto'``, will use numba if it is installed or
numpy otherwise. The numba version is multi-threaded and usually
faster, which makes fitting and predicting faster.
cv : None or cross-validation generator
Any scikit-learn cross-validation generator. If not given, will use the
default set by :func:`verde.cross_val_score`.
Expand Down Expand Up @@ -142,6 +143,14 @@ def __init__(
self.cv = cv
self.client = client
self.delayed = delayed
if engine != "auto":
warnings.warn(
"The 'engine' parameter of 'verde.SplineCV' is "
"deprecated and will be removed in Verde 2.0.0. "
"The faster and memory efficient numba engine will be "
"the only option.",
FutureWarning,
)
if client is not None:
warnings.warn(
"The 'client' parameter of 'verde.SplineCV' is "
Expand Down Expand Up @@ -338,11 +347,12 @@ class Spline(BaseGridder):
(default), then will be set to the data coordinates used to fit the
spline.
engine : str
Computation engine for the Jacobian matrix and prediction. Can be
``'auto'``, ``'numba'``, or ``'numpy'``. If ``'auto'``, will use numba
if it is installed or numpy otherwise. The numba version is
multi-threaded and usually faster, which makes fitting and predicting
faster.
**DEPRECATED:** This option is deprecated and will be removed in Verde
v2.0.0. The numba engine will be the only option. Computation engine
for the Jacobian matrix and prediction. Can be ``'auto'``, ``'numba'``,
or ``'numpy'``. If ``'auto'``, will use numba if it is installed or
numpy otherwise. The numba version is multi-threaded and usually
faster, which makes fitting and predicting faster.

Attributes
----------
Expand All @@ -369,6 +379,14 @@ def __init__(self, mindist=1e-5, damping=None, force_coords=None, engine="auto")
self.damping = damping
self.force_coords = force_coords
self.engine = engine
if engine != "auto":
warnings.warn(
"The 'engine' parameter of 'verde.Spline' is "
"deprecated and will be removed in Verde 2.0.0. "
"The faster and memory efficient numba engine will be "
"the only option.",
FutureWarning,
)

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