diff --git a/docs/docstrings/top/filesystem.md b/docs/docstrings/top/filesystem.md deleted file mode 100644 index 9f05cc3a..00000000 --- a/docs/docstrings/top/filesystem.md +++ /dev/null @@ -1,3 +0,0 @@ -# filesystem - -::: filesystem diff --git a/mkdocs.yml b/mkdocs.yml index 34692b3f..4e2187fb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,7 +24,6 @@ nav: - "boilerplate": docstrings/top/boilerplate.md - "buffer": docstrings/top/buffer.md - "constants": docstrings/top/constants.md - - "filesystem": docstrings/top/filesystem.md - "io": docstrings/top/io.md - "logging": docstrings/top/logging.md - "namelist": docstrings/top/namelist.md diff --git a/ndsl/filesystem.py b/ndsl/filesystem.py deleted file mode 100644 index df2e709f..00000000 --- a/ndsl/filesystem.py +++ /dev/null @@ -1,37 +0,0 @@ -import warnings - -import fsspec - - -def get_fs(path: str) -> fsspec.AbstractFileSystem: - """Return the fsspec filesystem required to handle a given path.""" - warnings.warn( - "Usage of `get_fs()` is discouraged if favor `os.path` and `pathlib` " - "modules. The function will be removed in the next version of NDSL.", - DeprecationWarning, - stacklevel=2, - ) - fs, _, _ = fsspec.get_fs_token_paths(path) - return fs - - -def is_file(filename): - warnings.warn( - "Usage of `is_file()` is discouraged if favor of plain `os.path.isfile()`. " - "The function will be removed in the next version of NDSL.", - DeprecationWarning, - stacklevel=2, - ) - return get_fs(filename).isfile(filename) - - -def open(filename, *args, **kwargs): - warnings.warn( - "Usage of `open()` is discouraged if favor the python built-in file " - "open context manager. The function will be removed in the next version " - "of NDSL.", - DeprecationWarning, - stacklevel=2, - ) - fs = get_fs(filename) - return fs.open(filename, *args, **kwargs) diff --git a/setup.py b/setup.py index 1719226f..6d109c36 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ def local_pkg(name: str, relative_path: str) -> str: "cftime", "xarray>=2025.01.2", # datatree + fixes "f90nml>=1.1.0", - "fsspec", "netcdf4==1.7.2", "scipy", # restart capacities only "h5netcdf", # for xarray diff --git a/tests/test_filesystem.py b/tests/test_filesystem.py deleted file mode 100644 index 5f05af82..00000000 --- a/tests/test_filesystem.py +++ /dev/null @@ -1,19 +0,0 @@ -import pytest - -import ndsl.filesystem as fs - - -def test_is_file_is_deprecated() -> None: - with pytest.deprecated_call(): - fs.is_file("path/to/my_file.txt") - - -def test_open_is_deprecated() -> None: - with pytest.deprecated_call(): - with fs.open("README.md", "r"): - pass - - -def test_get_fs_is_deprecated() -> None: - with pytest.deprecated_call(): - fs.get_fs("path/to/my/file.txt")