From 5899f181cc6c4da043330d75d316fafd561abc07 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 09:22:46 -0500 Subject: [PATCH 01/33] Upload diagstats output from build test --- .github/workflows/build_testing.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 458913a4b3..dbb572efb1 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -60,6 +60,13 @@ jobs: run: | . tools/ci/runtr.sh + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: diagstats + path: | + verification/*/*run*/*StDiag* + openad: runs-on: ubuntu-latest From 19123139540099008d2c85053eb6db15a95f3028 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 09:45:16 -0500 Subject: [PATCH 02/33] Ignore warnings and download in separate job --- .github/workflows/build_testing.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index dbb572efb1..2a11b3f69a 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -64,8 +64,18 @@ jobs: uses: actions/upload-artifact@v2 with: name: diagstats - path: | - verification/*/*run*/*StDiag* + path: verification/*/*run*/*StDiag* + if-no-files-found: ignore + + python: + needs: forward + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v2 + - name: Show artifacts + shell: bash + run: ls diagstats openad: runs-on: ubuntu-latest From ae8179b3b89451c2e63892908fe91d01521fb219 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 12:41:51 -0500 Subject: [PATCH 03/33] Add tox testing of MITgcmutils --- .github/workflows/build_testing.yml | 14 ++++++++++ utils/python/MITgcmutils/tests/pipinstall.py | 28 +++++++++++++++++++ .../python/MITgcmutils/tests/test_ptracers.py | 12 ++++++++ utils/python/MITgcmutils/tox.ini | 14 ++++++++++ 4 files changed, 68 insertions(+) create mode 100755 utils/python/MITgcmutils/tests/pipinstall.py create mode 100644 utils/python/MITgcmutils/tests/test_ptracers.py create mode 100644 utils/python/MITgcmutils/tox.ini diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 2a11b3f69a..3b07ab2acd 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -71,11 +71,25 @@ jobs: needs: forward runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v2.2.0 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install Tox and other packages + run: | + pip install --upgrade pip + pip install tox - name: Download artifacts uses: actions/download-artifact@v2 - name: Show artifacts shell: bash run: ls diagstats + - name: Run Tox + run: | + cd utils/python/MITgcmutils + tox -e py38 openad: runs-on: ubuntu-latest diff --git a/utils/python/MITgcmutils/tests/pipinstall.py b/utils/python/MITgcmutils/tests/pipinstall.py new file mode 100755 index 0000000000..5da68df417 --- /dev/null +++ b/utils/python/MITgcmutils/tests/pipinstall.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# install packages one by one so we can work around missing dependency declarations +import sys +from subprocess import call + +args = sys.argv[1:] + +idash = args.index('--') +opts = args[:idash] +args = args[idash+1:] + +packages = [] +while args: + arg = args.pop(0) + myargs = [arg] + while arg[0] == '-': + arg = args.pop(0) + myargs.append(arg) + + if args and args[0] in ['<', '=', '>', '<=', '==', '>=']: + myargs[-1] += args.pop(0) + myargs[-1] += args.pop(0) + + packages.append(myargs) + +for args in packages: + call(['pip', 'install'] + opts + args) + diff --git a/utils/python/MITgcmutils/tests/test_ptracers.py b/utils/python/MITgcmutils/tests/test_ptracers.py new file mode 100644 index 0000000000..e3bd92d4a8 --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_ptracers.py @@ -0,0 +1,12 @@ +from os.path import join as pjoin, dirname +import numpy as np +import MITgcmutils as mit + +def test_iolabel(): + for i, s in zip([99, 105, 130, 999, 3800, 3843], + ['99', '0f', '0E', 'g7', 'Zi', 'ZZ']): + assert mit.iolabel(i) == s + + for i in range(1, 3844): + assert mit.iolabel2num(mit.iolabel(i)) == i + diff --git a/utils/python/MITgcmutils/tox.ini b/utils/python/MITgcmutils/tox.ini new file mode 100644 index 0000000000..ea900a60fb --- /dev/null +++ b/utils/python/MITgcmutils/tox.ini @@ -0,0 +1,14 @@ +[tox] + +[testenv] +install_command = {toxinidir}/tests/pipinstall.py {opts} -- {packages} +usedevelop = True +extras = + plot +deps = + pytest + nose + py36: matplotlib < 3.3.0 +commands = py.test +setenv = + PYTHONPATH = {toxinidir} From 2cca5c0fa151f582b71b09c16d27f67687a9c28b Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 13:10:27 -0500 Subject: [PATCH 04/33] Add test for readstats --- .github/workflows/build_testing.yml | 8 +++++--- .../python/MITgcmutils/tests/test_diagnostics.py | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 utils/python/MITgcmutils/tests/test_diagnostics.py diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 3b07ab2acd..d8dab25606 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -83,13 +83,15 @@ jobs: pip install tox - name: Download artifacts uses: actions/download-artifact@v2 + with: + name: diagstats + path: utils/python/MITgcmutils/diagstats - name: Show artifacts shell: bash run: ls diagstats - name: Run Tox - run: | - cd utils/python/MITgcmutils - tox -e py38 + run: tox -e py38 + working-directory: utils/python/MITgcmutils openad: runs-on: ubuntu-latest diff --git a/utils/python/MITgcmutils/tests/test_diagnostics.py b/utils/python/MITgcmutils/tests/test_diagnostics.py new file mode 100644 index 0000000000..acf4610c3b --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_diagnostics.py @@ -0,0 +1,16 @@ +from os.path import join as pjoin, dirname +import numpy as np +import MITgcmutils as mit + +def test_readstats(): + locals, totals, itrs = mit.readstats('diagstats/hs94.cs-32x32x5/tr_run.impIGW/dynStDiag.0000025920.txt') + assert itrs['ETAN'] == [25920, 25923, 25926, 25929] + assert itrs['UVEL'] == [25920, 25923, 25926, 25929] + assert set(locals) == {'ETAN', 'UVEL', 'VVEL', 'WVEL', 'THETA', 'PHIHYD', 'DETADT2'} + assert set(totals) == {'ETAN', 'UVEL', 'VVEL', 'WVEL', 'THETA', 'PHIHYD', 'DETADT2'} + assert locals['THETA'].shape == (4, 5, 5) + assert locals['DETADT2'].shape == (4, 1, 5) + assert totals['THETA'].shape == (4, 5) + assert totals['DETADT2'].shape == (4, 5) + assert locals['THETA'][1, 4, 1] == 8.4845124949601 + From a91dd93e612d03351cfd0807c3d3ef49b45db181 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 13:37:49 -0500 Subject: [PATCH 05/33] Add python versions --- .github/workflows/build_testing.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index f6d44d2b23..1978fecfb1 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -70,13 +70,29 @@ jobs: python: needs: forward runs-on: ubuntu-latest + strategy: + matrix: + python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + include: + - python: 2.7 + env: py27 + - python: 3.5 + env: py35 + - python: 3.6 + env: py36 + - python: 3.7 + env: py37 + - python: 3.8 + env: py38 + - python: 3.9 + env: py39 steps: - name: Checkout uses: actions/checkout@v2.2.0 - name: Setup Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: ${{ matrix.python }} - name: Install Tox and other packages run: | pip install --upgrade pip @@ -90,7 +106,7 @@ jobs: shell: bash run: ls utils/python/MITgcmutils/diagstats - name: Run Tox - run: tox -e py38 + run: tox -e ${{ matrix.env }} working-directory: utils/python/MITgcmutils openad: From f6a3351beee68e2ee5b7fbd1c23355bff1086e95 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 14:46:41 -0500 Subject: [PATCH 06/33] Add test with binary data ad baseline image --- .github/workflows/build_testing.yml | 26 ++++++++++- utils/python/MITgcmutils/tests/test_cs.py | 54 +++++++++++++++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 utils/python/MITgcmutils/tests/test_cs.py diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 1978fecfb1..99ed350cfb 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -60,13 +60,20 @@ jobs: run: | . tools/ci/runtr.sh - - name: Upload artifacts + - name: Upload diagstats uses: actions/upload-artifact@v2 with: name: diagstats path: verification/*/*run*/*StDiag* if-no-files-found: ignore + - name: Upload mnc output + uses: actions/upload-artifact@v2 + with: + name: mnc + path: verification/*/*run*/mnc_test_*/*.nc + if-no-files-found: ignore + python: needs: forward runs-on: ubuntu-latest @@ -97,7 +104,7 @@ jobs: run: | pip install --upgrade pip pip install tox - - name: Download artifacts + - name: Download diagstats output uses: actions/download-artifact@v2 with: name: diagstats @@ -105,6 +112,21 @@ jobs: - name: Show artifacts shell: bash run: ls utils/python/MITgcmutils/diagstats + - name: Download netCDF output + uses: actions/download-artifact@v2 + with: + name: mnc + path: utils/python/MITgcmutils/tests/data + - name: Show artifacts + shell: bash + run: ls utils/python/MITgcmutils/tests/data + - name: Make baseline image directory + run: mkdir baseline_images + working-directory: utils/python/MITgcmutils/tests + - name: Download baseline images + uses: wei/curl@v1.1.1 + with: + args: https://engaging-web.mit.edu/~jahn/MITgcmutils/baseline_images/cs_pcol.png -o utils/python/MITgcmutils/tests/baseline_images/cs_pcol.png - name: Run Tox run: tox -e ${{ matrix.env }} working-directory: utils/python/MITgcmutils diff --git a/utils/python/MITgcmutils/tests/test_cs.py b/utils/python/MITgcmutils/tests/test_cs.py new file mode 100644 index 0000000000..fb7ebb9825 --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_cs.py @@ -0,0 +1,54 @@ +import sys +from packaging import version +import pytest +from os.path import join as pjoin, dirname +import numpy as np +try: + import matplotlib as mpl +except ImportError: + havematplotlib = False +else: + havematplotlib = True + mpl.use('Agg') + import matplotlib.pyplot as plt + from matplotlib.testing.compare import compare_images + try: + from mpl_toolkits.basemap import Basemap + except ImportError: + havebasemap = False + else: + havebasemap = True + import MITgcmutils as mit + from MITgcmutils.cs import pcol + + try: + import matplotlib.style + except ImportError: + pass + else: + mpl.style.use('classic') + +TEST_DATA_PATH = pjoin(dirname(__file__), 'data') +BASELINE_PATH = pjoin(dirname(__file__), 'baseline_images') + +if havematplotlib: + def test_pcol(tmpdir): + with tmpdir.as_cwd(): + ds = mit.rdmnc(pjoin(TEST_DATA_PATH, + 'global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.t*.nc'), + ['XG', 'YG', 'Eta']) + x = ds['XG'] + y = ds['YG'] + e = ds['Eta'][-1] + e = np.squeeze(e) + e = np.ma.masked_where(e==0., e) + + fig = plt.figure(figsize=(6.4, 4.8)) + plt.clf() + h = pcol(x, y, e, cmap = 'jet') + pngname = 'cs_pcol.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, 'cs_pcol.png'), pngname, 13) + if err: + raise AssertionError(err) + From b1129ba0c6bd3ed2c710da6d2736a514d3415a9b Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 16:08:10 -0500 Subject: [PATCH 07/33] Use docker image from oliverjahn account --- .github/workflows/build_testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 99ed350cfb..35acec29b8 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -50,8 +50,8 @@ jobs: - name: Get a docker image and set it running run: | - docker pull mitgcm/testreport-images:ubuntu_18_04_villon - docker run -v `pwd`:/MITgcm --name ubuntu_18_04-testreport -t -d mitgcm/testreport-images:ubuntu_18_04_villon /bin/bash + docker pull oliverjahn/testreport-images:ubuntu_18_04_villon + docker run -v `pwd`:/MITgcm --name ubuntu_18_04-testreport -t -d oliverjahn/testreport-images:ubuntu_18_04_villon /bin/bash - name: Run a test env: From 9f3a1f2d2de72080a487e11f700e53705d9d623b Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Tue, 12 Jan 2021 18:23:08 -0500 Subject: [PATCH 08/33] Add mds test --- .github/workflows/build_testing.yml | 16 ++++++++++++++-- utils/python/MITgcmutils/tests/test_mds.py | 12 ++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 utils/python/MITgcmutils/tests/test_mds.py diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 35acec29b8..dfa401eb00 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -67,6 +67,13 @@ jobs: path: verification/*/*run*/*StDiag* if-no-files-found: ignore + - name: Upload mds output + uses: actions/upload-artifact@v2 + with: + name: mds + path: verification/global_ocean.90x40x15/run/pickup.ckptA* + if-no-files-found: ignore + - name: Upload mnc output uses: actions/upload-artifact@v2 with: @@ -109,10 +116,15 @@ jobs: with: name: diagstats path: utils/python/MITgcmutils/diagstats + - name: Download mds output + uses: actions/download-artifact@v2 + with: + name: mds + path: utils/python/MITgcmutils/tests/data/global_ocean.90x40x15 - name: Show artifacts shell: bash - run: ls utils/python/MITgcmutils/diagstats - - name: Download netCDF output + run: ls utils/python/MITgcmutils/tests/data + - name: Download mnc output uses: actions/download-artifact@v2 with: name: mnc diff --git a/utils/python/MITgcmutils/tests/test_mds.py b/utils/python/MITgcmutils/tests/test_mds.py new file mode 100644 index 0000000000..2f1711d879 --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_mds.py @@ -0,0 +1,12 @@ +from __future__ import print_function +from os.path import join as pjoin, dirname +import numpy as np +import MITgcmutils as mit + +TEST_DATA_PATH = pjoin(dirname(__file__), 'data') + +def test_rdmds(): + fname = pjoin(TEST_DATA_PATH, 'global_ocean.90x40x15/pickup.ckptA') + etah = mit.rdmds(fname, rec=137) + assert etah.shape == (40, 90) + From b4f61ae574cbaef4d8b658ecf5c5c62f74dd03c8 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Wed, 13 Jan 2021 10:44:07 -0500 Subject: [PATCH 09/33] Add more tests --- .github/workflows/build_testing.yml | 2 +- utils/python/MITgcmutils/tests/test_cs.py | 50 ++++++++++++++++++++ utils/python/MITgcmutils/tests/test_jmd95.py | 10 ++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 utils/python/MITgcmutils/tests/test_jmd95.py diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index dfa401eb00..b9b60a95d1 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -138,7 +138,7 @@ jobs: - name: Download baseline images uses: wei/curl@v1.1.1 with: - args: https://engaging-web.mit.edu/~jahn/MITgcmutils/baseline_images/cs_pcol.png -o utils/python/MITgcmutils/tests/baseline_images/cs_pcol.png + args: https://engaging-web.mit.edu/~jahn/MITgcmutils/baseline_images/{cs_pcol,cs_pcol_sphere,cs_pcol_sphere_old,llc_contour,llc_contourf,llc_pcol,llc_pcol_basemap,llc_pcol_stere,llc_pcol_xg}.png -o utils/python/MITgcmutils/tests/baseline_images/#1.png - name: Run Tox run: tox -e ${{ matrix.env }} working-directory: utils/python/MITgcmutils diff --git a/utils/python/MITgcmutils/tests/test_cs.py b/utils/python/MITgcmutils/tests/test_cs.py index fb7ebb9825..62b8e753e1 100644 --- a/utils/python/MITgcmutils/tests/test_cs.py +++ b/utils/python/MITgcmutils/tests/test_cs.py @@ -52,3 +52,53 @@ def test_pcol(tmpdir): if err: raise AssertionError(err) + + def test_pcol_sphere(tmpdir): + with tmpdir.as_cwd(): + ds = mit.rdmnc(pjoin(TEST_DATA_PATH, 'global_ocean.cs32x15', 'run', + 'mnc_test_0001', 'state.0000072000.*.nc'), + ['XG', 'YG', 'Eta']) + x = ds['XG'] + y = ds['YG'] + e = ds['Eta'][-1] + e = np.squeeze(e) + e = np.ma.masked_where(e==0., e) + + fig = plt.figure(figsize=(6.4, 4.8)) + plt.clf() + h = pcol(x, y, e, projection = 'sphere', cmap = 'jet') + pngname = 'cs_pcol_sphere.png' + if version.parse(mpl.__version__) < version.parse('3.3.0'): + pngname = 'cs_pcol_sphere_old.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) + if err: + raise AssertionError(err) + + if havebasemap: + def test_pcol_basemap(tmpdir): + with tmpdir.as_cwd(): + ds = mit.rdmnc(pjoin(TEST_DATA_PATH, 'global_ocean.cs32x15', 'run', + 'mnc_test_0001', 'state.0000072000.*.nc'), + ['XG', 'YG', 'Eta']) + x = ds['XG'] + y = ds['YG'] + e = ds['Eta'][-1] + e = np.squeeze(e) + e = np.ma.masked_where(e==0., e) + + fig = plt.figure(figsize=(6.4, 4.8)) + mp = Basemap(projection='moll', lon_0 = 0., + resolution = 'l', area_thresh = 1000.) + plt.clf() + h = pcol(x, y, e, projection = mp, cmap = 'jet') + mp.fillcontinents(color = 'grey') + mp.drawmapboundary() + mp.drawmeridians(np.arange(0, 360, 30)) + mp.drawparallels(np.arange(-90, 90, 30)) + pngname = 'cs_pcol_basemap.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) + if err: + raise AssertionError(err) + diff --git a/utils/python/MITgcmutils/tests/test_jmd95.py b/utils/python/MITgcmutils/tests/test_jmd95.py new file mode 100644 index 0000000000..83b9fa43a5 --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_jmd95.py @@ -0,0 +1,10 @@ +from os.path import join as pjoin, dirname +import numpy as np +from MITgcmutils import jmd95 + +TEST_DATA_PATH = pjoin(dirname(__file__), 'data') + +def test_dens(): + rho = jmd95.dens(35.5, 3., 3000.) + assert abs(rho - 1041.83267) < .00001 + # 1041.8326696373254 From ebb7f01b105fcc776cec1ec5d5c33c28671dc036 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Wed, 13 Jan 2021 10:45:39 -0500 Subject: [PATCH 10/33] Download data and add more tests --- .github/workflows/build_testing.yml | 16 ++- utils/python/MITgcmutils/tests/test_llc.py | 126 +++++++++++++++++++++ utils/python/MITgcmutils/tests/test_mnc.py | 50 ++++++++ 3 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 utils/python/MITgcmutils/tests/test_llc.py create mode 100644 utils/python/MITgcmutils/tests/test_mnc.py diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index b9b60a95d1..7e001319dc 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -132,13 +132,25 @@ jobs: - name: Show artifacts shell: bash run: ls utils/python/MITgcmutils/tests/data - - name: Make baseline image directory - run: mkdir baseline_images + - name: Create download directories + run: mkdir -p baseline_images data/llc90 data/aste data/eccov3 working-directory: utils/python/MITgcmutils/tests - name: Download baseline images uses: wei/curl@v1.1.1 with: args: https://engaging-web.mit.edu/~jahn/MITgcmutils/baseline_images/{cs_pcol,cs_pcol_sphere,cs_pcol_sphere_old,llc_contour,llc_contourf,llc_pcol,llc_pcol_basemap,llc_pcol_stere,llc_pcol_xg}.png -o utils/python/MITgcmutils/tests/baseline_images/#1.png + - name: Download mds test data + uses: wei/curl@v1.1.1 + with: + args: https://engaging-web.mit.edu/~jahn/MITgcmutils/mds/llc90/{Eta.0000000008,hFacC,XC,XG,YC,YG}.{data,meta} -o utils/python/MITgcmutils/tests/data/llc90/#1.#2 + - name: Download aste test data + uses: wei/curl@v1.1.1 + with: + args: https://engaging-web.mit.edu/~jahn/MITgcmutils/mnc/aste/grid.t0{01,02,04,05,07,08,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,37,38,39,41,42,43,44,45}.nc -o utils/python/MITgcmutils/tests/data/aste/grid.t0#1.nc + - name: Download eccov3 test data + uses: wei/curl@v1.1.1 + with: + args: https://engaging-web.mit.edu/~jahn/MITgcmutils/mnc/eccov3/dic_tave.0000025920.t[001-032].nc -o utils/python/MITgcmutils/tests/data/eccov3/dic_tave.0000025920.t#1.nc - name: Run Tox run: tox -e ${{ matrix.env }} working-directory: utils/python/MITgcmutils diff --git a/utils/python/MITgcmutils/tests/test_llc.py b/utils/python/MITgcmutils/tests/test_llc.py new file mode 100644 index 0000000000..2c86332d94 --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_llc.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +from __future__ import print_function +import sys +from os.path import join as pjoin, dirname +import numpy as np +try: + import matplotlib as mpl +except ImportError: + pass +else: + mpl.use('Agg') + import matplotlib.pyplot as plt + from matplotlib.testing.compare import compare_images + try: + from mpl_toolkits.basemap import Basemap + except ImportError: + havebasemap = False + else: + havebasemap = True + import MITgcmutils as mit + from MITgcmutils.llc import contourf, contour, pcol + + try: + import matplotlib.style + except ImportError: + pass + else: + mpl.style.use('classic') + + TEST_DATA_PATH = pjoin(dirname(__file__), 'data') + BASELINE_PATH = pjoin(dirname(__file__), 'baseline_images') + figsize = (12., 6.) + + def test_contourf(tmpdir): + with tmpdir.as_cwd(): + x = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'XC')) + y = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'YC')) + e = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'Eta'), 8) + lm = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'hFacC'), lev=0) == 0 + e[lm] = 0. + + fig = plt.figure(figsize=figsize) + plt.clf() + h = contourf(x, y, e, np.linspace(-2., 1., 31), cmap = 'jet') + plt.xlim(-180, 180) + plt.ylim(-90, 90) + pngname = 'llc_contourf.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) + if err: + raise AssertionError(err) + + def test_contour(tmpdir): + with tmpdir.as_cwd(): + x = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'XC')) + y = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'YC')) + e = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'Eta'), 8) + lm = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'hFacC'), lev=0) == 0 + e[lm] = 0. + + fig = plt.figure(figsize=figsize) + plt.clf() + h = contour(x, y, e, np.linspace(-2., 1., 31), cmap = 'jet') + plt.xlim(-180, 180) + plt.ylim(-90, 90) + pngname = 'llc_contour.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) + if err: + raise AssertionError(err) + + def test_pcol(tmpdir): + with tmpdir.as_cwd(): + x = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'XG')) + y = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'YG')) + e = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'Eta'), 8) + lm = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'hFacC'), lev=0) == 0 + e[lm] = np.nan + + fig = plt.figure(figsize=figsize) + plt.clf() + h = pcol(x, y, e, vmin=-2., vmax=1., cmap = 'jet') + pngname = 'llc_pcol.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) + if err: + raise AssertionError(err) + + def test_pcol_xg(tmpdir): + with tmpdir.as_cwd(): + x = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'XG')) + y = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'YG')) + + fig = plt.figure(figsize=figsize) + plt.clf() + h = pcol(x, y, x, vmin=-180., vmax=180., cmap = 'jet') + pngname = 'llc_pcol_xg.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) + if err: + raise AssertionError(err) + + if havebasemap: + def test_pcol_stere(tmpdir): + with tmpdir.as_cwd(): + x = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'XG')) + y = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'YG')) + e = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'Eta'), 8) + lm = mit.rdmds(pjoin(TEST_DATA_PATH, 'llc90', 'hFacC'), lev=0) == 0 + e[lm] = np.nan + + fig = plt.figure(figsize=(8., 8.)) + plt.clf() + mp = Basemap(-45, 30, 135, 30, projection='stere', lon_0=0., lat_0=90., + resolution = 'l', area_thresh = 1000.) + h = pcol(x, y, e, mp, vmin=-2., vmax=1., cmap = 'jet') + mp.fillcontinents(color = 'grey') + mp.drawmapboundary() + mp.drawmeridians(np.arange(0, 360, 30)) + mp.drawparallels(np.arange(-90, 90, 30)) + pngname = 'llc_pcol_stere.png' + plt.savefig(pngname) + err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) + if err: + raise AssertionError(err) + diff --git a/utils/python/MITgcmutils/tests/test_mnc.py b/utils/python/MITgcmutils/tests/test_mnc.py new file mode 100644 index 0000000000..a7f694346c --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_mnc.py @@ -0,0 +1,50 @@ +from __future__ import print_function +from os.path import join as pjoin, dirname +import numpy as np +import MITgcmutils as mit + +TEST_DATA_PATH = pjoin(dirname(__file__), 'data') + +def test_mnc_files_aste(): + vars = ''' + AngleCS AngleSN Depth HFacC HFacS HFacW RC RF RL RU R_low Ro_surf X XC XG Xp1 + Y YC YG Yp1 Z Zl Zp1 Zu drC drF dxC dxF dxG dxV dyC dyF dyG dyU fCori fCoriG + rA rAs rAw rAz + '''.split() + shapes = [(50, 150, 90), (50, 90, 90), (50, 90, 60), (50, 90, 150)] + shapesW = [(50, 150, 91), (50, 90, 91), (50, 90, 61), (50, 90, 151)] + stds = [0.47173731430490717, 0.48145571873661164, 0.43067785739294573, 0.38271133195229601] + stdsW = [0.12965844673176288, 0.17049717169412615, 0.19584112953893676, 0.13181097328506711] + + ds = mit.mnc.mnc_files(pjoin(TEST_DATA_PATH, 'aste', 'grid.t*.nc'), 'faces') + a = ds.variables['HFacC'][:] + assert sorted(ds.variables) == vars + assert [x.shape for x in a] == shapes + assert [x.std() for x in a] == stds + a = ds.variables['HFacW'][:] + assert [x.shape for x in a] == shapesW + assert [(np.diff(x, 1, -1).std(dtype=np.float64)) for x in a] == stdsW + + ds.close() + + +def test_rdmnc_eccov3(): + a = mit.rdmnc(pjoin(TEST_DATA_PATH, 'eccov3', 'dic_tave.*.nc')) + assert sorted(a) == ''' + T X Y dic_SUR_ave dic_SURC_ave dic_SURO_ave dic_pH_ave dic_pCO2_ave iter + '''.split() + p = a['dic_pH_ave'] + assert p.shape == (1, 160, 360) + assert p.std(dtype=np.float64) == 14.666781019324926 + assert np.diff(p, 1, -2).std(dtype=np.float64) == 5.2839897375324201 + + +def test_rdmnc_cs32(): + ds = mit.rdmnc(pjoin(TEST_DATA_PATH, 'global_ocean.cs32x15', 'run', + 'mnc_test_0001', 'oceDiag.*.nc')) + assert sorted(ds) == ''' + CONVADJ DRHODR GM_Kwx GM_Kwy GM_Kwz GM_PsiX GM_PsiY RHOAnoma T X Xp1 Y Yp1 diag_levels iter + '''.split() + assert ds['GM_PsiX'].shape == (2, 15, 32, 193) + assert np.diff(ds['GM_PsiX'], 1, -1).std(dtype=np.float64) == 0.27289287170849497 + From 05ed76bbed3aaa35e25947c01d77b2f2f1b74bbb Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Wed, 13 Jan 2021 10:46:04 -0500 Subject: [PATCH 11/33] Add large-file test in tmp_path --- utils/python/MITgcmutils/tests/test_mds.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils/python/MITgcmutils/tests/test_mds.py b/utils/python/MITgcmutils/tests/test_mds.py index 2f1711d879..978a0bc3d4 100644 --- a/utils/python/MITgcmutils/tests/test_mds.py +++ b/utils/python/MITgcmutils/tests/test_mds.py @@ -10,3 +10,15 @@ def test_rdmds(): etah = mit.rdmds(fname, rec=137) assert etah.shape == (40, 90) +def test_rdmds_large(tmp_path): + ''' + Test if we can read past 2GB + ''' + meta = tmp_path / 'UVEL.meta' + meta.symlink_to(pjoin(TEST_DATA_PATH, 'sose/UVEL.0000000060.meta')) + data = tmp_path / 'UVEL.data' + np.zeros((40,42,320,2160), ">f4").tofile(data) + base = tmp_path / 'UVEL' + u = mit.rdmds(str(base), rec=38) + assert u.shape == (42,320,2160) + From 2cf881ad2c9e0afbdce04045892f196950b3bd1f Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Wed, 13 Jan 2021 11:14:32 -0500 Subject: [PATCH 12/33] Fix order --- utils/python/MITgcmutils/tests/test_mnc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/python/MITgcmutils/tests/test_mnc.py b/utils/python/MITgcmutils/tests/test_mnc.py index a7f694346c..3017848018 100644 --- a/utils/python/MITgcmutils/tests/test_mnc.py +++ b/utils/python/MITgcmutils/tests/test_mnc.py @@ -31,7 +31,7 @@ def test_mnc_files_aste(): def test_rdmnc_eccov3(): a = mit.rdmnc(pjoin(TEST_DATA_PATH, 'eccov3', 'dic_tave.*.nc')) assert sorted(a) == ''' - T X Y dic_SUR_ave dic_SURC_ave dic_SURO_ave dic_pH_ave dic_pCO2_ave iter + T X Y dic_SURC_ave dic_SURO_ave dic_SUR_ave dic_pCO2_ave dic_pH_ave iter '''.split() p = a['dic_pH_ave'] assert p.shape == (1, 160, 360) From 252e9f5fddb3d4d7b5b890c4bc9e2143b5c76d53 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Wed, 13 Jan 2021 11:17:51 -0500 Subject: [PATCH 13/33] Complete all python tests --- .github/workflows/build_testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 7e001319dc..6f437a20d5 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -100,6 +100,7 @@ jobs: env: py38 - python: 3.9 env: py39 + continue-on-error: true steps: - name: Checkout uses: actions/checkout@v2.2.0 From ca4d4fd60b3321895d7eb6f2cfbdb242524b789e Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Wed, 13 Jan 2021 11:24:41 -0500 Subject: [PATCH 14/33] Add test for mdjwf --- utils/python/MITgcmutils/tests/test_mdjwf.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 utils/python/MITgcmutils/tests/test_mdjwf.py diff --git a/utils/python/MITgcmutils/tests/test_mdjwf.py b/utils/python/MITgcmutils/tests/test_mdjwf.py new file mode 100644 index 0000000000..11061c3963 --- /dev/null +++ b/utils/python/MITgcmutils/tests/test_mdjwf.py @@ -0,0 +1,9 @@ +from os.path import join as pjoin, dirname +import numpy as np +from MITgcmutils import mdjwf + +TEST_DATA_PATH = pjoin(dirname(__file__), 'data') + +def test_dens(): + rho = mdjwf.dens(35., 25., 2000.) + assert abs(rho - 1031.654229) < .000001 From 2597ffeb23e533f9423e6d6967aa437f7870f7c9 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 08:30:02 -0500 Subject: [PATCH 15/33] Update value --- utils/python/MITgcmutils/tests/test_mnc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/python/MITgcmutils/tests/test_mnc.py b/utils/python/MITgcmutils/tests/test_mnc.py index 3017848018..0d3d312fa5 100644 --- a/utils/python/MITgcmutils/tests/test_mnc.py +++ b/utils/python/MITgcmutils/tests/test_mnc.py @@ -35,8 +35,8 @@ def test_rdmnc_eccov3(): '''.split() p = a['dic_pH_ave'] assert p.shape == (1, 160, 360) - assert p.std(dtype=np.float64) == 14.666781019324926 - assert np.diff(p, 1, -2).std(dtype=np.float64) == 5.2839897375324201 + assert p.std(dtype=np.float64) == 3.904461562683459 + assert np.diff(p, 1, -2).std(dtype=np.float64) == 1.5623648860736261 def test_rdmnc_cs32(): From 2398002e593d88591070e17bd3663c9ca6ab201c Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 09:04:10 -0500 Subject: [PATCH 16/33] Add meta file --- .../MITgcmutils/tests/data/sose/UVEL.0000000060.meta | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 utils/python/MITgcmutils/tests/data/sose/UVEL.0000000060.meta diff --git a/utils/python/MITgcmutils/tests/data/sose/UVEL.0000000060.meta b/utils/python/MITgcmutils/tests/data/sose/UVEL.0000000060.meta new file mode 100644 index 0000000000..3291a8f1d6 --- /dev/null +++ b/utils/python/MITgcmutils/tests/data/sose/UVEL.0000000060.meta @@ -0,0 +1,9 @@ + nDims = [ 3 ]; + dimList = [ + 2160, 1, 2160, + 320, 1, 320, + 42, 1, 42 + ]; + dataprec = [ 'float32' ]; + nrecords = [ 40 ]; + timeStepNumber = [ 60 ]; From 6c53d0e3dcd8964278b42e67a8ba30831e43c605 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 08:29:56 -0500 Subject: [PATCH 17/33] Avoid use of Path in tofile --- utils/python/MITgcmutils/tests/test_mds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/python/MITgcmutils/tests/test_mds.py b/utils/python/MITgcmutils/tests/test_mds.py index 978a0bc3d4..c83e8bbf92 100644 --- a/utils/python/MITgcmutils/tests/test_mds.py +++ b/utils/python/MITgcmutils/tests/test_mds.py @@ -17,7 +17,7 @@ def test_rdmds_large(tmp_path): meta = tmp_path / 'UVEL.meta' meta.symlink_to(pjoin(TEST_DATA_PATH, 'sose/UVEL.0000000060.meta')) data = tmp_path / 'UVEL.data' - np.zeros((40,42,320,2160), ">f4").tofile(data) + np.zeros((40,42,320,2160), ">f4").tofile(str(data)) base = tmp_path / 'UVEL' u = mit.rdmds(str(base), rec=38) assert u.shape == (42,320,2160) From 206ee9512716a6bf3e0d9de2571785c1887ccda4 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 08:31:58 -0500 Subject: [PATCH 18/33] List mds test tmp dir --- .github/workflows/build_testing.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 6f437a20d5..2646546cf4 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -155,6 +155,9 @@ jobs: - name: Run Tox run: tox -e ${{ matrix.env }} working-directory: utils/python/MITgcmutils + - name: Show test output + run: ls /tmp/pytest-of-runner/pytest-0/test_rdmds_large0 + if: ${{ always() }} openad: runs-on: ubuntu-latest From b222dde58beba087926fcc924df71718cb1efc2e Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 09:53:38 -0500 Subject: [PATCH 19/33] Remove debugging steps --- .github/workflows/build_testing.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 2646546cf4..f2469157d5 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -122,17 +122,11 @@ jobs: with: name: mds path: utils/python/MITgcmutils/tests/data/global_ocean.90x40x15 - - name: Show artifacts - shell: bash - run: ls utils/python/MITgcmutils/tests/data - name: Download mnc output uses: actions/download-artifact@v2 with: name: mnc path: utils/python/MITgcmutils/tests/data - - name: Show artifacts - shell: bash - run: ls utils/python/MITgcmutils/tests/data - name: Create download directories run: mkdir -p baseline_images data/llc90 data/aste data/eccov3 working-directory: utils/python/MITgcmutils/tests @@ -155,9 +149,6 @@ jobs: - name: Run Tox run: tox -e ${{ matrix.env }} working-directory: utils/python/MITgcmutils - - name: Show test output - run: ls /tmp/pytest-of-runner/pytest-0/test_rdmds_large0 - if: ${{ always() }} openad: runs-on: ubuntu-latest From 2c23e76418e778cb3a67316df0eae81f0390551f Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 09:55:19 -0500 Subject: [PATCH 20/33] Remove hash-bang --- utils/python/MITgcmutils/tests/test_llc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/python/MITgcmutils/tests/test_llc.py b/utils/python/MITgcmutils/tests/test_llc.py index 2c86332d94..52866df059 100644 --- a/utils/python/MITgcmutils/tests/test_llc.py +++ b/utils/python/MITgcmutils/tests/test_llc.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python from __future__ import print_function import sys from os.path import join as pjoin, dirname From 0fdea46ee09aef4d30c71baed6f8834048ff207e Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 10:49:36 -0500 Subject: [PATCH 21/33] Add test for gluemncbig --- .../tests/md5/eccov3/dar_tave.0000025920.md5 | 1 + .../tests/md5/eccov3/dic_tave.0000025920.md5 | 1 + .../tests/md5/eccov3/ptr_tave.0000025920.md5 | 1 + .../run/mnc_test_0001/grid.md5 | 1 + .../run/mnc_test_0001/oceDiag.0000072000.md5 | 1 + .../run/mnc_test_0001/phiHyd.0000072000.md5 | 1 + .../mnc_test_0001/phiHydLow.0000072000.md5 | 1 + .../run/mnc_test_0001/state.0000072000.md5 | 1 + .../MITgcmutils/tests/md5/llc90/mnc/grid.md5 | 1 + .../llc90/mnc/state_2d_set1.0000000000.md5 | 1 + .../tests/md5/unicode/dic_tave.0000025920.md5 | 1 + utils/python/MITgcmutils/tests/run-scripts | 33 +++++++++++++++++++ 12 files changed, 44 insertions(+) create mode 100644 utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 create mode 100755 utils/python/MITgcmutils/tests/run-scripts diff --git a/utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 new file mode 100644 index 0000000000..45a66d2977 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 @@ -0,0 +1 @@ +9f5f5ed02e14c08796957ae7531b9e4a dar_tave.0000025920.nc diff --git a/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 new file mode 100644 index 0000000000..7f916cc2a2 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 @@ -0,0 +1 @@ +c56100e92f4b39f3aebffd8ae3620519 dic_tave.0000025920.nc diff --git a/utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 new file mode 100644 index 0000000000..ba0ca52149 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 @@ -0,0 +1 @@ +9f4c8d54a09d828c305beac02ac0f7a3 ptr_tave.0000025920.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 new file mode 100644 index 0000000000..fa1205782e --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 @@ -0,0 +1 @@ +d27d0f0f7aa86e72b61172ebb1599279 grid.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 new file mode 100644 index 0000000000..d5cf399f3a --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 @@ -0,0 +1 @@ +84087e1b62424ac5e56256442e261212 oceDiag.0000072000.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 new file mode 100644 index 0000000000..071b286d8e --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 @@ -0,0 +1 @@ +b42ce8a41001dd6f99da51319f401abb phiHyd.0000072000.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 new file mode 100644 index 0000000000..ee9d74afb9 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 @@ -0,0 +1 @@ +b9cb0ce0c4a6e302a7c9ee35d8549829 phiHydLow.0000072000.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 new file mode 100644 index 0000000000..7a1e3aa9c0 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 @@ -0,0 +1 @@ +c1ea2a4f5f223127c4157a062f883a26 state.0000072000.nc diff --git a/utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 b/utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 new file mode 100644 index 0000000000..20394350a5 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 @@ -0,0 +1 @@ +aefe0afc6879ea87c2e2f3680082cf59 grid.nc diff --git a/utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 b/utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 new file mode 100644 index 0000000000..d1a65b105d --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 @@ -0,0 +1 @@ +ca347fe251de87a2fcc4cbfc23cee16c state_2d_set1.0000000000.nc diff --git a/utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 new file mode 100644 index 0000000000..60c96f3616 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 @@ -0,0 +1 @@ +2a8c8cc7aed7ed5b78b7452218ac3f78 dic_tave.0000025920.nc diff --git a/utils/python/MITgcmutils/tests/run-scripts b/utils/python/MITgcmutils/tests/run-scripts new file mode 100755 index 0000000000..fe5ac1e364 --- /dev/null +++ b/utils/python/MITgcmutils/tests/run-scripts @@ -0,0 +1,33 @@ +#!/bin/bash +v="$1" +if test -z "$v"; then + echo "run-scripts " + exit 1 +fi + +. .tox/$v/bin/activate + +err=0 +for f in \ + global_ocean.cs32x15/run/mnc_test_0001/grid \ + global_ocean.cs32x15/run/mnc_test_0001/state.0000072000 \ + global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000 \ + global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000 \ + global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000 \ + eccov3/dic_tave.0000025920 + do + echo "# $f" + o="$(basename $f)" + scripts/gluemncbig -o $o.nc tests/data/$f.*.nc + md5sum $o.nc > $o.md5 + diff tests/md5/$f.md5 $o.md5 || (echo "Glued file doesn't match reference: $f" && err=1) +done +#for f in grid state_2d_set1.0000000000 +#do +# echo "# tests/data/extra/llc90/mnc/mnc_*/$f" +# scripts/gluemncbig -o t.nc tests/data/extra/llc90/mnc/mnc_*/$f.*.nc +# cmp tests/data/extra/ref_output/llc90/mnc/$f.nc t.nc || exit ERROR +#done +if [ "$err" = 1 ]; then + exit 1 +fi From afe87b097ea70351b25c1d603c25931656db37bf Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 11:15:14 -0500 Subject: [PATCH 22/33] Make large file smaller --- utils/python/MITgcmutils/tests/test_mds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/python/MITgcmutils/tests/test_mds.py b/utils/python/MITgcmutils/tests/test_mds.py index c83e8bbf92..605135599a 100644 --- a/utils/python/MITgcmutils/tests/test_mds.py +++ b/utils/python/MITgcmutils/tests/test_mds.py @@ -17,8 +17,8 @@ def test_rdmds_large(tmp_path): meta = tmp_path / 'UVEL.meta' meta.symlink_to(pjoin(TEST_DATA_PATH, 'sose/UVEL.0000000060.meta')) data = tmp_path / 'UVEL.data' - np.zeros((40,42,320,2160), ">f4").tofile(str(data)) + np.zeros((20,42,320,2160), ">f4").tofile(str(data)) base = tmp_path / 'UVEL' - u = mit.rdmds(str(base), rec=38) + u = mit.rdmds(str(base), rec=19) assert u.shape == (42,320,2160) From 0bcb393bb35d6286ff48b22acf3645cc041b0d91 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 11:22:33 -0500 Subject: [PATCH 23/33] Remove large file after reading --- utils/python/MITgcmutils/tests/test_mds.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/python/MITgcmutils/tests/test_mds.py b/utils/python/MITgcmutils/tests/test_mds.py index 605135599a..0c72d6a14f 100644 --- a/utils/python/MITgcmutils/tests/test_mds.py +++ b/utils/python/MITgcmutils/tests/test_mds.py @@ -20,5 +20,6 @@ def test_rdmds_large(tmp_path): np.zeros((20,42,320,2160), ">f4").tofile(str(data)) base = tmp_path / 'UVEL' u = mit.rdmds(str(base), rec=19) + data.unlink() assert u.shape == (42,320,2160) From d16d1de653eec378e9dc5cef9604d6619c0fe4be Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 14 Jan 2021 11:22:44 -0500 Subject: [PATCH 24/33] Add list of environments for tox --- utils/python/MITgcmutils/tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/python/MITgcmutils/tox.ini b/utils/python/MITgcmutils/tox.ini index ea900a60fb..73ea722ea1 100644 --- a/utils/python/MITgcmutils/tox.ini +++ b/utils/python/MITgcmutils/tox.ini @@ -1,4 +1,5 @@ [tox] +envlist = py27,py35,py36,py37,py38,py39 [testenv] install_command = {toxinidir}/tests/pipinstall.py {opts} -- {packages} From 83cb4753aaedc5477cc4d4d3a5d717fb71e81582 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Mon, 11 Jan 2021 17:38:19 -0500 Subject: [PATCH 25/33] Update string operations to avoid warnings --- utils/python/MITgcmutils/MITgcmutils/netcdf.py | 4 ++-- utils/python/MITgcmutils/scripts/gluemncbig | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/utils/python/MITgcmutils/MITgcmutils/netcdf.py b/utils/python/MITgcmutils/MITgcmutils/netcdf.py index d02f925b6a..b296e4b8db 100644 --- a/utils/python/MITgcmutils/MITgcmutils/netcdf.py +++ b/utils/python/MITgcmutils/MITgcmutils/netcdf.py @@ -327,7 +327,7 @@ def flush(self): sync : Identical function """ - if hasattr(self, 'mode') and self.mode is 'w': + if hasattr(self, 'mode') and self.mode == 'w': self._write() sync = flush @@ -702,7 +702,7 @@ def _read_values(self): values = self.fp.read(int(count)) self.fp.read(-count % 4) # read padding - if typecode is not 'c': + if typecode != 'c': values = frombuffer(values, dtype='>%s' % typecode) if values.shape == (1,): values = values[0] diff --git a/utils/python/MITgcmutils/scripts/gluemncbig b/utils/python/MITgcmutils/scripts/gluemncbig index 2b9319f403..ea540d36ee 100755 --- a/utils/python/MITgcmutils/scripts/gluemncbig +++ b/utils/python/MITgcmutils/scripts/gluemncbig @@ -400,7 +400,7 @@ class netcdf_file(object): sync : Identical function """ - if getattr(self, 'mode', None) is 'w': + if getattr(self, 'mode', None) == 'w': if self.delay: if not self._mapped: self._map() @@ -419,7 +419,7 @@ class netcdf_file(object): def _map(self): self.fp.seek(0) self.fp.write(b'CDF') - self.fp.write(array(self.version_byte, '>b').tostring()) + self.fp.write(array(self.version_byte, '>b').tobytes()) # Write headers self._write_numrecs() @@ -583,7 +583,7 @@ class netcdf_file(object): def _write(self): self.fp.seek(0) self.fp.write(b'CDF') - self.fp.write(array(self.version_byte, '>b').tostring()) + self.fp.write(array(self.version_byte, '>b').tobytes()) # Write headers and data. self._write_numrecs() @@ -704,7 +704,7 @@ class netcdf_file(object): if (var.data.dtype.byteorder == '<' or (var.data.dtype.byteorder == '=' and LITTLE_ENDIAN)): var.data = var.data.byteswap() - self.fp.write(var.data.tostring()) + self.fp.write(var.data.tobytes()) count = var.data.size * var.data.itemsize self.fp.write(b'\x00' * (var._vsize - count)) else: # record variable @@ -718,7 +718,7 @@ class netcdf_file(object): if (rec.dtype.byteorder == '<' or (rec.dtype.byteorder == '=' and LITTLE_ENDIAN)): rec = rec.byteswap() - self.fp.write(rec.tostring()) + self.fp.write(rec.tobytes()) # Padding count = rec.size * rec.itemsize self.fp.write(b'\x00' * (var._vsize - count)) @@ -771,7 +771,7 @@ class netcdf_file(object): if not values.shape and (values.dtype.byteorder == '<' or (values.dtype.byteorder == '=' and LITTLE_ENDIAN)): values = values.byteswap() - self.fp.write(values.tostring()) + self.fp.write(values.tobytes()) count = values.size * values.itemsize self.fp.write(b'\x00' * (-count % 4)) # pad @@ -979,7 +979,7 @@ class netcdf_file(object): values = self.fp.read(int(count)) self.fp.read(-count % 4) # read padding - if type.char is not 'c': + if type.char != 'c': values = frombuffer(values, type) if values.shape == (1,): values = values[0] else: @@ -994,7 +994,7 @@ class netcdf_file(object): self._pack_int64(begin) def _pack_int(self, value): - self.fp.write(array(value, '>i').tostring()) + self.fp.write(array(value, '>i').tobytes()) _pack_int32 = _pack_int def _unpack_int(self): @@ -1002,7 +1002,7 @@ class netcdf_file(object): _unpack_int32 = _unpack_int def _pack_int64(self, value): - self.fp.write(array(value, '>q').tostring()) + self.fp.write(array(value, '>q').tobytes()) def _unpack_int64(self): return frombuffer(self.fp.read(8), '>q')[0] From d6f650e1d4dfccadcd266eeaeb420d297e6eb994 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Sat, 16 Jan 2021 09:15:45 -0500 Subject: [PATCH 26/33] Test python script --- .github/workflows/build_testing.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index f2469157d5..ef17a706be 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -149,6 +149,9 @@ jobs: - name: Run Tox run: tox -e ${{ matrix.env }} working-directory: utils/python/MITgcmutils + - name: Run scripts + run: tests/run-scripts ${{ matrix.env }} + working-directory: utils/python/MITgcmutils openad: runs-on: ubuntu-latest From 65f75486dfbd9d449ebf3ee545f86b7b291dc572 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Sat, 16 Jan 2021 09:27:22 -0500 Subject: [PATCH 27/33] Rename baseline image --- .github/workflows/build_testing.yml | 2 +- utils/python/MITgcmutils/tests/test_cs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index ef17a706be..64b2b2b69c 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -133,7 +133,7 @@ jobs: - name: Download baseline images uses: wei/curl@v1.1.1 with: - args: https://engaging-web.mit.edu/~jahn/MITgcmutils/baseline_images/{cs_pcol,cs_pcol_sphere,cs_pcol_sphere_old,llc_contour,llc_contourf,llc_pcol,llc_pcol_basemap,llc_pcol_stere,llc_pcol_xg}.png -o utils/python/MITgcmutils/tests/baseline_images/#1.png + args: https://engaging-web.mit.edu/~jahn/MITgcmutils/baseline_images/{cs_pcol,cs_pcol_sphere,cs_pcol_sphere_pre330,llc_contour,llc_contourf,llc_pcol,llc_pcol_basemap,llc_pcol_stere,llc_pcol_xg}.png -o utils/python/MITgcmutils/tests/baseline_images/#1.png - name: Download mds test data uses: wei/curl@v1.1.1 with: diff --git a/utils/python/MITgcmutils/tests/test_cs.py b/utils/python/MITgcmutils/tests/test_cs.py index 62b8e753e1..d13941130e 100644 --- a/utils/python/MITgcmutils/tests/test_cs.py +++ b/utils/python/MITgcmutils/tests/test_cs.py @@ -69,7 +69,7 @@ def test_pcol_sphere(tmpdir): h = pcol(x, y, e, projection = 'sphere', cmap = 'jet') pngname = 'cs_pcol_sphere.png' if version.parse(mpl.__version__) < version.parse('3.3.0'): - pngname = 'cs_pcol_sphere_old.png' + pngname = 'cs_pcol_sphere_pre330.png' plt.savefig(pngname) err = compare_images(pjoin(BASELINE_PATH, pngname), pngname, 13) if err: From 56f97e917fe4895793370f795e70c9512fc059bc Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Sat, 16 Jan 2021 09:50:58 -0500 Subject: [PATCH 28/33] Update md5 sums of glued files --- .../tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 | 2 +- .../run/mnc_test_0001/oceDiag.0000072000.md5 | 2 +- .../run/mnc_test_0001/phiHyd.0000072000.md5 | 2 +- .../run/mnc_test_0001/phiHydLow.0000072000.md5 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 index fa1205782e..53f51b841c 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 @@ -1 +1 @@ -d27d0f0f7aa86e72b61172ebb1599279 grid.nc +a1ff13e1c87b057c435fcb529f6e560b grid.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 index d5cf399f3a..ca804e2801 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 @@ -1 +1 @@ -84087e1b62424ac5e56256442e261212 oceDiag.0000072000.nc +8fca6187d4263088d3c4aab8b201676c oceDiag.0000072000.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 index 071b286d8e..02f01a1a98 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 @@ -1 +1 @@ -b42ce8a41001dd6f99da51319f401abb phiHyd.0000072000.nc +1b96f291f1254b746b4296c084d28547 phiHyd.0000072000.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 index ee9d74afb9..84ed3d5ce9 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 @@ -1 +1 @@ -b9cb0ce0c4a6e302a7c9ee35d8549829 phiHydLow.0000072000.nc +11d4865011bf4e4ad7efc3a44b90f598 phiHydLow.0000072000.nc From 850c9d102b31f445a34d0d67a076aaa00608494f Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Sat, 16 Jan 2021 10:36:49 -0500 Subject: [PATCH 29/33] Improve run-scripts --- utils/python/MITgcmutils/tests/run-scripts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/python/MITgcmutils/tests/run-scripts b/utils/python/MITgcmutils/tests/run-scripts index fe5ac1e364..68ee72b3a2 100755 --- a/utils/python/MITgcmutils/tests/run-scripts +++ b/utils/python/MITgcmutils/tests/run-scripts @@ -20,7 +20,10 @@ for f in \ o="$(basename $f)" scripts/gluemncbig -o $o.nc tests/data/$f.*.nc md5sum $o.nc > $o.md5 - diff tests/md5/$f.md5 $o.md5 || (echo "Glued file doesn't match reference: $f" && err=1) + if ! diff tests/md5/$f.md5 $o.md5; then + echo "Glued file doesn't match reference: $f" + err=1 + fi done #for f in grid state_2d_set1.0000000000 #do @@ -29,5 +32,6 @@ done # cmp tests/data/extra/ref_output/llc90/mnc/$f.nc t.nc || exit ERROR #done if [ "$err" = 1 ]; then + echo "Some comparisons failed." exit 1 fi From d097afc9351a7cd96081c2126f71cd3e87fd88b5 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Sat, 16 Jan 2021 10:43:17 -0500 Subject: [PATCH 30/33] Upload gluemncbig output --- .github/workflows/build_testing.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 64b2b2b69c..f6f0d642d4 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -152,6 +152,12 @@ jobs: - name: Run scripts run: tests/run-scripts ${{ matrix.env }} working-directory: utils/python/MITgcmutils + - name: Upload gluemncbig output + uses: actions/upload-artifact@v2 + with: + name: gluemncbig + path: utils/python/MITgcmutils/*.nc + if: ${{ always() }} openad: runs-on: ubuntu-latest From 896f6fefaf3815817f83b41a6c74a91752f97867 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Sun, 17 Jan 2021 09:01:26 -0500 Subject: [PATCH 31/33] Use ncdump to compare gluemncbig output --- .github/workflows/build_testing.yml | 4 + .../tests/md5/eccov3/dar_tave.0000025920.md5 | 1 - .../tests/md5/eccov3/dic_tave.0000025920.cdl | 50 +++++++ .../tests/md5/eccov3/dic_tave.0000025920.md5 | 2 +- .../tests/md5/eccov3/ptr_tave.0000025920.md5 | 1 - .../run/mnc_test_0001/grid.cdl | 129 ++++++++++++++++++ .../run/mnc_test_0001/grid.md5 | 2 +- .../run/mnc_test_0001/oceDiag.0000072000.cdl | 71 ++++++++++ .../run/mnc_test_0001/oceDiag.0000072000.md5 | 2 +- .../run/mnc_test_0001/phiHyd.0000072000.cdl | 41 ++++++ .../run/mnc_test_0001/phiHyd.0000072000.md5 | 2 +- .../mnc_test_0001/phiHydLow.0000072000.cdl | 36 +++++ .../mnc_test_0001/phiHydLow.0000072000.md5 | 2 +- .../run/mnc_test_0001/state.0000072000.cdl | 85 ++++++++++++ .../run/mnc_test_0001/state.0000072000.md5 | 2 +- .../MITgcmutils/tests/md5/llc90/mnc/grid.md5 | 1 - .../llc90/mnc/state_2d_set1.0000000000.md5 | 1 - .../tests/md5/unicode/dic_tave.0000025920.md5 | 1 - utils/python/MITgcmutils/tests/run-scripts | 9 +- 19 files changed, 429 insertions(+), 13 deletions(-) delete mode 100644 utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.cdl delete mode 100644 utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.cdl create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.cdl create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.cdl create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.cdl create mode 100644 utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.cdl delete mode 100644 utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 delete mode 100644 utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 delete mode 100644 utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index f6f0d642d4..9275d82fab 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -112,6 +112,10 @@ jobs: run: | pip install --upgrade pip pip install tox + - name: Install netcdf tools + run: | + sudo apt-get update + sudo apt-get -qq install netcdf-bin - name: Download diagstats output uses: actions/download-artifact@v2 with: diff --git a/utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 deleted file mode 100644 index 45a66d2977..0000000000 --- a/utils/python/MITgcmutils/tests/md5/eccov3/dar_tave.0000025920.md5 +++ /dev/null @@ -1 +0,0 @@ -9f5f5ed02e14c08796957ae7531b9e4a dar_tave.0000025920.nc diff --git a/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.cdl b/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.cdl new file mode 100644 index 0000000000..9a1a2856c1 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.cdl @@ -0,0 +1,50 @@ +netcdf dic_tave.0000025920 { +dimensions: + T = UNLIMITED ; // (1 currently) + X = 360 ; + Y = 160 ; +variables: + double X(X) ; + X:long_name = "longitude of cell center" ; + X:units = "degrees_east" ; + double Y(Y) ; + Y:long_name = "latitude of cell center" ; + Y:units = "degrees_north" ; + double T(T) ; + T:long_name = "model_time" ; + T:units = "s" ; + int iter(T) ; + iter:long_name = "iteration_count" ; + float dic_SUR_ave(T, Y, X) ; + dic_SUR_ave:units = "--" ; + dic_SUR_ave:description = "" ; + float dic_SURC_ave(T, Y, X) ; + dic_SURC_ave:units = "--" ; + dic_SURC_ave:description = "" ; + float dic_SURO_ave(T, Y, X) ; + dic_SURO_ave:units = "--" ; + dic_SURO_ave:description = "" ; + float dic_pH_ave(T, Y, X) ; + dic_pH_ave:units = "--" ; + dic_pH_ave:description = "" ; + float dic_pCO2_ave(T, Y, X) ; + dic_pCO2_ave:units = "--" ; + dic_pCO2_ave:description = "" ; + +// global attributes: + :MITgcm_version = "checkpoint63l" ; + :MITgcm_URL = "http://mitgcm.org" ; + :MITgcm_tag_id = "1.1645 2012/04/04" ; + :MITgcm_mnc_ver = 0.9 ; + :sNx = 45 ; + :sNy = 40 ; + :OLx = 4 ; + :OLy = 4 ; + :nSx = 1 ; + :nSy = 1 ; + :nPx = 8 ; + :nPy = 4 ; + :Nx = 360 ; + :Ny = 160 ; + :Nr = 23 ; +} diff --git a/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 index 7f916cc2a2..cfd0ebe331 100644 --- a/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 +++ b/utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.md5 @@ -1 +1 @@ -c56100e92f4b39f3aebffd8ae3620519 dic_tave.0000025920.nc +75932c55558af5a92c0644fc5ad0e02a - diff --git a/utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 deleted file mode 100644 index ba0ca52149..0000000000 --- a/utils/python/MITgcmutils/tests/md5/eccov3/ptr_tave.0000025920.md5 +++ /dev/null @@ -1 +0,0 @@ -9f4c8d54a09d828c305beac02ac0f7a3 ptr_tave.0000025920.nc diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.cdl b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.cdl new file mode 100644 index 0000000000..122406d57c --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.cdl @@ -0,0 +1,129 @@ +netcdf grid { +dimensions: + Z = 15 ; + Zp1 = 16 ; + Zu = 15 ; + Zl = 15 ; + X = 384 ; + Y = 16 ; + Xp1 = 385 ; + Yp1 = 17 ; +variables: + double Z(Z) ; + Z:long_name = "vertical coordinate of cell center" ; + Z:units = "meters" ; + Z:positive = "up" ; + double RC(Z) ; + RC:description = "R coordinate of cell center" ; + RC:units = "m" ; + double Zp1(Zp1) ; + Zp1:long_name = "vertical coordinate of cell interface" ; + Zp1:units = "meters" ; + Zp1:positive = "up" ; + double RF(Zp1) ; + RF:description = "R coordinate of cell interface" ; + RF:units = "m" ; + double Zu(Zu) ; + Zu:long_name = "vertical coordinate of lower cell interface" ; + Zu:units = "meters" ; + Zu:positive = "up" ; + double RU(Zu) ; + RU:description = "R coordinate of upper interface" ; + RU:units = "m" ; + double Zl(Zl) ; + Zl:long_name = "vertical coordinate of upper cell interface" ; + Zl:units = "meters" ; + Zl:positive = "up" ; + double RL(Zl) ; + RL:description = "R coordinate of lower interface" ; + RL:units = "m" ; + double drC(Zp1) ; + drC:description = "r cell center separation" ; + double drF(Z) ; + drF:description = "r cell face separation" ; + double X(X) ; + X:long_name = "i-index of cell center" ; + X:units = "none" ; + double Y(Y) ; + Y:long_name = "j-index of cell center" ; + Y:units = "none" ; + double XC(Y, X) ; + XC:description = "X coordinate of cell center (T-P point)" ; + XC:units = "degree_east" ; + double YC(Y, X) ; + YC:description = "Y coordinate of cell center (T-P point)" ; + YC:units = "degree_north" ; + double Xp1(Xp1) ; + Xp1:long_name = "i-index of cell corner" ; + Xp1:units = "none" ; + double Yp1(Yp1) ; + Yp1:long_name = "j-index of cell corner" ; + Yp1:units = "none" ; + double XG(Yp1, Xp1) ; + XG:description = "X coordinate of cell corner (Vorticity point)" ; + XG:units = "degree_east" ; + double YG(Yp1, Xp1) ; + YG:description = "Y coordinate of cell corner (Vorticity point)" ; + YG:units = "degree_north" ; + double dxC(Y, Xp1) ; + dxC:description = "x cell center separation" ; + double dyC(Yp1, X) ; + dyC:description = "y cell center separation" ; + double dxF(Y, X) ; + dxF:description = "x cell face separation" ; + double dyF(Y, X) ; + dyF:description = "y cell face separation" ; + double dxG(Yp1, X) ; + dxG:description = "x cell corner separation" ; + double dyG(Y, Xp1) ; + dyG:description = "y cell corner separation" ; + double dxV(Yp1, Xp1) ; + dxV:description = "x v-velocity separation" ; + double dyU(Yp1, Xp1) ; + dyU:description = "y u-velocity separation" ; + double rA(Y, X) ; + rA:description = "r-face area at cell center" ; + double rAw(Y, Xp1) ; + rAw:description = "r-face area at U point" ; + double rAs(Yp1, X) ; + rAs:description = "r-face area at V point" ; + double rAz(Yp1, Xp1) ; + rAz:description = "r-face area at cell corner" ; + double AngleCS(Y, X) ; + AngleCS:description = "Cos of grid orientation angle at cell center" ; + double AngleSN(Y, X) ; + AngleSN:description = "Sin of grid orientation angle at cell center" ; + double fCori(Y, X) ; + fCori:description = "Coriolis f at cell center" ; + double fCoriG(Yp1, Xp1) ; + fCoriG:description = "Coriolis f at cell corner" ; + double R_low(Y, X) ; + R_low:description = "base of fluid in r-units" ; + double Ro_surf(Y, X) ; + Ro_surf:description = "surface reference (at rest) position" ; + double Depth(Y, X) ; + Depth:description = "fluid thickness in r coordinates (at rest)" ; + double HFacC(Z, Y, X) ; + HFacC:description = "vertical fraction of open cell at cell center" ; + double HFacW(Z, Y, Xp1) ; + HFacW:description = "vertical fraction of open cell at West face" ; + double HFacS(Z, Yp1, X) ; + HFacS:description = "vertical fraction of open cell at South face" ; + +// global attributes: + :MITgcm_version = "checkpoint67u" ; + :MITgcm_URL = "http://mitgcm.org" ; + :MITgcm_tag_id = "" ; + :MITgcm_mnc_ver = 0.9 ; + :sNx = 32 ; + :sNy = 16 ; + :OLx = 4 ; + :OLy = 4 ; + :nSx = 12 ; + :nSy = 1 ; + :nPx = 1 ; + :nPy = 1 ; + :Nx = 384 ; + :Ny = 16 ; + :Nr = 15 ; +} diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 index 53f51b841c..77c2192be3 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/grid.md5 @@ -1 +1 @@ -a1ff13e1c87b057c435fcb529f6e560b grid.nc +511a0016be635ca9b9c4b7bdb872a607 - diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.cdl b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.cdl new file mode 100644 index 0000000000..40cad32d0c --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.cdl @@ -0,0 +1,71 @@ +netcdf oceDiag.0000072000 { +dimensions: + T = UNLIMITED ; // (2 currently) + Zmd000015 = 15 ; + X = 384 ; + Y = 16 ; + Zld000015 = 15 ; + Xp1 = 385 ; + Yp1 = 17 ; +variables: + double diag_levels(Zmd000015) ; + diag_levels:description = "Idicies of vertical levels within the source arrays" ; + double X(X) ; + X:long_name = "i-index of cell center" ; + X:units = "none" ; + double Y(Y) ; + Y:long_name = "j-index of cell center" ; + Y:units = "none" ; + double Xp1(Xp1) ; + Xp1:long_name = "i-index of cell corner" ; + Xp1:units = "none" ; + double Yp1(Yp1) ; + Yp1:long_name = "j-index of cell corner" ; + Yp1:units = "none" ; + double T(T) ; + T:long_name = "model_time" ; + T:units = "s" ; + int iter(T) ; + iter:long_name = "iteration_count" ; + float DRHODR(T, Zld000015, Y, X) ; + DRHODR:description = "Stratification: d.Sigma/dr (kg/m3/r_unit)" ; + DRHODR:units = "kg/m^4" ; + float RHOAnoma(T, Zmd000015, Y, X) ; + RHOAnoma:description = "Density Anomaly (=Rho-rhoConst)" ; + RHOAnoma:units = "kg/m^3" ; + float CONVADJ(T, Zld000015, Y, X) ; + CONVADJ:description = "Convective Adjustment Index [0-1]" ; + CONVADJ:units = "fraction" ; + float GM_Kwx(T, Zld000015, Y, X) ; + GM_Kwx:description = "K_31 element (W.point, X.dir) of GM-Redi tensor" ; + GM_Kwx:units = "m^2/s" ; + float GM_Kwy(T, Zld000015, Y, X) ; + GM_Kwy:description = "K_32 element (W.point, Y.dir) of GM-Redi tensor" ; + GM_Kwy:units = "m^2/s" ; + float GM_Kwz(T, Zld000015, Y, X) ; + GM_Kwz:description = "K_33 element (W.point, Z.dir) of GM-Redi tensor" ; + GM_Kwz:units = "m^2/s" ; + float GM_PsiX(T, Zld000015, Y, Xp1) ; + GM_PsiX:description = "GM Bolus transport stream-function : U component" ; + GM_PsiX:units = "m^2/s" ; + float GM_PsiY(T, Zld000015, Yp1, X) ; + GM_PsiY:description = "GM Bolus transport stream-function : V component" ; + GM_PsiY:units = "m^2/s" ; + +// global attributes: + :MITgcm_version = "checkpoint67u" ; + :MITgcm_URL = "http://mitgcm.org" ; + :MITgcm_tag_id = "" ; + :MITgcm_mnc_ver = 0.9 ; + :sNx = 32 ; + :sNy = 16 ; + :OLx = 4 ; + :OLy = 4 ; + :nSx = 12 ; + :nSy = 1 ; + :nPx = 1 ; + :nPy = 1 ; + :Nx = 384 ; + :Ny = 16 ; + :Nr = 15 ; +} diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 index ca804e2801..77fc718a1d 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/oceDiag.0000072000.md5 @@ -1 +1 @@ -8fca6187d4263088d3c4aab8b201676c oceDiag.0000072000.nc +b8e7e40ab7edadeb8f30ad08d9390887 - diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.cdl b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.cdl new file mode 100644 index 0000000000..1fb0d1599b --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.cdl @@ -0,0 +1,41 @@ +netcdf phiHyd.0000072000 { +dimensions: + T = UNLIMITED ; // (1 currently) + X = 384 ; + Y = 16 ; + Z = 15 ; +variables: + double X(X) ; + X:long_name = "i-index of cell center" ; + X:units = "none" ; + double Y(Y) ; + Y:long_name = "j-index of cell center" ; + Y:units = "none" ; + double Z(Z) ; + Z:long_name = "vertical coordinate of cell center" ; + Z:units = "meters" ; + Z:positive = "up" ; + double T(T) ; + T:long_name = "model_time" ; + T:units = "s" ; + int iter(T) ; + iter:long_name = "iteration_count" ; + float phiHyd(T, Z, Y, X) ; + +// global attributes: + :MITgcm_version = "checkpoint67u" ; + :MITgcm_URL = "http://mitgcm.org" ; + :MITgcm_tag_id = "" ; + :MITgcm_mnc_ver = 0.9 ; + :sNx = 32 ; + :sNy = 16 ; + :OLx = 4 ; + :OLy = 4 ; + :nSx = 12 ; + :nSy = 1 ; + :nPx = 1 ; + :nPy = 1 ; + :Nx = 384 ; + :Ny = 16 ; + :Nr = 15 ; +} diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 index 02f01a1a98..4bf5cd42b5 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHyd.0000072000.md5 @@ -1 +1 @@ -1b96f291f1254b746b4296c084d28547 phiHyd.0000072000.nc +cd9f82177b6773f31e90f5636b580279 - diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.cdl b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.cdl new file mode 100644 index 0000000000..78e7f0c088 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.cdl @@ -0,0 +1,36 @@ +netcdf phiHydLow.0000072000 { +dimensions: + T = UNLIMITED ; // (1 currently) + X = 384 ; + Y = 16 ; +variables: + double X(X) ; + X:long_name = "i-index of cell center" ; + X:units = "none" ; + double Y(Y) ; + Y:long_name = "j-index of cell center" ; + Y:units = "none" ; + double T(T) ; + T:long_name = "model_time" ; + T:units = "s" ; + int iter(T) ; + iter:long_name = "iteration_count" ; + float phiHydLow(T, Y, X) ; + +// global attributes: + :MITgcm_version = "checkpoint67u" ; + :MITgcm_URL = "http://mitgcm.org" ; + :MITgcm_tag_id = "" ; + :MITgcm_mnc_ver = 0.9 ; + :sNx = 32 ; + :sNy = 16 ; + :OLx = 4 ; + :OLy = 4 ; + :nSx = 12 ; + :nSy = 1 ; + :nPx = 1 ; + :nPy = 1 ; + :Nx = 384 ; + :Ny = 16 ; + :Nr = 15 ; +} diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 index 84ed3d5ce9..9e6acf6f26 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/phiHydLow.0000072000.md5 @@ -1 +1 @@ -11d4865011bf4e4ad7efc3a44b90f598 phiHydLow.0000072000.nc +43445304fcad2b3c52dc05ba6c60f0c6 - diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.cdl b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.cdl new file mode 100644 index 0000000000..666ce80b42 --- /dev/null +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.cdl @@ -0,0 +1,85 @@ +netcdf state.0000072000 { +dimensions: + X = 384 ; + Y = 16 ; + Xp1 = 385 ; + Yp1 = 17 ; + T = UNLIMITED ; // (2 currently) + Z = 15 ; + Zl = 15 ; +variables: + double X(X) ; + X:long_name = "i-index of cell center" ; + X:units = "none" ; + double Y(Y) ; + Y:long_name = "j-index of cell center" ; + Y:units = "none" ; + float XC(Y, X) ; + XC:description = "X coordinate of cell center (T-P point)" ; + XC:units = "degree_east" ; + float YC(Y, X) ; + YC:description = "Y coordinate of cell center (T-P point)" ; + YC:units = "degree_north" ; + double Xp1(Xp1) ; + Xp1:long_name = "i-index of cell corner" ; + Xp1:units = "none" ; + double Yp1(Yp1) ; + Yp1:long_name = "j-index of cell corner" ; + Yp1:units = "none" ; + float XG(Yp1, Xp1) ; + XG:description = "X coordinate of cell corner (Vorticity point)" ; + XG:units = "degree_east" ; + float YG(Yp1, Xp1) ; + YG:description = "Y coordinate of cell corner (Vorticity point)" ; + YG:units = "degree_north" ; + double Z(Z) ; + Z:long_name = "vertical coordinate of cell center" ; + Z:units = "meters" ; + Z:positive = "up" ; + double Zl(Zl) ; + Zl:long_name = "vertical coordinate of upper cell interface" ; + Zl:units = "meters" ; + Zl:positive = "up" ; + double T(T) ; + T:long_name = "model_time" ; + T:units = "s" ; + int iter(T) ; + iter:long_name = "iteration_count" ; + float U(T, Z, Y, Xp1) ; + U:units = "m/s" ; + U:coordinates = "XU YU RC iter" ; + float V(T, Z, Yp1, X) ; + V:units = "m/s" ; + V:coordinates = "XV YV RC iter" ; + float Temp(T, Z, Y, X) ; + Temp:units = "degC" ; + Temp:long_name = "potential_temperature" ; + Temp:coordinates = "XC YC RC iter" ; + float S(T, Z, Y, X) ; + S:long_name = "salinity" ; + S:coordinates = "XC YC RC iter" ; + float Eta(T, Y, X) ; + Eta:long_name = "free-surface_r-anomaly" ; + Eta:units = "m" ; + Eta:coordinates = "XC YC iter" ; + float W(T, Zl, Y, X) ; + W:units = "m/s" ; + W:coordinates = "XC YC RC iter" ; + +// global attributes: + :MITgcm_version = "checkpoint67u" ; + :MITgcm_URL = "http://mitgcm.org" ; + :MITgcm_tag_id = "" ; + :MITgcm_mnc_ver = 0.9 ; + :sNx = 32 ; + :sNy = 16 ; + :OLx = 4 ; + :OLy = 4 ; + :nSx = 12 ; + :nSy = 1 ; + :nPx = 1 ; + :nPy = 1 ; + :Nx = 384 ; + :Ny = 16 ; + :Nr = 15 ; +} diff --git a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 index 7a1e3aa9c0..76be8d2ae7 100644 --- a/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 +++ b/utils/python/MITgcmutils/tests/md5/global_ocean.cs32x15/run/mnc_test_0001/state.0000072000.md5 @@ -1 +1 @@ -c1ea2a4f5f223127c4157a062f883a26 state.0000072000.nc +f8954dee5a92c521aa6ddfbd80fa5c94 - diff --git a/utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 b/utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 deleted file mode 100644 index 20394350a5..0000000000 --- a/utils/python/MITgcmutils/tests/md5/llc90/mnc/grid.md5 +++ /dev/null @@ -1 +0,0 @@ -aefe0afc6879ea87c2e2f3680082cf59 grid.nc diff --git a/utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 b/utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 deleted file mode 100644 index d1a65b105d..0000000000 --- a/utils/python/MITgcmutils/tests/md5/llc90/mnc/state_2d_set1.0000000000.md5 +++ /dev/null @@ -1 +0,0 @@ -ca347fe251de87a2fcc4cbfc23cee16c state_2d_set1.0000000000.nc diff --git a/utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 b/utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 deleted file mode 100644 index 60c96f3616..0000000000 --- a/utils/python/MITgcmutils/tests/md5/unicode/dic_tave.0000025920.md5 +++ /dev/null @@ -1 +0,0 @@ -2a8c8cc7aed7ed5b78b7452218ac3f78 dic_tave.0000025920.nc diff --git a/utils/python/MITgcmutils/tests/run-scripts b/utils/python/MITgcmutils/tests/run-scripts index 68ee72b3a2..b5d91f99b8 100755 --- a/utils/python/MITgcmutils/tests/run-scripts +++ b/utils/python/MITgcmutils/tests/run-scripts @@ -19,9 +19,14 @@ for f in \ echo "# $f" o="$(basename $f)" scripts/gluemncbig -o $o.nc tests/data/$f.*.nc - md5sum $o.nc > $o.md5 + ncdump -h $o.nc | grep -v build_ > $o.cdl + ncdump $o.nc | grep -v build_ | md5sum > $o.md5 + if ! diff tests/md5/$f.cdl $o.cdl; then + echo "Metadata doesn't match reference: $f" + err=1 + fi if ! diff tests/md5/$f.md5 $o.md5; then - echo "Glued file doesn't match reference: $f" + echo "Checksum doesn't match reference: $f" err=1 fi done From 3b07b78d65507f7c686e80bed80ac3bf0d05feae Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Sun, 17 Jan 2021 09:48:20 -0500 Subject: [PATCH 32/33] Do not install compilers in VM --- .github/workflows/build_testing.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/build_testing.yml b/.github/workflows/build_testing.yml index 9275d82fab..efcb3f9b23 100644 --- a/.github/workflows/build_testing.yml +++ b/.github/workflows/build_testing.yml @@ -43,11 +43,6 @@ jobs: - name: Checkout uses: actions/checkout@v2.2.0 - - name: Set up compilers - run: | - sudo apt-get update - sudo apt-get -qq install gfortran - - name: Get a docker image and set it running run: | docker pull oliverjahn/testreport-images:ubuntu_18_04_villon @@ -179,11 +174,6 @@ jobs: - name: Checkout uses: actions/checkout@v2.2.0 - - name: Set up compilers - run: | - sudo apt-get update - sudo apt-get -qq install gfortran - - name: Get a docker image and set it running run: | docker pull mitgcm/mitgcm-openad-test:centos-test From c655a5b73fc367a7991e0e7bd3609ee01c269a27 Mon Sep 17 00:00:00 2001 From: Oliver Jahn Date: Thu, 11 Apr 2024 10:57:49 -0400 Subject: [PATCH 33/33] Add pipinstall.sh to allowlist_externals --- utils/python/MITgcmutils/tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/python/MITgcmutils/tox.ini b/utils/python/MITgcmutils/tox.ini index 73ea722ea1..1b644e53cf 100644 --- a/utils/python/MITgcmutils/tox.ini +++ b/utils/python/MITgcmutils/tox.ini @@ -3,6 +3,7 @@ envlist = py27,py35,py36,py37,py38,py39 [testenv] install_command = {toxinidir}/tests/pipinstall.py {opts} -- {packages} +allow_externals = /home/runner/work/MITgcm/MITgcm/utils/python/MITgcmutils/tests/pipinstall.py usedevelop = True extras = plot