From fd48d01c645edefda22439d99c7391799a65c34f Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Thu, 15 Oct 2020 22:20:27 +0200 Subject: [PATCH 01/45] Update xarray.py --- argopy/xarray.py | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/argopy/xarray.py b/argopy/xarray.py index 8e04a9d7..7a22a362 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 = ds.where(ds['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 = ds.where(ds['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,7 @@ def ds_split_datamode(xds): if vname in argo_a: argo_a = argo_a.drop_vars(vname) # Delayed mode: - argo_d = ds.where(ds['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 +316,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', From ce39e9c641ffc9b4f57ec5bb6a4f814152a38e50 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Fri, 16 Oct 2020 19:28:46 +0200 Subject: [PATCH 02/45] Update pythontests.yml Try to run only on mac os, to see if I can reproduce the GH failures --- .github/workflows/pythontests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 9d3bffbd..8cb99c56 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: python-version: [3.6, 3.7, 3.8] - os: [ubuntu-latest, macos-latest] + os: [macos-latest] steps: - uses: actions/checkout@master From f44da7da39abeefb90d2457459215032a9cd8c70 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Fri, 6 Nov 2020 12:43:50 +0100 Subject: [PATCH 03/45] Update erddap_data.py --- argopy/data_fetchers/erddap_data.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/argopy/data_fetchers/erddap_data.py b/argopy/data_fetchers/erddap_data.py index 08e08cbe..59167820 100644 --- a/argopy/data_fetchers/erddap_data.py +++ b/argopy/data_fetchers/erddap_data.py @@ -24,8 +24,15 @@ from argopy.stores import httpstore from argopy.plotters import open_dashboard -from erddapy import ERDDAP -from erddapy.utilities import parse_dates, quote_string_constraints +# 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"] From b11d6917c9a1c326b4d54734c1e1b1411cd44e23 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Fri, 6 Nov 2020 12:43:53 +0100 Subject: [PATCH 04/45] Update erddap_index.py --- argopy/data_fetchers/erddap_index.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/argopy/data_fetchers/erddap_index.py b/argopy/data_fetchers/erddap_index.py index 6b06e6fe..81d5fdd7 100644 --- a/argopy/data_fetchers/erddap_index.py +++ b/argopy/data_fetchers/erddap_index.py @@ -19,8 +19,17 @@ from argopy.utilities import load_dict, mapp_dict, format_oneline from argopy.stores import httpstore -from erddapy import ERDDAP -from erddapy.utilities import parse_dates, quote_string_constraints +# from erddapy import ERDDAP +# from erddapy.utilities import parse_dates, quote_string_constraints +# 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'] From b01bf91c2303e583dc3dd4d26e88cf908bae09c6 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 10:43:23 +0100 Subject: [PATCH 05/45] Misc flake8 fixes --- argopy/errors.py | 2 ++ argopy/plotters.py | 2 +- argopy/utilities.py | 23 ++++++++++++++--------- docs/conf.py | 11 ++++++----- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/argopy/errors.py b/argopy/errors.py index 5994e784..f17d45d7 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/utilities.py b/argopy/utilities.py index ca41a332..f8738da7 100644 --- a/argopy/utilities.py +++ b/argopy/utilities.py @@ -48,7 +48,7 @@ def clear_cache(): elif os.path.isdir(file_path): shutil.rmtree(file_path) except Exception as e: - print('Failed to delete %s. Reason: %s' % (file_path, e)) + print("Failed to delete %s. Reason: %s" % (file_path, e)) def load_dict(ptype): @@ -76,6 +76,7 @@ def list_available_data_src(): AVAILABLE_SOURCES = {} try: from .data_fetchers import erddap_data as Erddap_Fetchers + AVAILABLE_SOURCES["erddap"] = Erddap_Fetchers except Exception: warnings.warn( @@ -87,6 +88,7 @@ def list_available_data_src(): try: from .data_fetchers import localftp_data as LocalFTP_Fetchers + AVAILABLE_SOURCES["localftp"] = LocalFTP_Fetchers except Exception: warnings.warn( @@ -98,6 +100,7 @@ def list_available_data_src(): try: from .data_fetchers import argovis_data as ArgoVis_Fetchers + AVAILABLE_SOURCES["argovis"] = ArgoVis_Fetchers except Exception: warnings.warn( @@ -582,17 +585,19 @@ def _regular_interp(x, y, target_values): x = x[~idx] y = y[~idx] - #Need at least 5 points in the profile to interpolate, otherwise, return NaNs - if(len(y)<5): + # Need at least 5 points in the profile to interpolate, otherwise, return NaNs + if len(y) < 5: interpolated = np.empty(len(target_values)) interpolated[:] = np.nan - else : + else: # replace nans in target_values with out of bound Values (just in case) target_values = np.where( - ~np.isnan(target_values), target_values, np.nanmax(x) + 1) - # Interpolate with fill value parameter to extend min pressure toward 0 + ~np.isnan(target_values), target_values, np.nanmax(x) + 1 + ) + # Interpolate with fill value parameter to extend min pressure toward 0 interpolated = interpolate.interp1d( - x, y, bounds_error=False, fill_value=(y[0], y[-1]))(target_values) + x, y, bounds_error=False, fill_value=(y[0], y[-1]) + )(target_values) return interpolated # infer dim from input @@ -900,12 +905,12 @@ def format_oneline(s, max_width=65): if q == 0: return "".join([s[0:n], padding, s[-n:]]) else: - return "".join([s[0:n+1], padding, s[-n:]]) + return "".join([s[0 : n + 1], padding, s[-n:]]) else: return s -def is_box(box : list, errors="raise"): +def is_box(box: list, errors="raise"): """ Check if this array matches a 2d or 3d box definition box = [lon_min, lon_max, lat_min, lat_max, pres_min, pres_max] 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 +} From f182a0ccb9fb5cb917d64e7283ae20c358e32a9a Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 11:14:18 +0100 Subject: [PATCH 06/45] Update pythontests.yml --- .github/workflows/pythontests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 8cb99c56..edae0f77 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: python-version: [3.6, 3.7, 3.8] - os: [macos-latest] + os: [ubuntu-latest] steps: - uses: actions/checkout@master From 5cfca8a9a5657f1f3e8d2356ee2d8710a8288aed Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 14:54:19 +0100 Subject: [PATCH 07/45] test without 3.8 but with xr>0.15 --- .github/workflows/pythontests.yml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index e01d8163..05371cb2 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7] os: [ubuntu-latest] steps: diff --git a/requirements.txt b/requirements.txt index 966fb9f2..fbbc8bb8 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 From e4fe4bdda76cabb55089c9f3a12fa4c6b868b650 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:02:39 +0100 Subject: [PATCH 08/45] Misc flake8 fixes --- argopy/data_fetchers/argovis_data.py | 10 +++++----- argopy/data_fetchers/localftp_index.py | 16 +++------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/argopy/data_fetchers/argovis_data.py b/argopy/data_fetchers/argovis_data.py index f02706d5..9404858f 100644 --- a/argopy/data_fetchers/argovis_data.py +++ b/argopy/data_fetchers/argovis_data.py @@ -15,8 +15,7 @@ from .proto import ArgoDataFetcherProto from abc import abstractmethod import warnings -import distributed - +\ from argopy.stores import httpstore from argopy.options import OPTIONS from argopy.utilities import list_standard_variables, format_oneline, is_box, Chunker @@ -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/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) From 1c316fe7c4b2c2ddb64772df2259627cfe5540db Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:07:18 +0100 Subject: [PATCH 09/45] test only mac/3.7 with xr>0.15 --- .github/workflows/pythontests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 05371cb2..9f916a18 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -11,8 +11,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7] - os: [ubuntu-latest] + python-version: [3.7] + os: [mac-latest] steps: - uses: actions/checkout@master From ef50fa430c72e23b4d00974ea3a49d313c1ce3c0 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:08:47 +0100 Subject: [PATCH 10/45] Update pythontests.yml --- .github/workflows/pythontests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 9f916a18..2e57d396 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: python-version: [3.7] - os: [mac-latest] + os: [macos-latest] steps: - uses: actions/checkout@master From 0523f58b214871669840719ff49b22f97ba96b46 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:12:59 +0100 Subject: [PATCH 11/45] Update binder-badge-permissions.yaml --- .github/workflows/binder-badge-permissions.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/binder-badge-permissions.yaml b/.github/workflows/binder-badge-permissions.yaml index bb977ff2..d40b9f74 100644 --- a/.github/workflows/binder-badge-permissions.yaml +++ b/.github/workflows/binder-badge-permissions.yaml @@ -2,7 +2,10 @@ name: Binder Badge -on: [pull_request] +on: + push: + branches: + - xarray-016 jobs: binder: From 3974177e0a3ecf2a1ebedad3d2ae60c699e942d4 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:30:20 +0100 Subject: [PATCH 12/45] Update pythontests.yml --- .github/workflows/pythontests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 2e57d396..e5d6bf6f 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: python-version: [3.7] - os: [macos-latest] + os: [macos-18.7] steps: - uses: actions/checkout@master From 3b5bd99e6690fa7bc0a729787ec714fe451aca3e Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:32:36 +0100 Subject: [PATCH 13/45] Update pythontests.yml --- .github/workflows/pythontests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index e5d6bf6f..ce20c354 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: python-version: [3.7] - os: [macos-18.7] + os: [macos-10.14] steps: - uses: actions/checkout@master From 12c115afbd6d10c2f354f1ba78ee0b3718b0b6d8 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:44:48 +0100 Subject: [PATCH 14/45] Try tests with conda env --- .github/workflows/pythontests-lock.yml | 73 ++++++++++++++++++++++++++ ci/requirements/py37.yml | 32 +++++++++++ 2 files changed, 105 insertions(+) create mode 100644 .github/workflows/pythontests-lock.yml create mode 100644 ci/requirements/py37.yml diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml new file mode 100644 index 00000000..9393b7d9 --- /dev/null +++ b/.github/workflows/pythontests-lock.yml @@ -0,0 +1,73 @@ +# 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_lock + +on: + push: + branches: + - xarray-016 + +jobs: + unit-testing: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.7] + os: [macos-10.14] + + steps: + - uses: actions/checkout@master + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@master + with: + python-version: ${{ matrix.python-version }} + + - name: Set up Conda env for py-${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v1 + with: + activate-environment: argopy-tests-py37 + environment-file: ci/requirements/py37.yml + auto-update-conda: false + python-version: ${{ matrix.python-version }} + auto-activate-base: false + shell: bash -l {0} + run: | + conda info + conda list + + - name: Install dependencies with pip + 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 + + - name: Lint with flake8 + 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 + 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) diff --git a/ci/requirements/py37.yml b/ci/requirements/py37.yml new file mode 100644 index 00000000..cd639ab4 --- /dev/null +++ b/ci/requirements/py37.yml @@ -0,0 +1,32 @@ +name: argopy-tests-py37 +channels: + - conda-forge +dependencies: + - python=3.7 + - xarray + - aiohttp + - black + - dask + - distributed + - pandas + - matplotlib + - zarr + - scikit-learn + - ipython + - netcdf4 + - seaborn + - flake8 + - erddapy + - fsspec + - gsw + - bottleneck + - cftime + - cfgrib + - pytest + - pytest-cov + - pytest-env + - setuptools + - pip + - tqdm + - ipykernel + - cartopy \ No newline at end of file From 6f21de5ff615f96eb671dc2b33e4085810b4a808 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:47:33 +0100 Subject: [PATCH 15/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 9393b7d9..69907734 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -33,7 +33,7 @@ jobs: auto-update-conda: false python-version: ${{ matrix.python-version }} auto-activate-base: false - shell: bash -l {0} + - shell: bash -l {0} run: | conda info conda list From 79db90240d036c52ea709dbf13d6e6bf2f7c5ca6 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:57:00 +0100 Subject: [PATCH 16/45] Update pythontests-lock.yml Remove requirements install iwth pip, to rely only on conda --- .github/workflows/pythontests-lock.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 69907734..ddd2d267 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -38,11 +38,11 @@ jobs: conda info conda list - - name: Install dependencies with pip - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install distributed aiohttp ipywidgets +# - name: Install dependencies with pip +# 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} From 706499aee5c0d355d00e52c4f32bbc4a37754385 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:57:20 +0100 Subject: [PATCH 17/45] Update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 0b99494b6a2415826526a3c2b2676ca683d2d612 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 15:59:46 +0100 Subject: [PATCH 18/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index ddd2d267..9973edc7 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -20,10 +20,10 @@ jobs: steps: - uses: actions/checkout@master - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@master - with: - python-version: ${{ matrix.python-version }} +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@master +# with: +# python-version: ${{ matrix.python-version }} - name: Set up Conda env for py-${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v1 From eec1aa288ae6c8181268225279d8d0bfd572602c Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 16:17:54 +0100 Subject: [PATCH 19/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 9973edc7..cbb33612 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -20,11 +20,6 @@ jobs: steps: - uses: actions/checkout@master -# - name: Set up Python ${{ matrix.python-version }} -# uses: actions/setup-python@master -# with: -# python-version: ${{ matrix.python-version }} - - name: Set up Conda env for py-${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v1 with: @@ -38,29 +33,15 @@ jobs: conda info conda list -# - name: Install dependencies with pip -# 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 - - 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 From 4eccfb89e0f968ce070be433b77fc868934ad368 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 16:29:50 +0100 Subject: [PATCH 20/45] Try with fixes depend versions --- .github/workflows/pythontests-lock.yml | 16 ++++++------- ci/requirements/py37-dev.yml | 32 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 ci/requirements/py37-dev.yml diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index cbb33612..0e45e792 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -1,6 +1,3 @@ -# 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_lock on: @@ -19,12 +16,13 @@ jobs: steps: - uses: actions/checkout@master + with: $${{ github.ref }} - name: Set up Conda env for py-${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v1 with: activate-environment: argopy-tests-py37 - environment-file: ci/requirements/py37.yml + environment-file: ci/requirements/py37-dev.yml auto-update-conda: false python-version: ${{ matrix.python-version }} auto-activate-base: false @@ -47,8 +45,8 @@ jobs: - 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 diff --git a/ci/requirements/py37-dev.yml b/ci/requirements/py37-dev.yml new file mode 100644 index 00000000..a9ddccc4 --- /dev/null +++ b/ci/requirements/py37-dev.yml @@ -0,0 +1,32 @@ +name: argopy-tests-py37 +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 + - gsw=3.4.0 \ No newline at end of file From 8ebc54d2ccec4c73d3ee2a88ef0f2be451575fd0 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 16:31:11 +0100 Subject: [PATCH 21/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 0e45e792..391b91b4 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -16,7 +16,6 @@ jobs: steps: - uses: actions/checkout@master - with: $${{ github.ref }} - name: Set up Conda env for py-${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v1 From f44302685c5e9ee1517520ef90e2da17c8ffd5fb Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 16:34:20 +0100 Subject: [PATCH 22/45] Update argovis_data.py --- argopy/data_fetchers/argovis_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/argopy/data_fetchers/argovis_data.py b/argopy/data_fetchers/argovis_data.py index 9404858f..c997d4d8 100644 --- a/argopy/data_fetchers/argovis_data.py +++ b/argopy/data_fetchers/argovis_data.py @@ -15,7 +15,7 @@ from .proto import ArgoDataFetcherProto from abc import abstractmethod import warnings -\ + from argopy.stores import httpstore from argopy.options import OPTIONS from argopy.utilities import list_standard_variables, format_oneline, is_box, Chunker From c6688c3d0f3cc2617b2b8aca618cd6e0572fb6da Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 16:51:14 +0100 Subject: [PATCH 23/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 391b91b4..e70483af 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -12,12 +12,12 @@ jobs: strategy: matrix: python-version: [3.7] - os: [macos-10.14] + os: [ubuntu-latest, macos-10.14, macos-latest] steps: - uses: actions/checkout@master - - name: Set up Conda env for py-${{ matrix.python-version }} + - name: Set up environment with py-${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v1 with: activate-environment: argopy-tests-py37 @@ -25,6 +25,7 @@ jobs: auto-update-conda: false python-version: ${{ matrix.python-version }} auto-activate-base: false + - shell: bash -l {0} run: | conda info From f77094453af9d19da345df010b9d35c9cd5befee Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 17:12:01 +0100 Subject: [PATCH 24/45] Increase strategy matrix --- .github/workflows/pythontests-lock.yml | 7 +++-- ci/requirements/py3.6-dev.yml | 31 +++++++++++++++++++ .../{py37-dev.yml => py3.7-dev.yml} | 5 ++- ci/requirements/{py37.yml => py3.7-free.yml} | 2 +- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 ci/requirements/py3.6-dev.yml rename ci/requirements/{py37-dev.yml => py3.7-dev.yml} (90%) rename ci/requirements/{py37.yml => py3.7-free.yml} (94%) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index e70483af..0e9b7fdd 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -10,8 +10,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - python-version: [3.7] + python-version: [3.6, 3.7] os: [ubuntu-latest, macos-10.14, macos-latest] steps: @@ -20,8 +21,8 @@ jobs: - name: Set up environment with py-${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v1 with: - activate-environment: argopy-tests-py37 - environment-file: ci/requirements/py37-dev.yml + activate-environment: argopy-tests + environment-file: ci/requirements/${{matrix.python-version}}-dev.yml auto-update-conda: false python-version: ${{ matrix.python-version }} auto-activate-base: false diff --git a/ci/requirements/py3.6-dev.yml b/ci/requirements/py3.6-dev.yml new file mode 100644 index 00000000..99abbadf --- /dev/null +++ b/ci/requirements/py3.6-dev.yml @@ -0,0 +1,31 @@ +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 \ No newline at end of file diff --git a/ci/requirements/py37-dev.yml b/ci/requirements/py3.7-dev.yml similarity index 90% rename from ci/requirements/py37-dev.yml rename to ci/requirements/py3.7-dev.yml index a9ddccc4..8de74289 100644 --- a/ci/requirements/py37-dev.yml +++ b/ci/requirements/py3.7-dev.yml @@ -1,4 +1,4 @@ -name: argopy-tests-py37 +name: argopy-tests channels: - conda-forge dependencies: @@ -28,5 +28,4 @@ dependencies: - pip=20.2.4 - tqdm=4.50.2 - ipykernel=5.3.4 - - cartopy=0.18.0 - - gsw=3.4.0 \ No newline at end of file + - cartopy=0.18.0 \ No newline at end of file diff --git a/ci/requirements/py37.yml b/ci/requirements/py3.7-free.yml similarity index 94% rename from ci/requirements/py37.yml rename to ci/requirements/py3.7-free.yml index cd639ab4..903b6475 100644 --- a/ci/requirements/py37.yml +++ b/ci/requirements/py3.7-free.yml @@ -1,4 +1,4 @@ -name: argopy-tests-py37 +name: argopy-tests channels: - conda-forge dependencies: From 1d1508877d6effef85661edb054b38d900d62e0e Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 17:13:35 +0100 Subject: [PATCH 25/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 0e9b7fdd..309c63cd 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -22,7 +22,7 @@ jobs: uses: conda-incubator/setup-miniconda@v1 with: activate-environment: argopy-tests - environment-file: ci/requirements/${{matrix.python-version}}-dev.yml + environment-file: ci/requirements/py${{matrix.python-version}}-dev.yml auto-update-conda: false python-version: ${{ matrix.python-version }} auto-activate-base: false From 07eaf0e740a2050c6ed28bb1477a9b106776a5c2 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 17:31:43 +0100 Subject: [PATCH 26/45] Add free env test --- .../workflows/binder-badge-permissions.yaml | 34 ------------ .github/workflows/pythontests-lock.yml | 53 ++++++++++++++++++- ci/requirements/py3.7-free.yml | 1 - ci/requirements/py3.8-dev.yml | 31 +++++++++++ 4 files changed, 82 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/binder-badge-permissions.yaml create mode 100644 ci/requirements/py3.8-dev.yml diff --git a/.github/workflows/binder-badge-permissions.yaml b/.github/workflows/binder-badge-permissions.yaml deleted file mode 100644 index d40b9f74..00000000 --- a/.github/workflows/binder-badge-permissions.yaml +++ /dev/null @@ -1,34 +0,0 @@ -#./github/workflows/binder-badge-permissions.yaml - -name: Binder Badge - -on: - push: - branches: - - xarray-016 - -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/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 309c63cd..eb7079f0 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -7,13 +7,15 @@ on: jobs: unit-testing: + name: Test in dev env runs-on: ${{ matrix.os }} strategy: + max-parallel: 12 fail-fast: false matrix: - python-version: [3.6, 3.7] - os: [ubuntu-latest, macos-10.14, macos-latest] + python-version: [3.6, 3.7, 3.8] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@master @@ -51,3 +53,50 @@ jobs: flags: unittests name: codecov-github fail_ci_if_error: true + + free_env: + name: Test in free env + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: [3.7] + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@master + + - name: Set up environment with py-${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v1 + 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/ci/requirements/py3.7-free.yml b/ci/requirements/py3.7-free.yml index 903b6475..fcad5e31 100644 --- a/ci/requirements/py3.7-free.yml +++ b/ci/requirements/py3.7-free.yml @@ -8,7 +8,6 @@ dependencies: - black - dask - distributed - - pandas - matplotlib - zarr - scikit-learn diff --git a/ci/requirements/py3.8-dev.yml b/ci/requirements/py3.8-dev.yml new file mode 100644 index 00000000..e83cce0c --- /dev/null +++ b/ci/requirements/py3.8-dev.yml @@ -0,0 +1,31 @@ +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.4 + - 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 \ No newline at end of file From 48fb25647db6fdbfee09fdcf3007c2b546bb38c2 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 18:23:36 +0100 Subject: [PATCH 27/45] lock fsspec to 0.8.3 looks like its 0.8.4 which is failing tests (filenotfound when using cache) --- .github/workflows/pythontests-lock.yml | 8 +++---- ci/requirements/py3.8-dev.yml | 2 +- ci/requirements/py3.8-free.yml | 31 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 ci/requirements/py3.8-free.yml diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index eb7079f0..86a83235 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -7,7 +7,7 @@ on: jobs: unit-testing: - name: Test in dev env + name: unit-test Dev runs-on: ${{ matrix.os }} strategy: @@ -55,14 +55,14 @@ jobs: fail_ci_if_error: true free_env: - name: Test in free env + name: unit-test FREE env runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: [3.7] - os: [ubuntu-latest] + python-version: [3.7, 3.8] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@master diff --git a/ci/requirements/py3.8-dev.yml b/ci/requirements/py3.8-dev.yml index e83cce0c..e5bb8be0 100644 --- a/ci/requirements/py3.8-dev.yml +++ b/ci/requirements/py3.8-dev.yml @@ -16,7 +16,7 @@ dependencies: - seaborn=0.11.0 - flake8=3.8.4 - erddapy=0.7.2 - - fsspec=0.8.4 + - fsspec=0.8.3 - gsw=3.4.0 - bottleneck=1.3.2 - cftime=1.2.1 diff --git a/ci/requirements/py3.8-free.yml b/ci/requirements/py3.8-free.yml new file mode 100644 index 00000000..c53c4719 --- /dev/null +++ b/ci/requirements/py3.8-free.yml @@ -0,0 +1,31 @@ +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 \ No newline at end of file From d2360e71107b6d5b7400d11a4f8f10a6946e18b8 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 18:54:31 +0100 Subject: [PATCH 28/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 86a83235..436db79b 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -1,13 +1,10 @@ name: build_lock -on: - push: - branches: - - xarray-016 +on: [push, pull_request] jobs: unit-testing: - name: unit-test Dev + name: unit-test runs-on: ${{ matrix.os }} strategy: @@ -56,6 +53,7 @@ jobs: free_env: name: unit-test FREE env + experimental: true runs-on: ${{ matrix.os }} strategy: From 0dc94372e4d7f20d4d33739ffa6170d8e1fd5ded Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 18:56:43 +0100 Subject: [PATCH 29/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 436db79b..646d8586 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -2,17 +2,20 @@ name: build_lock on: [push, pull_request] + jobs: unit-testing: name: unit-test 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 @@ -53,14 +56,15 @@ jobs: free_env: name: unit-test FREE env - experimental: true 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 From 2a8ef8fbc365ad4627e80353300b7bfbf6370ef4 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 20:42:57 +0100 Subject: [PATCH 30/45] Update pythontests-lock.yml --- .github/workflows/pythontests-lock.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests-lock.yml index 646d8586..977ebf8d 100644 --- a/.github/workflows/pythontests-lock.yml +++ b/.github/workflows/pythontests-lock.yml @@ -1,8 +1,7 @@ -name: build_lock +name: build on: [push, pull_request] - jobs: unit-testing: name: unit-test From 0d8dca0d46cf21caef087ed43bd8fc2d5f8dd0b4 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 20:43:02 +0100 Subject: [PATCH 31/45] Delete pythontests.yml --- .github/workflows/pythontests.yml | 64 ------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 .github/workflows/pythontests.yml diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml deleted file mode 100644 index ce20c354..00000000 --- a/.github/workflows/pythontests.yml +++ /dev/null @@ -1,64 +0,0 @@ -# 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] - -jobs: - unit-testing: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: [3.7] - os: [macos-10.14] - - steps: - - uses: actions/checkout@master - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@master - with: - python-version: ${{ matrix.python-version }} - - # - 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 - 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 - - - name: Lint with flake8 - 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 - 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) From c50d1cf5029e4ae72baa15e3d208ad7ef691d675 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 20:43:12 +0100 Subject: [PATCH 32/45] Update pythontests.yml --- .github/workflows/{pythontests-lock.yml => pythontests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{pythontests-lock.yml => pythontests.yml} (100%) diff --git a/.github/workflows/pythontests-lock.yml b/.github/workflows/pythontests.yml similarity index 100% rename from .github/workflows/pythontests-lock.yml rename to .github/workflows/pythontests.yml From ae099f46eae7df83f1db0ff8c20eda91db94eb25 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 20:57:36 +0100 Subject: [PATCH 33/45] Update pythontests.yml --- .github/workflows/pythontests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 977ebf8d..492c6596 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@master - name: Set up environment with py-${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v1 + uses: conda-incubator/setup-miniconda@v2 with: activate-environment: argopy-tests environment-file: ci/requirements/py${{matrix.python-version}}-dev.yml @@ -69,7 +69,7 @@ jobs: - uses: actions/checkout@master - name: Set up environment with py-${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v1 + uses: conda-incubator/setup-miniconda@v2 with: activate-environment: argopy-tests environment-file: ci/requirements/py${{matrix.python-version}}-free.yml From c6bc985c71d50607eadd67ec9d78dc96404a827d Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 21:28:18 +0100 Subject: [PATCH 34/45] Add ipywidgets to env --- ci/requirements/py3.6-dev.yml | 3 ++- ci/requirements/py3.7-dev.yml | 3 ++- ci/requirements/py3.7-free.yml | 3 ++- ci/requirements/py3.8-dev.yml | 3 ++- ci/requirements/py3.8-free.yml | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ci/requirements/py3.6-dev.yml b/ci/requirements/py3.6-dev.yml index 99abbadf..e8bc1825 100644 --- a/ci/requirements/py3.6-dev.yml +++ b/ci/requirements/py3.6-dev.yml @@ -28,4 +28,5 @@ dependencies: - pip=20.2.3 - tqdm=4.49.0 - ipykernel=5.3.4 - - cartopy=0.17.0 \ No newline at end of file + - 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 index 8de74289..17eafbba 100644 --- a/ci/requirements/py3.7-dev.yml +++ b/ci/requirements/py3.7-dev.yml @@ -28,4 +28,5 @@ dependencies: - pip=20.2.4 - tqdm=4.50.2 - ipykernel=5.3.4 - - cartopy=0.18.0 \ No newline at end of file + - 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 index fcad5e31..7b7304d0 100644 --- a/ci/requirements/py3.7-free.yml +++ b/ci/requirements/py3.7-free.yml @@ -28,4 +28,5 @@ dependencies: - pip - tqdm - ipykernel - - cartopy \ No newline at end of file + - cartopy + - ipywidgets \ No newline at end of file diff --git a/ci/requirements/py3.8-dev.yml b/ci/requirements/py3.8-dev.yml index e5bb8be0..3fb0d023 100644 --- a/ci/requirements/py3.8-dev.yml +++ b/ci/requirements/py3.8-dev.yml @@ -28,4 +28,5 @@ dependencies: - pip=20.2.3 - tqdm=4.50.2 - ipykernel=5.3.4 - - cartopy=0.18.0 \ No newline at end of file + - 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 index c53c4719..85223301 100644 --- a/ci/requirements/py3.8-free.yml +++ b/ci/requirements/py3.8-free.yml @@ -28,4 +28,5 @@ dependencies: - pip - tqdm - ipykernel - - cartopy \ No newline at end of file + - cartopy + - ipywidgets \ No newline at end of file From fd3a006f8858773430a2ede16df5c85adb6a4d9a Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 21:50:01 +0100 Subject: [PATCH 35/45] Update requirements.txt Add ipywidgets for the API status utilities --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fbbc8bb8..6bdc079e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ erddapy>=0.6 fsspec>=0.7.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 From 1a4c5d0f178851067aac5164671c3e0901d0e2af Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 21:53:39 +0100 Subject: [PATCH 36/45] Build the doc with specific conda env under ci --- ci/requirements/doc.yml | 39 +++++++++++++++++++++++++++++++++++++++ readthedocs.yml | 10 +++------- 2 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 ci/requirements/doc.yml diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml new file mode 100644 index 00000000..fe8617fc --- /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 + - sphynx=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/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 From 7b5f14c50e7e87a2f8cdfa35fb4ba1f22e1853cd Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 22:34:16 +0100 Subject: [PATCH 37/45] Update doc.yml --- ci/requirements/doc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index fe8617fc..47026b0e 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -30,7 +30,7 @@ dependencies: - ipykernel=5.3.4 - cartopy=0.18.0 - ipywidgets=7.5.1 - - sphynx=3.2.1 + - sphinx=3.2.1 - sphinx_rtd_theme=0.4.3 - sphinx-autosummary-accessors=0.1.2 - nbsphinx=0.7.1 From 4996af35de96b1074f31b2397f506df45e2b13fe Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 22:47:31 +0100 Subject: [PATCH 38/45] Update doc.yml --- ci/requirements/doc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index 47026b0e..28e453e6 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -36,4 +36,4 @@ dependencies: - nbsphinx=0.7.1 - numpydoc=1.1.0 - pip: - - sphinx_issues=1.2.0 + - sphinx_issues==1.2.0 From 249d3db2ab0a0eabeee8e84b8fdc524f7ea95202 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Wed, 11 Nov 2020 23:43:33 +0100 Subject: [PATCH 39/45] Improve doc --- binder/environment.yml | 1 + docs/data_sources.ipynb | 15 +++++++++------ docs/whats-new.rst | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/binder/environment.yml b/binder/environment.yml index a7adf9ab..0e560e07 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -25,6 +25,7 @@ dependencies: - nodejs - scikit-image - scikit-learn + - gsw - pip - pip: - graphviz 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) --------------------- From 5f635fdd179bf48b6771cee650f61a1156f2435b Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Tue, 17 Nov 2020 15:25:21 +0100 Subject: [PATCH 40/45] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6bdc079e..424607ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ 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 From 65f4d0d44fe1ad700b72c8ae3395c0b93078baea Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Tue, 17 Nov 2020 21:59:31 +0100 Subject: [PATCH 41/45] Split GA for dev and free environmments --- .github/workflows/pythonFREEtests.yml | 53 +++++++++++++++++++++++++++ .github/workflows/pythontests.yml | 52 +------------------------- 2 files changed, 54 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/pythonFREEtests.yml 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 492c6596..f1dbbc71 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -1,10 +1,9 @@ -name: build +name: unit-tests on: [push, pull_request] jobs: unit-testing: - name: unit-test runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} @@ -44,55 +43,6 @@ jobs: 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 - - 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: From e3240519b3d77e169bf254f213758e94657a39a3 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Tue, 17 Nov 2020 22:00:25 +0100 Subject: [PATCH 42/45] Update pythontests.yml --- .github/workflows/pythontests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index f1dbbc71..e2c4f8b5 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -1,4 +1,4 @@ -name: unit-tests +name: build on: [push, pull_request] From a0c741ea54935799d7d22d109210d083774a4ec4 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Tue, 17 Nov 2020 22:04:17 +0100 Subject: [PATCH 43/45] Update pythontests.yml --- .github/workflows/pythontests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index e2c4f8b5..33c462e5 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -1,6 +1,6 @@ name: build -on: [push, pull_request] +on: [push] jobs: unit-testing: From 81d1dc11333ec0237d746388730fb226a939538d Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Tue, 17 Nov 2020 22:30:15 +0100 Subject: [PATCH 44/45] Update binder files to run on specific env --- binder/environment.yml | 56 +++++++++++++------------ binder/jupyterlab-workspace.json | 72 ++++++++++---------------------- 2 files changed, 50 insertions(+), 78 deletions(-) diff --git a/binder/environment.yml b/binder/environment.yml index 0e560e07..0e046bf6 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -1,37 +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 - - gsw + - 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" } } }, From ef6ba2124f0b57f74fa87959e7295da89dc0c1a8 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Tue, 17 Nov 2020 22:36:17 +0100 Subject: [PATCH 45/45] Update postBuild --- binder/postBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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