Skip to content

Commit

Permalink
Deprecation warning for fieldfilebuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
VeckoTheGecko committed Nov 25, 2024
1 parent 6d75a1c commit 8857e76
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions parcels/fieldfilebuffer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import warnings

from parcels._fieldfilebuffer import DaskFileBuffer, DeferredDaskFileBuffer, NetcdfFileBuffer, _FileBuffer

__all__ = ["DaskFileBuffer", "DeferredDaskFileBuffer", "NetcdfFileBuffer", "_FileBuffer"]

warnings.warn(
"The `parcels.fieldfilebuffer` module is deprecated as it has been marked private. "
"Users are not expected to use it in their scripts. See https://github.com/OceanParcels/Parcels/issues/1773 "
"to continue discussion.",
DeprecationWarning,
stacklevel=2,
) # TODO: Remove 6 months after v3.1.1
10 changes: 10 additions & 0 deletions tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,13 @@ def test_removed_attrib(removed_attribute_action: Action):

with pytest.raises(AttributeError):
getattr(obj, action.public_name)


def test_private_fieldfilebuffer():
with pytest.warns(DeprecationWarning):
from parcels.fieldfilebuffer import ( # noqa: F401
DaskFileBuffer,
DeferredDaskFileBuffer,
NetcdfFileBuffer,
_FileBuffer,
)

0 comments on commit 8857e76

Please sign in to comment.