Skip to content

Commit 869137c

Browse files
Merge pull request #1900 from OceanParcels/removing_netcdf_warning
Removing deprecated netcdf_decodewarning
2 parents adb096e + eae8a9a commit 869137c

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

parcels/field.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
TimeExtrapolationError,
4040
_raise_field_out_of_bound_error,
4141
)
42-
from parcels.tools.warnings import FieldSetWarning, _deprecated_param_netcdf_decodewarning
42+
from parcels.tools.warnings import FieldSetWarning
4343

4444
from ._index_search import _search_indices_curvilinear, _search_indices_rectilinear
4545
from .fieldfilebuffer import (
@@ -187,10 +187,6 @@ def __init__(
187187
to_write: bool = False,
188188
**kwargs,
189189
):
190-
if kwargs.get("netcdf_decodewarning") is not None:
191-
_deprecated_param_netcdf_decodewarning()
192-
kwargs.pop("netcdf_decodewarning")
193-
194190
if not isinstance(name, tuple):
195191
self.name = name
196192
self.filebuffername = name
@@ -359,9 +355,7 @@ def _get_dim_filenames(cls, filenames, dim):
359355
return filenames
360356

361357
@staticmethod
362-
def _collect_timeslices(timestamps, data_filenames, dimensions, indices, netcdf_engine, netcdf_decodewarning=None):
363-
if netcdf_decodewarning is not None:
364-
_deprecated_param_netcdf_decodewarning()
358+
def _collect_timeslices(timestamps, data_filenames, dimensions, indices, netcdf_engine):
365359
if timestamps is not None:
366360
dataFiles = []
367361
for findex in range(len(data_filenames)):
@@ -444,10 +438,6 @@ def from_netcdf(
444438
gridindexingtype : str
445439
The type of gridindexing. Either 'nemo' (default), 'mitgcm', 'mom5', 'pop', or 'croco' are supported.
446440
See also the Grid indexing documentation on oceanparcels.org
447-
netcdf_decodewarning : bool
448-
(DEPRECATED - v3.1.0) Whether to show a warning if there is a problem decoding the netcdf files.
449-
Default is True, but in some cases where these warnings are expected, it may be useful to silence them
450-
by setting netcdf_decodewarning=False.
451441
grid :
452442
(Default value = None)
453443
**kwargs :
@@ -460,10 +450,6 @@ def from_netcdf(
460450
* `Timestamps <../examples/tutorial_timestamps.ipynb>`__
461451
462452
"""
463-
if kwargs.get("netcdf_decodewarning") is not None:
464-
_deprecated_param_netcdf_decodewarning()
465-
kwargs.pop("netcdf_decodewarning")
466-
467453
# Ensure the timestamps array is compatible with the user-provided datafiles.
468454
if timestamps is not None:
469455
if isinstance(filenames, list):

parcels/tools/warnings.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import warnings
2-
31
__all__ = ["FieldSetWarning", "FileWarning", "KernelWarning", "ParticleSetWarning"]
42

53

@@ -38,14 +36,3 @@ class KernelWarning(RuntimeWarning):
3836
"""
3937

4038
pass
41-
42-
43-
def _deprecated_param_netcdf_decodewarning():
44-
warnings.warn(
45-
"The 'netcdf_decodewarning' argument is deprecated in v3.1.0 and will be removed completely in a future release. "
46-
"The parameter no longer has any effect, please use the Python warnings module to control warnings, "
47-
"e.g., warnings.filterwarnings('ignore', category=parcels.FileWarning). "
48-
"See also https://docs.oceanparcels.org/en/latest/examples/tutorial_nemo_3D.html",
49-
DeprecationWarning,
50-
stacklevel=2,
51-
)

0 commit comments

Comments
 (0)