From 0695ca2b73e4d4446ecab06f574affa41e31c197 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Fri, 12 Feb 2021 15:23:27 -0700 Subject: [PATCH 1/9] prepare for v1.5.6 release --- Changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 75d03e2a6..14ba39dc4 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,5 @@ - version 1.5.6 (not yet released) -================================== + version 1.5.6 (tag v1.5.6rel) +============================== * move CI/CD tests from travis/appveyor to Github Actions (PR #1061). * move netCDF4 dir under src so module can be imported in source directory (PR #1062). * change numpy.bool to numpy.bool_ and numpy.float to numpy.float_ (float and From c8327909eb7880446a1b14bbe07e9e1af4ac544f Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Fri, 12 Feb 2021 20:20:26 -0700 Subject: [PATCH 2/9] capture_output requires python 3.7 --- src/netCDF4/_netCDF4.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netCDF4/_netCDF4.pyx b/src/netCDF4/_netCDF4.pyx index 67c1145e7..44a78085e 100644 --- a/src/netCDF4/_netCDF4.pyx +++ b/src/netCDF4/_netCDF4.pyx @@ -3276,7 +3276,7 @@ text representation of Dataset ncdumpargs = "-s" if not data: ncdumpargs += "h" result=subprocess.run(["ncdump", ncdumpargs, self.filepath()], - check=True, capture_output=True, text=True) + check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) if outfile is None: return result.stdout else: From 828c217ba913339263455551351c1bddfbc4335e Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Fri, 12 Feb 2021 20:49:31 -0700 Subject: [PATCH 3/9] test on python 3.6 --- .github/workflows/miniconda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/miniconda.yml b/.github/workflows/miniconda.yml index f9bf46277..e763d49bc 100644 --- a/.github/workflows/miniconda.yml +++ b/.github/workflows/miniconda.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [ "3.7", "3.8", "3.9"] + python-version: ["3.6", "3.7", "3.8", "3.9"] os: [windows-latest, ubuntu-latest, macos-latest] platform: [x64, x32] exclude: From 6ec9c32852e8b15511dc16a4f6b98d18ae8339c8 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Sat, 13 Feb 2021 07:17:25 -0700 Subject: [PATCH 4/9] don't run tst_cdl.py if NO_CDL set --- test/run_all.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/run_all.py b/test/run_all.py index db69e9da9..dc1aa5fc6 100755 --- a/test/run_all.py +++ b/test/run_all.py @@ -38,6 +38,11 @@ test_files.remove('tst_dap.py') test_files.insert(0,'tst_dap.py') +# Don't run CDL test (that requires ncdump/ncgen) +if os.getenv('NO_CDL'): + test_files.remove('tst_cdl.py'); + sys.stdout.write('not running tst_cdl.py ...\n') + # Build the test suite from the tests found in the test files. testsuite = unittest.TestSuite() for f in test_files: From 09b4d47f04856fa2eadc22a94abfb78e7e87e6de Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Sat, 13 Feb 2021 09:28:37 -0700 Subject: [PATCH 5/9] update --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dcb9c40b7..d866b591a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ ## News For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog). +2/15/2020: Version [1.5.6](https://pypi.python.org/pypi/netCDF4/1.5.6) released. Added `Dataset.fromcdl` and `Dataset.tocdl`, which require `ncdump` and `ncgen` utilitie. Removed python 2.7 support. + 12/20/2020: Version [1.5.5.1](https://pypi.python.org/pypi/netCDF4/1.5.5.1) released. Updated binary wheels for OSX and linux that link latest netcdf-c and hdf5 libs. From 7ad547c5df209cf8b8376d3e66bba8d55ca76c13 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Sat, 13 Feb 2021 09:30:34 -0700 Subject: [PATCH 6/9] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d866b591a..6f33fa7ce 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## News For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog). -2/15/2020: Version [1.5.6](https://pypi.python.org/pypi/netCDF4/1.5.6) released. Added `Dataset.fromcdl` and `Dataset.tocdl`, which require `ncdump` and `ncgen` utilitie. Removed python 2.7 support. +2/15/2020: Version [1.5.6](https://pypi.python.org/pypi/netCDF4/1.5.6) released. Added `Dataset.fromcdl` and `Dataset.tocdl`, which require `ncdump` and `ncgen` utilities to be in `$PATH`. Removed python 2.7 support. 12/20/2020: Version [1.5.5.1](https://pypi.python.org/pypi/netCDF4/1.5.5.1) released. Updated binary wheels for OSX and linux that link latest netcdf-c and hdf5 libs. From 417896b938d3aba4670e93e7b71f5b971da53736 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Sat, 13 Feb 2021 10:30:55 -0700 Subject: [PATCH 7/9] update docstrings --- src/netCDF4/_netCDF4.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/netCDF4/_netCDF4.pyx b/src/netCDF4/_netCDF4.pyx index 44a78085e..c0a72e67e 100644 --- a/src/netCDF4/_netCDF4.pyx +++ b/src/netCDF4/_netCDF4.pyx @@ -3225,8 +3225,8 @@ attribute does not exist on the variable. For example, """ **`fromcdl(cdlfilename, ncfilename=None, mode='a',format='NETCDF4')`** -call ncgen via subprocess to create Dataset from [CDL](https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_utilities_guide.html#cdl_guide) -text representation. +call `ncgen` via subprocess to create Dataset from [CDL](https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_utilities_guide.html#cdl_guide) +text representation. Requires `ncgen` to be installed and in `$PATH`. **`cdlfilename`**: CDL file. @@ -3260,8 +3260,8 @@ Dataset instance for `ncfilename` is returned. """ **`tocdl(self, coordvars=False, data=False, outfile=None)`** -call ncdump via subprocess to create [CDL](https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_utilities_guide.html#cdl_guide) -text representation of Dataset +call `ncdump` via subprocess to create [CDL](https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_utilities_guide.html#cdl_guide) +text representation of Dataset. Requires `ncdump` to be installed and in `$PATH`. **`coordvars`**: include coordinate variable data (via `ncdump -c`). Default False From 5d071b8bb51a841e0f8e5fd9efbbf4f59b74dfdb Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Sat, 13 Feb 2021 10:48:40 -0700 Subject: [PATCH 8/9] use encoding kwarg in subprocess.run (instead of text, not available in 3.6) --- src/netCDF4/_netCDF4.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/netCDF4/_netCDF4.pyx b/src/netCDF4/_netCDF4.pyx index c0a72e67e..577371326 100644 --- a/src/netCDF4/_netCDF4.pyx +++ b/src/netCDF4/_netCDF4.pyx @@ -3276,7 +3276,8 @@ text representation of Dataset. Requires `ncdump` to be installed and in `$PATH` ncdumpargs = "-s" if not data: ncdumpargs += "h" result=subprocess.run(["ncdump", ncdumpargs, self.filepath()], - check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + encoding='utf-8') if outfile is None: return result.stdout else: From a901113a1929bc955fb1a1b844691ba8f4d28c34 Mon Sep 17 00:00:00 2001 From: jswhit Date: Sat, 13 Feb 2021 12:44:36 -0700 Subject: [PATCH 9/9] update docs --- docs/index.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/index.html b/docs/index.html index 5f8d5e6f0..23169e08e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -487,11 +487,12 @@

Download

Requires

    +
  • Python 3.6 or later.
  • numpy array module, version 1.10.0 or later.
  • Cython, version 0.21 or later.
  • setuptools, version 18.0 or later.
  • -
  • The HDF5 C library version 1.8.4-patch1 or higher (1.8.x recommended) +
  • The HDF5 C library version 1.8.4-patch1 or higher from . netCDF version 4.4.1 or higher is recommended if using HDF5 1.10.x - otherwise resulting files may be unreadable by clients using earlier @@ -1616,7 +1617,7 @@

    In-memory (diskless) Datasets

    the parallel IO example, which is in examples/mpi_example.py. Unit tests are in the test directory.

    -

    contact: Jeffrey Whitaker jeffrey.s.whitaker@noaa.gov

    +

    contact: Jeffrey Whitaker jeffrey.s.whitaker@noaa.gov

    copyright: 2008 by Jeffrey Whitaker.

    @@ -2541,8 +2542,8 @@

    In-memory (diskless) Datasets

    fromcdl(cdlfilename, ncfilename=None, mode='a',format='NETCDF4')

    -

    call ncgen via subprocess to create Dataset from CDL -text representation.

    +

    call ncgen via subprocess to create Dataset from CDL +text representation. Requires ncgen to be installed and in $PATH.

    cdlfilename: CDL file.

    @@ -2571,12 +2572,12 @@

    In-memory (diskless) Datasets

    tocdl(self, coordvars=False, data=False, outfile=None)

    -

    call ncdump via subprocess to create CDL -text representation of Dataset

    +

    call ncdump via subprocess to create CDL +text representation of Dataset. Requires ncdump to be installed and in $PATH.

    -

    coordvars: if True, write out coordinate variable data (Default False).

    +

    coordvars: include coordinate variable data (via ncdump -c). Default False

    -

    data: if True, write out all variable data (Default False).

    +

    data: if True, write out variable data (Default False).

    outfile: If not None, file to output ncdump to. Default is to return a string.