diff --git a/.github/workflows/binder-badge-permissions.yaml b/.github/workflows/binder-badge-permissions.yaml deleted file mode 100644 index bb977ff2..00000000 --- a/.github/workflows/binder-badge-permissions.yaml +++ /dev/null @@ -1,31 +0,0 @@ -#./github/workflows/binder-badge-permissions.yaml - -name: Binder Badge - -on: [pull_request] - -jobs: - binder: - if: | - ( - (github.event.issue.author_association == 'OWNER') || - (github.event.issue.author_association == 'COLLABORATOR') || - (github.event.issue.author_association == 'CONTRIBUTOR') || - (github.event.issue.author_association == 'MEMBER') - ) - runs-on: ubuntu-latest - steps: - - name: comment on PR with Binder link - uses: actions/github-script@v1 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - var BRANCH_NAME = process.env.BRANCH_NAME; - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${context.repo.owner}/${context.repo.repo}/${BRANCH_NAME}) :point_left: Launch a binder notebook on this branch` - }) - env: - BRANCH_NAME: ${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/pythonFREEtests.yml b/.github/workflows/pythonFREEtests.yml new file mode 100644 index 00000000..dce01cd7 --- /dev/null +++ b/.github/workflows/pythonFREEtests.yml @@ -0,0 +1,53 @@ +on: + pull_request: + types: [ready_for_review] + +jobs: + free_env: + name: unit-test FREE env + + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8] + os: [ubuntu-latest, macos-latest] + experimental: [true] + + steps: + - uses: actions/checkout@master + + - name: Set up environment with py-${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: argopy-tests + environment-file: ci/requirements/py${{matrix.python-version}}-free.yml + auto-update-conda: false + python-version: ${{ matrix.python-version }} + auto-activate-base: false + + - shell: bash -l {0} + run: | + conda info + conda list + + - name: Lint with flake8 + shell: bash -l {0} + run: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Test with pytest + shell: bash -l {0} + run: | + pytest -s --verbosity=3 --cov=./ --cov-config=.coveragerc --cov-report xml:cov.xml --cov-report term-missing + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./cov.xml + flags: unittests + name: codecov-github + fail_ci_if_error: true \ No newline at end of file diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index aca59bfe..33c462e5 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -1,64 +1,53 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: build -on: [push, pull_request] +on: [push] jobs: unit-testing: runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} strategy: + max-parallel: 12 + fail-fast: false matrix: python-version: [3.6, 3.7, 3.8] os: [ubuntu-latest, macos-latest] + experimental: [false] steps: - uses: actions/checkout@master - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@master + - name: Set up environment with py-${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 with: + activate-environment: argopy-tests + environment-file: ci/requirements/py${{matrix.python-version}}-dev.yml + auto-update-conda: false python-version: ${{ matrix.python-version }} + auto-activate-base: false - # - name: Set up Conda for py-${{ matrix.python-version }} - # uses: goanpeca/setup-miniconda@v1 - # with: - # auto-update-conda: true - # python-version: ${{ matrix.python-version }} - # auto-activate-base: false - - - name: Install dependencies with pip + - shell: bash -l {0} run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install distributed aiohttp ipywidgets - - # - name: Install dependencies with conda - # shell: bash -l {0} - # run: | - # conda info - # conda install matplotlib seaborn cartopy + conda info + conda list - name: Lint with flake8 + shell: bash -l {0} run: | - pip install flake8 - # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest + shell: bash -l {0} run: | - pip install pytest pytest-cov pytest -s --verbosity=3 --cov=./ --cov-config=.coveragerc --cov-report xml:cov.xml --cov-report term-missing - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - file: ./cov.xml # optional - flags: unittests # optional - name: codecov-github # optional - fail_ci_if_error: true # optional (default = false) + token: ${{ secrets.CODECOV_TOKEN }} + file: ./cov.xml + flags: unittests + name: codecov-github + fail_ci_if_error: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 00e0335f..c6967ec9 100644 --- a/.gitignore +++ b/.gitignore @@ -188,4 +188,5 @@ fabric.properties #pytest quai20 .vscode/ .pytest_cache -knotebooks/ \ No newline at end of file +knotebooks/ +argopy/tests/cov.xml diff --git a/argopy/data_fetchers/argovis_data.py b/argopy/data_fetchers/argovis_data.py index f02706d5..c997d4d8 100644 --- a/argopy/data_fetchers/argovis_data.py +++ b/argopy/data_fetchers/argovis_data.py @@ -15,7 +15,6 @@ from .proto import ArgoDataFetcherProto from abc import abstractmethod import warnings -import distributed from argopy.stores import httpstore from argopy.options import OPTIONS @@ -30,6 +29,7 @@ api_server + "/selection/overview" ) # URL to check if the API is alive + class ArgovisDataFetcher(ArgoDataFetcherProto): ### # Methods to be customised for a specific Argovis request @@ -337,7 +337,7 @@ def dashboard(self, **kw): class Fetch_box(ArgovisDataFetcher): - + def init(self, box: list): """ Create Argo data loader @@ -388,8 +388,8 @@ def get_url_shape(self): def get_url_rect(self): """ Return the URL used to download data """ - strCorner = lambda b, i: str([b[i[0]],b[i[1]]]).replace(" ", "") - strDate = lambda b, i: pd.to_datetime(b[i]).strftime("%Y-%m-%dT%H:%M:%SZ") + def strCorner(b, i): return str([b[i[0]], b[i[1]]]).replace(" ", "") + def strDate(b, i): return pd.to_datetime(b[i]).strftime("%Y-%m-%dT%H:%M:%SZ") url = self.server + "/selection/box/profiles" url += "?startDate={}".format(strDate(self.BOX, 6)) url += "&endDate={}".format(strDate(self.BOX, 7)) diff --git a/argopy/data_fetchers/erddap_data.py b/argopy/data_fetchers/erddap_data.py index fdc3411f..71c1a568 100644 --- a/argopy/data_fetchers/erddap_data.py +++ b/argopy/data_fetchers/erddap_data.py @@ -25,13 +25,16 @@ from argopy.stores import httpstore from argopy.plotters import open_dashboard -# Dirty fix before https://github.com/ioos/erddapy/issues/140 -if isconnected(): + +# Load erddapy according to available version (breaking changes in v0.8.0) +try: from erddapy import ERDDAP from erddapy.utilities import parse_dates, quote_string_constraints -else: - from unittest.mock import MagicMock - sys.modules['ERDDAP'] = MagicMock() +except: + # >= v0.8.0 + from erddapy.erddapy import ERDDAP + from erddapy.erddapy import _quote_string_constraints as quote_string_constraints + from erddapy.erddapy import parse_dates access_points = ['wmo', 'box'] diff --git a/argopy/data_fetchers/erddap_index.py b/argopy/data_fetchers/erddap_index.py index 8c8eb707..8f4b1532 100644 --- a/argopy/data_fetchers/erddap_index.py +++ b/argopy/data_fetchers/erddap_index.py @@ -19,10 +19,17 @@ from argopy.utilities import load_dict, mapp_dict, isconnected, format_oneline from argopy.stores import httpstore -# Dirty fix before https://github.com/ioos/erddapy/issues/140 -if isconnected(): + +# Load erddapy according to available version (breaking changes in v0.8.0) +try: from erddapy import ERDDAP from erddapy.utilities import parse_dates, quote_string_constraints +except: + # >= v0.8.0 + from erddapy.erddapy import ERDDAP + from erddapy.erddapy import _quote_string_constraints as quote_string_constraints + from erddapy.erddapy import parse_dates + access_points = ['wmo', 'box'] exit_formats = ['xarray', 'dataframe'] diff --git a/argopy/data_fetchers/localftp_index.py b/argopy/data_fetchers/localftp_index.py index 5dcdbb98..104de210 100644 --- a/argopy/data_fetchers/localftp_index.py +++ b/argopy/data_fetchers/localftp_index.py @@ -28,22 +28,12 @@ """ import os -from glob import glob import numpy as np -import pandas as pd -import xarray as xr from abc import ABC, abstractmethod -import warnings -import getpass -import multiprocessing as mp -import distributed - -from .proto import ArgoDataFetcherProto -from argopy.errors import NetCDF4FileNotFoundError -from argopy.utilities import list_standard_variables, load_dict, mapp_dict, check_localftp, format_oneline +from argopy.utilities import load_dict, mapp_dict, check_localftp, format_oneline from argopy.options import OPTIONS -from argopy.stores import filestore, indexstore, indexfilter_wmo, indexfilter_box +from argopy.stores import indexstore, indexfilter_wmo, indexfilter_box access_points = ['wmo', 'box'] exit_formats = ['xarray', 'dataframe'] @@ -180,7 +170,7 @@ def init(self, box: list = [-180, 180, -90, 90, '1900-01-01', '2100-12-31']): The box domain to load all Argo data for: box = [lon_min, lon_max, lat_min, lat_max, pres_min, pres_max, datim_min, datim_max] """ - if len(box) != 4 and len(box) !=6 : + if len(box) != 4 and len(box) != 6: raise ValueError('Box must be 4 or 6 length') self.BOX = box self.fcls = indexfilter_box(self.BOX) diff --git a/argopy/errors.py b/argopy/errors.py index 8bda9d71..eebfe4c3 100644 --- a/argopy/errors.py +++ b/argopy/errors.py @@ -4,10 +4,12 @@ A bunch of custom errors used in argopy. """ + class DataNotFound(ValueError): """ Raise when a data selection returns nothing """ pass + class FtpPathError(ValueError): """ Raise when the ftp path is not appropriate """ pass diff --git a/argopy/plotters.py b/argopy/plotters.py index d3c4f09d..93968693 100644 --- a/argopy/plotters.py +++ b/argopy/plotters.py @@ -68,7 +68,7 @@ def open_dashboard(wmo=None, cyc=None, width="100%", height=1000, url=None, type url = "https://fleetmonitoring.euro-argo.eu" else: url = "https://fleetmonitoring.euro-argo.eu/float/{}".format(str(wmo)) - elif type == 'coriolis': # Open Coriolis dashboard + elif type == 'coriolis': # Open Coriolis dashboard if wmo is not None: url = ("https://co-insitucharts.ifremer.fr/platform/{}/charts").format(str(wmo)) diff --git a/argopy/xarray.py b/argopy/xarray.py index 997319e2..fb58955f 100644 --- a/argopy/xarray.py +++ b/argopy/xarray.py @@ -214,13 +214,34 @@ def filter_data_mode(self, keep_error: bool = True, errors: str = 'raise'): ######### # Sub-functions ######### + def safe_where_eq(xds, key, value): + # xds.where(xds[key] == value, drop=True) is not safe to empty time variables, cf issue #64 + try: + return xds.where(xds[key] == value, drop=True) + except ValueError as v: + if v.args[0] == ("zero-size array to reduction operation " + "minimum which has no identity"): + # A bug in xarray will cause a ValueError if trying to + # decode the times in a NetCDF file with length 0. + # See: + # https://github.com/pydata/xarray/issues/1329 + # https://github.com/euroargodev/argopy/issues/64 + # Here, we just need to return an empty array + TIME = xds['TIME'] + xds = xds.drop_vars('TIME') + xds = xds.where(xds[key] == value, drop=True) + xds['TIME'] = xr.DataArray(np.arange(len(xds['N_POINTS'])), dims='N_POINTS', + attrs=TIME.attrs).astype(np.datetime64) + xds = xds.set_coords('TIME') + return xds + def ds_split_datamode(xds): """ Create one dataset for each of the data_mode Split full dataset into 3 datasets """ # Real-time: - argo_r = xds.where(xds['DATA_MODE'] == 'R', drop=True) + argo_r = safe_where_eq(xds, 'DATA_MODE', 'R') for v in plist: vname = v.upper() + '_ADJUSTED' if vname in argo_r: @@ -232,7 +253,7 @@ def ds_split_datamode(xds): if vname in argo_r: argo_r = argo_r.drop_vars(vname) # Real-time adjusted: - argo_a = xds.where(xds['DATA_MODE'] == 'A', drop=True) + argo_a = safe_where_eq(xds, 'DATA_MODE', 'A') for v in plist: vname = v.upper() if vname in argo_a: @@ -241,7 +262,8 @@ def ds_split_datamode(xds): if vname in argo_a: argo_a = argo_a.drop_vars(vname) # Delayed mode: - argo_d = xds.where(xds['DATA_MODE'] == 'D', drop=True) + argo_d = safe_where_eq(xds, 'DATA_MODE', 'D') + return argo_r, argo_a, argo_d def fill_adjusted_nan(ds, vname): @@ -295,7 +317,9 @@ def new_arrays(argo_r, argo_a, argo_d, vname): return ds # Define variables to filter: - possible_list = ['PRES', 'TEMP', 'PSAL', + possible_list = ['PRES', + 'TEMP', + 'PSAL', 'DOXY', 'CHLA', 'BBP532', diff --git a/binder/environment.yml b/binder/environment.yml index a7adf9ab..0e046bf6 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -1,36 +1,39 @@ -name: euroargodev +name: argopy-binder channels: - conda-forge dependencies: - - python=3.6 - - xarray - - dask - - distributed - - dask-kubernetes - - gcsfs - - zarr - - matplotlib - - numcodecs - - python-blosc - - lz4 - - nomkl - - nbserverproxy - - jupyter - - jupyterlab=0.35 - - jupyterlab_launcher - - jupyter_client - - jupyter_server - - ipywidgets - - graphviz - - nodejs - - scikit-image - - scikit-learn + - python=3.8 + - xarray=0.16.1 + - aiohttp=3.6.2 + - black=20.8b1 + - dask=2.30.0 + - distributed=2.30.0 + - matplotlib=3.3.2 + - zarr=2.4.0 + - scikit-learn=0.23.2 + - ipython=7.18.1 + - netcdf4=1.5.4 + - seaborn=0.11.0 + - flake8=3.8.4 + - erddapy=0.7.2 + - fsspec=0.8.3 + - gsw=3.4.0 + - bottleneck=1.3.2 + - cftime=1.2.1 + - cfgrib=0.9.8.4 + - pytest=6.1.1 + - pytest-cov=2.10.1 + - pytest-env=0.6.2 + - setuptools=49.6.0 + - pip=20.2.3 + - tqdm=4.50.2 + - ipykernel=5.3.4 + - cartopy=0.18.0 + - ipywidgets=7.5.1 - pip - pip: - graphviz - jupyter-server-proxy - - netCDF4 - - erddapy - gitpython - cmocean - geopandas diff --git a/binder/jupyterlab-workspace.json b/binder/jupyterlab-workspace.json index 3b59acff..cb8339b6 100644 --- a/binder/jupyterlab-workspace.json +++ b/binder/jupyterlab-workspace.json @@ -3,48 +3,14 @@ "layout-restorer:data": { "main": { "dock": { - "type": "split-area", - "orientation": "horizontal", - "sizes": [ - 0.5, - 0.5 - ], - "children": [ - { - "type": "tab-area", - "currentIndex": 0, - "widgets": [ - "markdownviewer-widget:README.md" - ] - }, - { - "type": "split-area", - "orientation": "vertical", - "sizes": [ - 0.5, - 0.5 - ], - "children": [ - { - "type": "tab-area", - "currentIndex": 0, - "widgets": [ - "notebook:01-Launch_Dask_Cluster.ipynb" - ] - }, - { - "type": "tab-area", - "currentIndex": 0, - "widgets": [ - "terminal:1" - ] - } - ] - } + "type": "tab-area", + "currentIndex": 0, + "widgets": [ + "notebook:argopy/docs/tryit.ipynb" ] }, "mode": "multiple-document", - "current": "terminal:1" + "current": "notebook:argopy/docs/tryit.ipynb" }, "left": { "collapsed": true, @@ -62,22 +28,26 @@ "widgets": [] } }, - "terminal:1": { - "data": { - "name": "1" + "@jupyterlab/settingeditor-extension:plugin": { + "sizes": [ + 0.16987416728349372, + 0.8301258327165063 + ], + "container": { + "plugin": "@jupyterlab/apputils-extension:themes", + "sizes": [ + 0.5, + 0.5 + ] } }, - "notebook:Dask-Graph.ipynb": { - "data": { - "path": "practice/environment/01-Launch_Dask_Cluster.ipynb", - "factory": "Notebook" - } + "file-browser-filebrowser:cwd": { + "path": "argopy/docs" }, - - "markdownviewer-widget:README.md": { + "notebook:argopy/docs/tryit.ipynb": { "data": { - "path": "practice/README.md", - "factory": "Markdown Preview" + "path": "argopy/docs/tryit.ipynb", + "factory": "Notebook" } } }, diff --git a/binder/postBuild b/binder/postBuild index d50acbd9..4d59d65b 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -9,4 +9,4 @@ jupyter labextension install @jupyter-widgets/jupyterlab-manager \ jupyter serverextension enable --sys-prefix dask_labextension jupyter lab workspaces import binder/jupyterlab-workspace.json -#EOF \ No newline at end of file +#EOF diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml new file mode 100644 index 00000000..28e453e6 --- /dev/null +++ b/ci/requirements/doc.yml @@ -0,0 +1,39 @@ +name: argopy-docs +channels: + - conda-forge +dependencies: + - python=3.8 + - xarray=0.16.1 + - aiohttp=3.6.2 + - black=20.8b1 + - dask=2.30.0 + - distributed=2.30.0 + - matplotlib=3.3.2 + - zarr=2.4.0 + - scikit-learn=0.23.2 + - ipython=7.18.1 + - netcdf4=1.5.4 + - seaborn=0.11.0 + - flake8=3.8.4 + - erddapy=0.7.2 + - fsspec=0.8.3 + - gsw=3.4.0 + - bottleneck=1.3.2 + - cftime=1.2.1 + - cfgrib=0.9.8.4 + - pytest=6.1.1 + - pytest-cov=2.10.1 + - pytest-env=0.6.2 + - setuptools=49.6.0 + - pip=20.2.3 + - tqdm=4.50.2 + - ipykernel=5.3.4 + - cartopy=0.18.0 + - ipywidgets=7.5.1 + - sphinx=3.2.1 + - sphinx_rtd_theme=0.4.3 + - sphinx-autosummary-accessors=0.1.2 + - nbsphinx=0.7.1 + - numpydoc=1.1.0 + - pip: + - sphinx_issues==1.2.0 diff --git a/ci/requirements/py3.6-dev.yml b/ci/requirements/py3.6-dev.yml new file mode 100644 index 00000000..e8bc1825 --- /dev/null +++ b/ci/requirements/py3.6-dev.yml @@ -0,0 +1,32 @@ +name: argopy-tests +channels: + - conda-forge +dependencies: + - python=3.6 + - xarray=0.15.0 + - aiohttp=3.6.2 + - black=20.8b1 + - dask=2.9.2 + - distributed=2.9.3 + - matplotlib=3.1.3 + - zarr=2.3.2 + - scikit-learn=0.22.2 + - ipython=7.13.0 + - netcdf4=1.4.3.2 + - seaborn=0.9.0 + - flake8=3.8.3 + - erddapy=0.6.0 + - fsspec=0.8.2 + - gsw=3.3.1 + - bottleneck=1.2.1 + - cftime=1.0.4.2 + - cfgrib=0.9.8.4 + - pytest=6.0.2 + - pytest-cov=2.10.1 + - pytest-env=0.6.2 + - setuptools=38.4.0 + - pip=20.2.3 + - tqdm=4.49.0 + - ipykernel=5.3.4 + - cartopy=0.17.0 + - ipywidgets=7.5.1 \ No newline at end of file diff --git a/ci/requirements/py3.7-dev.yml b/ci/requirements/py3.7-dev.yml new file mode 100644 index 00000000..17eafbba --- /dev/null +++ b/ci/requirements/py3.7-dev.yml @@ -0,0 +1,32 @@ +name: argopy-tests +channels: + - conda-forge +dependencies: + - python=3.7 + - xarray=0.16.1 + - aiohttp=3.7.2 + - black=19.10 + - dask=2.30.0 + - distributed=2.30.1 + - matplotlib=3.3.2 + - zarr=2.5.0 + - scikit-learn=0.23.2 + - ipython=5.8.0 + - netcdf4=1.5.4 + - seaborn=0.11.0 + - flake8=3.8.4 + - erddapy=0.8.0 + - fsspec=0.8.3 + - gsw=3.4.0 + - bottleneck=1.3.2 + - cftime=1.2.1 + - cfgrib=0.9.8 + - pytest=6.1.1 + - pytest-cov=2.10.1 + - pytest-env=0.6.2 + - setuptools=50.3.1 + - pip=20.2.4 + - tqdm=4.50.2 + - ipykernel=5.3.4 + - cartopy=0.18.0 + - ipywidgets=7.5.1 \ No newline at end of file diff --git a/ci/requirements/py3.7-free.yml b/ci/requirements/py3.7-free.yml new file mode 100644 index 00000000..7b7304d0 --- /dev/null +++ b/ci/requirements/py3.7-free.yml @@ -0,0 +1,32 @@ +name: argopy-tests +channels: + - conda-forge +dependencies: + - python=3.7 + - xarray + - aiohttp + - black + - dask + - distributed + - matplotlib + - zarr + - scikit-learn + - ipython + - netcdf4 + - seaborn + - flake8 + - erddapy + - fsspec + - gsw + - bottleneck + - cftime + - cfgrib + - pytest + - pytest-cov + - pytest-env + - setuptools + - pip + - tqdm + - ipykernel + - cartopy + - ipywidgets \ No newline at end of file diff --git a/ci/requirements/py3.8-dev.yml b/ci/requirements/py3.8-dev.yml new file mode 100644 index 00000000..3fb0d023 --- /dev/null +++ b/ci/requirements/py3.8-dev.yml @@ -0,0 +1,32 @@ +name: argopy-tests +channels: + - conda-forge +dependencies: + - python=3.8 + - xarray=0.16.1 + - aiohttp=3.6.2 + - black=20.8b1 + - dask=2.30.0 + - distributed=2.30.0 + - matplotlib=3.3.2 + - zarr=2.4.0 + - scikit-learn=0.23.2 + - ipython=7.18.1 + - netcdf4=1.5.4 + - seaborn=0.11.0 + - flake8=3.8.4 + - erddapy=0.7.2 + - fsspec=0.8.3 + - gsw=3.4.0 + - bottleneck=1.3.2 + - cftime=1.2.1 + - cfgrib=0.9.8.4 + - pytest=6.1.1 + - pytest-cov=2.10.1 + - pytest-env=0.6.2 + - setuptools=49.6.0 + - pip=20.2.3 + - tqdm=4.50.2 + - ipykernel=5.3.4 + - cartopy=0.18.0 + - ipywidgets=7.5.1 \ No newline at end of file diff --git a/ci/requirements/py3.8-free.yml b/ci/requirements/py3.8-free.yml new file mode 100644 index 00000000..85223301 --- /dev/null +++ b/ci/requirements/py3.8-free.yml @@ -0,0 +1,32 @@ +name: argopy-tests +channels: + - conda-forge +dependencies: + - python=3.8 + - xarray + - aiohttp + - black + - dask + - distributed + - matplotlib + - zarr + - scikit-learn + - ipython + - netcdf4 + - seaborn + - flake8 + - erddapy + - fsspec + - gsw + - bottleneck + - cftime + - cfgrib + - pytest + - pytest-cov + - pytest-env + - setuptools + - pip + - tqdm + - ipykernel + - cartopy + - ipywidgets \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index cdd5a966..dc1fe537 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,6 @@ import os import pathlib -import subprocess import sys import xarray import datetime @@ -137,7 +136,9 @@ nbsphinx_execute = "always" # nbsphinx_prolog = """ # {% set docname = env.doc2path(env.docname, base=None) %} -# You can run this notebook in a `live session `_ |Binder| or view it `on Github `_. +# You can run this notebook in a `live session: +# `_ |Binder| +# or view it `on Github `_. # .. |Binder| image:: https://mybinder.org/badge.svg # :target: https://mybinder.org/v2/gh/euroargodev/argopy/master-doc?urlpath=lab/tree/docs/{{ docname }} # """ @@ -203,8 +204,8 @@ html_static_path = ['_static'] html_theme_options = { - # 'canonical_url': '', - 'analytics_id': 'UA-73130866-2', # Provided by Google in your dashboard + # 'canonical_url': '', + 'analytics_id': 'UA-73130866-2', # Provided by Google in your dashboard 'logo_only': True, 'display_version': False, 'prev_next_buttons_location': 'bottom', @@ -300,4 +301,4 @@ 'sklearn': ('https://scikit-learn.org/stable/', None), 'seaborn': ('https://seaborn.pydata.org/', None), 'fsspec': ('https://filesystem-spec.readthedocs.io/en/stable/', None) -} \ No newline at end of file +} diff --git a/docs/data_sources.ipynb b/docs/data_sources.ipynb index 060e0188..b0ee1824 100644 --- a/docs/data_sources.ipynb +++ b/docs/data_sources.ipynb @@ -291,10 +291,15 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, + "cell_type": "raw", + "metadata": { + "raw_mimetype": "text/restructuredtext" + }, "source": [ - "## Status of sources\n", + ".. _api-status:\n", + "\n", + "Status of sources\n", + "-----------------\n", "\n", "With remote, online data sources, it may happens that the data server is experiencing down time. \n", "With local data sources, the availability of the path is checked when it is set. But it may happens that the path points to a disk that get unmounted or unplugged after the option setting." @@ -320,9 +325,7 @@ ".. image:: _static/status_monitor_down.png\n", " :width: 350 \n", " \n", - "Note that the :meth:`argopy.status` method as an ``refresh`` option to let you specify the refresh rate in seconds of the monitoring.\n", - "\n", - "`Link text `_\n", + "Note that the :meth:`argopy.status` method has a ``refresh`` option to let you specify the refresh rate in seconds of the monitoring.\n", "\n", "Last, you can check out `the following argopy status webpage that monitors all important ressources to the software `_." ] diff --git a/docs/whats-new.rst b/docs/whats-new.rst index 54d8e7c2..f2883e0b 100644 --- a/docs/whats-new.rst +++ b/docs/whats-new.rst @@ -3,12 +3,12 @@ What's New ========== -v0.1.7 (XX Oct. 2020) +v0.1.7 (XX Nov. 2020) ----------------------- **Features and front-end API** -- Live monitor for the status (availability) of data sources. (:pr:`36`) by `G. Maze `_. +- Live monitor for the status (availability) of data sources. See documentation page on :ref:`api-status`. (:pr:`36`) by `G. Maze `_. .. code-block:: python @@ -38,6 +38,8 @@ v0.1.7 (XX Oct. 2020) - New ``open_mfdataset`` and ``open_mfjson`` methods in Argo stores. These can be used to open, preprocess and concatenate a collection of paths both in sequential or parallel order. (:pr:`28`) by `G. Maze `_. +- Unit testing is now done on a controlled conda environment. This allows to more easily identify errors coming from development vs errors due to dependencies update. (:pr:`65`) by `G. Maze `_. + v0.1.6 (31 Aug. 2020) --------------------- diff --git a/readthedocs.yml b/readthedocs.yml index f04af5d9..6342e7e8 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -11,12 +11,8 @@ version: 2 # Optionally build your docs in additional formats such as PDF and ePub formats: + - pdf - htmlzip -# Optionally set the version of Python and requirements required to build your docs -python: - version: 3.6 - system_packages: true - install: - - requirements: requirements.txt - - requirements: docs/requirements.txt \ No newline at end of file +conda: + environment: ci/requirements/doc.yml \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 966fb9f2..424607ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ scipy>=1.1.0 -xarray==0.15.1 +xarray>=0.15.1 scikit-learn>=0.21 ipython>=5.0.0 numpydoc>=0.6.0 @@ -7,7 +7,8 @@ netCDF4>=1.3.1 dask>=2.9 toolz>=0.8.2 erddapy>=0.6 -fsspec>=0.7.4 +fsspec>=0.7.4, <0.8.4 gsw>=3.3.1 tqdm>=4.46.0 -aiohttp>=3.6.2 \ No newline at end of file +aiohttp>=3.6.2 +ipywidgets>=7.5.1 \ No newline at end of file