Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test python #7

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5899f18
Upload diagstats output from build test
jahn Jan 11, 2021
1912313
Ignore warnings and download in separate job
jahn Jan 11, 2021
ae8179b
Add tox testing of MITgcmutils
jahn Jan 11, 2021
2cca5c0
Add test for readstats
jahn Jan 11, 2021
a95ae6d
Merge branch 'fix-MITgcmutils' into test-python
jahn Jan 11, 2021
a91dd93
Add python versions
jahn Jan 11, 2021
f6a3351
Add test with binary data ad baseline image
jahn Jan 11, 2021
b1129ba
Use docker image from oliverjahn account
jahn Jan 11, 2021
9f3a1f2
Add mds test
jahn Jan 12, 2021
b4f61ae
Add more tests
jahn Jan 13, 2021
ebb7f01
Download data and add more tests
jahn Jan 13, 2021
05ed76b
Add large-file test in tmp_path
jahn Jan 13, 2021
2cf881a
Fix order
jahn Jan 13, 2021
252e9f5
Complete all python tests
jahn Jan 13, 2021
ca4d4fd
Add test for mdjwf
jahn Jan 13, 2021
2597ffe
Update value
jahn Jan 14, 2021
2398002
Add meta file
jahn Jan 14, 2021
6c53d0e
Avoid use of Path in tofile
jahn Jan 14, 2021
206ee95
List mds test tmp dir
jahn Jan 14, 2021
b222dde
Remove debugging steps
jahn Jan 14, 2021
2c23e76
Remove hash-bang
jahn Jan 14, 2021
0fdea46
Add test for gluemncbig
jahn Jan 14, 2021
afe87b0
Make large file smaller
jahn Jan 14, 2021
0bcb393
Remove large file after reading
jahn Jan 14, 2021
d16d1de
Add list of environments for tox
jahn Jan 14, 2021
83cb475
Update string operations to avoid warnings
jahn Jan 11, 2021
d6f650e
Test python script
jahn Jan 16, 2021
65f7548
Rename baseline image
jahn Jan 16, 2021
56f97e9
Update md5 sums of glued files
jahn Jan 16, 2021
850c9d1
Improve run-scripts
jahn Jan 16, 2021
d097afc
Upload gluemncbig output
jahn Jan 16, 2021
896f6fe
Use ncdump to compare gluemncbig output
jahn Jan 17, 2021
3b07b78
Do not install compilers in VM
jahn Jan 17, 2021
fb1d53c
Merge branch 'master' into test-python
jahn Apr 11, 2024
c655a5b
Add pipinstall.sh to allowlist_externals
jahn Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 105 additions & 7 deletions .github/workflows/build_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,120 @@ jobs:
- name: Checkout
uses: actions/[email protected]

- 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/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:
MITGCM_EXP: ${{ matrix.exp }}
run: |
. tools/ci/runtr.sh

- name: Upload diagstats
uses: actions/upload-artifact@v2
with:
name: diagstats
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:
name: mnc
path: verification/*/*run*/mnc_test_*/*.nc
if-no-files-found: ignore

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
continue-on-error: true
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Tox and other packages
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:
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: Download mnc output
uses: actions/download-artifact@v2
with:
name: mnc
path: 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
- name: Download baseline images
uses: wei/[email protected]
with:
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/[email protected]
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/[email protected]
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/[email protected]
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
- 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

Expand Down
9 changes: 9 additions & 0 deletions utils/python/MITgcmutils/tests/data/sose/UVEL.0000000060.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nDims = [ 3 ];
dimList = [
2160, 1, 2160,
320, 1, 320,
42, 1, 42
];
dataprec = [ 'float32' ];
nrecords = [ 40 ];
timeStepNumber = [ 60 ];
50 changes: 50 additions & 0 deletions utils/python/MITgcmutils/tests/md5/eccov3/dic_tave.0000025920.cdl
Original file line number Diff line number Diff line change
@@ -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 ;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
75932c55558af5a92c0644fc5ad0e02a -
Original file line number Diff line number Diff line change
@@ -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 ;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
511a0016be635ca9b9c4b7bdb872a607 -
Original file line number Diff line number Diff line change
@@ -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 ;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b8e7e40ab7edadeb8f30ad08d9390887 -
Loading
Loading