diff --git a/argopy/data_fetchers/proto.py b/argopy/data_fetchers/proto.py index 4d1d9d6d..e8076413 100644 --- a/argopy/data_fetchers/proto.py +++ b/argopy/data_fetchers/proto.py @@ -96,7 +96,7 @@ def _cname(self) -> str: @property def sha(self) -> str: - """ Returns a unique SHA for a specifc cname / fetcher implementation""" + """ Returns a unique SHA for a specific cname / fetcher implementation""" path = "%s-%s" % (self.definition, self.cname()) return hashlib.sha256(path.encode()).hexdigest() diff --git a/argopy/plot/dashboards.py b/argopy/plot/dashboards.py index f018e347..ca646076 100644 --- a/argopy/plot/dashboards.py +++ b/argopy/plot/dashboards.py @@ -117,7 +117,7 @@ def open_dashboard( * "ea", "data": the `Euro-Argo data selection dashboard `_ * "meta": the `Euro-Argo fleet monitoring dashboard `_ * "op", "ocean-ops": the `Ocean-OPS Argo dashboard `_ - * "bgc": the `Argo-BGC specific dashbaord `_ + * "bgc": the `Argo-BGC specific dashboard `_ * "argovis": the `Colorado Argovis dashboard `_ url_only: bool, optional, default: False If set to True, will only return the URL toward the dashboard diff --git a/argopy/tests/test_fetchers_data_gdac.py b/argopy/tests/test_fetchers_data_gdac.py index ed1b3518..bbed63be 100644 --- a/argopy/tests/test_fetchers_data_gdac.py +++ b/argopy/tests/test_fetchers_data_gdac.py @@ -93,7 +93,7 @@ def core(fargs, apts): return fct_safe_to_server_errors(core)(fetcher_args, access_point, xfail=xfail) -def assert_fetcher(this_fetcher, cachable=False): +def assert_fetcher(this_fetcher, cacheable=False): """Assert a data fetcher. This should be used by all tests @@ -102,7 +102,7 @@ def assert_fetcher(this_fetcher, cachable=False): assert is_list_of_strings(this_fetcher.uri) assert (this_fetcher.N_RECORDS >= 1) # Make sure we loaded the index file content assert (this_fetcher.N_FILES >= 1) # Make sure we found results - if cachable: + if cacheable: assert is_list_of_strings(this_fetcher.cachepath) @@ -184,7 +184,7 @@ def test_hosts_invalid(self, ftp_host): def test_fetching(self, _make_a_fetcher): @safe_to_server_errors def test(this_fetcher): - assert_fetcher(this_fetcher, cachable=False) + assert_fetcher(this_fetcher, cacheable=False) test(_make_a_fetcher) # @skip_for_debug @@ -193,7 +193,7 @@ def test_fetching_cached(self, _make_a_cached_fetcher): @safe_to_server_errors def test(this_fetcher): # Assert the fetcher (this trigger data fetching, hence caching as well): - assert_fetcher(this_fetcher, cachable=True) + assert_fetcher(this_fetcher, cacheable=True) # Make sure we can clear the cache: this_fetcher.clear_cache() diff --git a/argopy/tests/test_fetchers_index_gdac.py b/argopy/tests/test_fetchers_index_gdac.py index 94024f31..53c5e8ba 100644 --- a/argopy/tests/test_fetchers_index_gdac.py +++ b/argopy/tests/test_fetchers_index_gdac.py @@ -78,13 +78,13 @@ def core(fargs, apts): return fct_safe_to_server_errors(core)(fetcher_args, access_point, xfail=xfail) -def assert_fetcher(this_fetcher, cachable=False): +def assert_fetcher(this_fetcher, cacheable=False): """ Assert structure of a fetcher """ assert isinstance(this_fetcher.to_dataframe(), pd.core.frame.DataFrame) # assert is_list_of_strings(this_fetcher.uri) assert (this_fetcher.N_RECORDS >= 1) # Make sure we loaded the index file content assert (this_fetcher.N_FILES >= 1) # Make sure we found results - if cachable: + if cacheable: assert is_list_of_strings(this_fetcher.cachepath) @@ -167,7 +167,7 @@ def test_hosts_invalid(self, ftp_host): def test_fetching(self, _make_a_fetcher): @safe_to_server_errors def test(this_fetcher): - assert_fetcher(this_fetcher, cachable=False) + assert_fetcher(this_fetcher, cacheable=False) test(_make_a_fetcher) # @skip_for_debug @@ -176,7 +176,7 @@ def test_fetching_cached(self, _make_a_cached_fetcher): @safe_to_server_errors def test(this_fetcher): # Assert the fetcher (this trigger data fetching, hence caching as well): - assert_fetcher(this_fetcher, cachable=True) + assert_fetcher(this_fetcher, cacheable=True) # Make sure we can clear the cache: this_fetcher.clear_cache() diff --git a/argopy/tests/test_stores.py b/argopy/tests/test_stores.py index c7af1fb2..bbd366f6 100644 --- a/argopy/tests/test_stores.py +++ b/argopy/tests/test_stores.py @@ -170,7 +170,7 @@ def test_nocache(self): with pytest.raises(FileSystemHasNoCache): fs.cachepath("dummy_uri") - def test_cachable(self): + def test_cacheable(self): fs = httpstore(cache=True) assert isinstance(fs.fs, fsspec.implementations.cached.WholeFileCacheFileSystem) @@ -265,7 +265,7 @@ def test_nocache(self): with pytest.raises(FileSystemHasNoCache): fs.cachepath("dummy_uri") - def test_cachable(self): + def test_cacheable(self): fs = memorystore(cache=True) assert isinstance(fs.fs, fsspec.implementations.cached.WholeFileCacheFileSystem) @@ -519,20 +519,20 @@ def a_search(self, request): srch = request.param[1] yield run_a_search(self.new_idx, {'host': host, 'cache': True}, srch) - def assert_index(self, this_idx, cachable=False): + def assert_index(self, this_idx, cacheable=False): assert hasattr(this_idx, 'index') assert this_idx.shape[0] == this_idx.index.shape[0] assert this_idx.N_RECORDS == this_idx.index.shape[0] assert is_list_of_strings(this_idx.uri_full_index) and len(this_idx.uri_full_index) == this_idx.N_RECORDS - if cachable: + if cacheable: assert is_list_of_strings(this_idx.cachepath('index')) - def assert_search(self, this_idx, cachable=False): + def assert_search(self, this_idx, cacheable=False): assert hasattr(this_idx, 'search') assert this_idx.N_MATCH == this_idx.search.shape[0] assert this_idx.N_FILES == this_idx.N_MATCH assert is_list_of_strings(this_idx.uri) and len(this_idx.uri) == this_idx.N_MATCH - if cachable: + if cacheable: assert is_list_of_strings(this_idx.cachepath('search')) # @skip_this @@ -572,7 +572,7 @@ def new_idx(): def test_search(self, a_search): @safe_to_server_errors def test(this_searched_store): - self.assert_search(this_searched_store, cachable=False) + self.assert_search(this_searched_store, cacheable=False) test(a_search) # @skip_this @@ -606,14 +606,14 @@ def test_to_dataframe_search(self): def test_caching_index(self): idx = self.new_idx(cache=True) - self.assert_index(idx, cachable=True) + self.assert_index(idx, cacheable=True) # @skip_this def test_caching_search(self): idx = self.new_idx(cache=True) wmo = [s['wmo'] for s in valid_searches if 'wmo' in s.keys()][0] idx.search_wmo(wmo) - self.assert_search(idx, cachable=True) + self.assert_search(idx, cacheable=True) # @skip_this def test_read_wmo(self): diff --git a/argopy/utilities.py b/argopy/utilities.py index f120a248..a954a139 100644 --- a/argopy/utilities.py +++ b/argopy/utilities.py @@ -576,6 +576,7 @@ def show_versions(file=sys.stdout, conda=False): # noqa: C901 ("dask", lambda mod: mod.__version__), # This could go away from requirements ? ("toolz", lambda mod: mod.__version__), ("gsw", lambda mod: mod.__version__), # Used by xarray accessor to compute new variables + ("aiohttp", lambda mod: mod.__version__), ]), 'ext.misc': sorted([ ("pyarrow", lambda mod: mod.__version__), @@ -2142,7 +2143,7 @@ def load(self, errors: str = "ignore"): def argo_split_path(this_path): # noqa C901 - """ Split path from a GDAC ftp style Argo netcdf file and return informations + """ Split path from a GDAC ftp style Argo netcdf file and return information >>> argo_split_path('coriolis/6901035/profiles/D6901035_001D.nc') >>> argo_split_path('https://data-argo.ifremer.fr/dac/csiro/5903939/profiles/D5903939_103.nc') diff --git a/ci/requirements/py3.7-dev.yml b/ci/requirements/py3.7-dev.yml index 5865f474..abb7990b 100644 --- a/ci/requirements/py3.7-dev.yml +++ b/ci/requirements/py3.7-dev.yml @@ -22,7 +22,6 @@ dependencies: - numpy=1.21.5 - pandas=1.3.5 - packaging=21.3 - - pip=22.0.3 - pytest=7.0.1 - seaborn=0.11.2 - setuptools=59.8.0 @@ -32,6 +31,7 @@ dependencies: - ipywidgets=7.6.5 - pyarrow=4.0.1 # Not showing up with argopy.show_versions(): + - pip=22.0.3 - cfgrib=0.9.10 - black=22.1.0 - flake8=4.0.1 diff --git a/ci/requirements/py3.7-min.yml b/ci/requirements/py3.7-min.yml index 083b5813..71b35ff8 100644 --- a/ci/requirements/py3.7-min.yml +++ b/ci/requirements/py3.7-min.yml @@ -32,4 +32,5 @@ dependencies: - ipywidgets=7.5 - pandas=1.1 - numpy=1.18 - - scipy=1.5 \ No newline at end of file + - scipy=1.5 + - packaging=20.4 \ No newline at end of file diff --git a/ci/requirements/py3.8-dev.yml b/ci/requirements/py3.8-dev.yml index 3a151761..292f3654 100644 --- a/ci/requirements/py3.8-dev.yml +++ b/ci/requirements/py3.8-dev.yml @@ -3,34 +3,39 @@ channels: - conda-forge dependencies: - python=3.8 - - xarray=2022.3.0 - - scipy=1.8.0 - - scikit-learn=1.0.2 - - netcdf4=1.5.8 + + - aiohttp=3.8.1 - dask=2022.02.1 - - toolz=0.11.2 - erddapy=1.2.0 - fsspec=2022.02.0 - gsw=3.4.0 - - aiohttp=3.8.1 - - bottleneck=1.3.4 - - cartopy=0.20.2 - - cftime=1.5.2 + - netcdf4=1.5.8 + - packaging=21.3 + - scipy=1.8.0 + - scikit-learn=1.0.2 + - toolz=0.11.2 + - xarray=2022.3.0 + - distributed=2022.2.1 + - pyarrow=4.0.1 + - tqdm=4.63.0 + - ipython=8.0.1 + - cartopy=0.20.2 + - ipykernel=6.9.1 + - ipywidgets=7.6.5 - matplotlib=3.5.1 + - seaborn=0.11.2 + + - bottleneck=1.3.4 + - cftime=1.5.2 - numpy=1.22.2 - pandas=1.4.1 - - packaging=21.3 - pip=22.0.3 - pytest=7.0.1 - - seaborn=0.11.2 - setuptools=59.8.0 - zarr=2.11.0 - - tqdm=4.63.0 - - ipykernel=6.9.1 - - ipywidgets=7.6.5 - - pyarrow=4.0.1 + # Not showing up with argopy.show_versions(): - cfgrib=0.9.10 - black=22.1.0 diff --git a/ci/requirements/py3.8-min.yml b/ci/requirements/py3.8-min.yml index 9dd06364..eac4e728 100644 --- a/ci/requirements/py3.8-min.yml +++ b/ci/requirements/py3.8-min.yml @@ -32,4 +32,5 @@ dependencies: - ipywidgets=7.5 - pandas=1.1 - numpy=1.18 - - scipy=1.5 \ No newline at end of file + - scipy=1.5 + - packaging=20.4 \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 7a6831cc..6800cc27 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -16,7 +16,7 @@ sphinx-book-theme # sphinx-bootstrap-theme xarray>=0.16.1 -scipy>=1.1.0 +scipy>=1.5 scikit-learn>=0.23.2 dask>=2021.9.1 distributed>=2.30.0 @@ -26,7 +26,7 @@ distributed>=2.30.0 erddapy>=0.7.2 gsw>=3.4.0 -fsspec>=0.7.4, <2022.3.1 +fsspec>=0.7.4 #, <2022.3.1 aiohttp>=3.7.4 #matplotlib>=3.3.2 diff --git a/docs/whats-new.rst b/docs/whats-new.rst index f4025f32..5198d093 100644 --- a/docs/whats-new.rst +++ b/docs/whats-new.rst @@ -7,8 +7,8 @@ What's New |pypi dwn| |conda dwn| -v0.1.XX (X XXX. 2022) ---------------------- +v0.1.11 (13 Apr. 2022) +---------------------- **Features and front-end API** @@ -27,7 +27,7 @@ v0.1.XX (X XXX. 2022) .. note:: - The new ``gdac`` fetcher uses Argo index to determine which profile files to load. Hence, this fetcher may show poor performances when used with a ``region`` access point. Don't hesitate to check :ref:`Performances` to try to improve performances, otherwise, we recommand to use a webAPI access point (``erddap`` or ``argovis``). + The new ``gdac`` fetcher uses Argo index to determine which profile files to load. Hence, this fetcher may show poor performances when used with a ``region`` access point. Don't hesitate to check :ref:`Performances` to try to improve performances, otherwise, we recommend to use a webAPI access point (``erddap`` or ``argovis``). .. warning:: @@ -63,7 +63,7 @@ We added the Ocean-OPS (former JCOMMOPS) dashboard for all floats and the Argo-B # or argopy.dashboard(5904797, 12, type='bgc') -- New utility function :class:`argopy.utilities.ArgoNVSReferenceTables` to retrieve Argo Reference Tables. (:commit:`cc8fdbe132874b71b35203053626cc29ae7d19c4`) by `G. Maze `_. +- **New utility function :class:`argopy.utilities.ArgoNVSReferenceTables` to retrieve Argo Reference Tables**. (:commit:`cc8fdbe132874b71b35203053626cc29ae7d19c4`) by `G. Maze `_. .. code-block:: python diff --git a/requirements.txt b/requirements.txt index ac57bef5..c84b6a40 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ -xarray>=0.15.1 -scipy>=1.1.0 -scikit-learn<2.0 # Using 'preprocessing.LabelEncoder()' in xarray accessor, used by filters -netCDF4<1.5.9 -dask>=2.9 # This could go away ? +xarray>=0.16 +scipy>=1.5 +scikit-learn>=0.23 #<2.0 # Using 'preprocessing.LabelEncoder()' in xarray accessor, used by filters +netCDF4>=1.5.3 #<1.5.9 +dask>=2.3 # This could go away ? toolz>=0.8.2 -erddapy>=0.6 # This could go away ? -fsspec>=0.7.4 -gsw<=3.4.0 # Used by xarray accessor to compute new variables, so not necessary to core functionnalities -aiohttp>=3.6.2 -packaging>= 20.4 # Using 'version' to make API compatible with several fsspec releases \ No newline at end of file +erddapy>=0.7 # This could go away ? +fsspec>=0.8 +gsw<=3.4.0 # Used by xarray accessor to compute new variables, so not necessary to core functionalities +aiohttp>=3.7 +packaging>=20.4 # Using 'version' to make API compatible with several fsspec releases \ No newline at end of file diff --git a/setup.py b/setup.py index e7320cd5..3aa8d118 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name='argopy', - version='0.1.10', + version='0.1.11', author="argopy Developers", author_email="gmaze@ifremer.fr", description="A python library for Argo data beginners and experts",