Skip to content

Commit

Permalink
Eliminate subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
jahn committed May 16, 2024
1 parent 2dbf229 commit 2ae1449
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ jobs:
- name: Download mnc test data
uses: wei/[email protected]
with:
args: https://engaging-web.mit.edu/~jahn/MITgcmutils/global_ocean.cs32x15/run/mnc_test_0001/{oceDiag,state,phiHyd,phiHydLow}.0000072000.t0{01,02,03,04,05,06,07,08,09,10,11,12}.nc -o utils/python/MITgcmutils/tests/data/global_ocean.cs32x15/run/mnc_test_0001/#1.0000072000.t0#2.nc
args: https://engaging-web.mit.edu/~jahn/MITgcmutils/global_ocean.cs32x15/{oceDiag,state,phiHyd,phiHydLow}.0000072000.t0{01,02,03,04,05,06,07,08,09,10,11,12}.nc -o utils/python/MITgcmutils/tests/data/global_ocean.cs32x15/#1.0000072000.t0#2.nc
- name: Download mnc grid data
uses: wei/[email protected]
with:
args: https://engaging-web.mit.edu/~jahn/MITgcmutils/global_ocean.cs32x15/run/mnc_test_0001/grid.t0{01,02,03,04,05,06,07,08,09,10,11,12}.nc -o utils/python/MITgcmutils/tests/data/global_ocean.cs32x15/run/mnc_test_0001/grid.t0#1.nc
args: https://engaging-web.mit.edu/~jahn/MITgcmutils/global_ocean.cs32x15/grid.t0{01,02,03,04,05,06,07,08,09,10,11,12}.nc -o utils/python/MITgcmutils/tests/data/global_ocean.cs32x15/grid.t0#1.nc
- name: Run Tox
run: tox -e ${{ matrix.env }}
working-directory: utils/python/MITgcmutils
Expand Down
10 changes: 5 additions & 5 deletions utils/python/MITgcmutils/tests/run-scripts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ fi

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 \
global_ocean.cs32x15/grid \
global_ocean.cs32x15/state.0000072000 \
global_ocean.cs32x15/oceDiag.0000072000 \
global_ocean.cs32x15/phiHyd.0000072000 \
global_ocean.cs32x15/phiHydLow.0000072000 \
eccov3/dic_tave.0000025920
do
echo "# $f"
Expand Down
10 changes: 5 additions & 5 deletions utils/python/MITgcmutils/tests/test_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
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'),
'global_ocean.cs32x15/state.0000072000.t*.nc'),
['XG', 'YG', 'Eta'])
x = ds['XG']
y = ds['YG']
Expand All @@ -55,8 +55,8 @@ def test_pcol(tmpdir):

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'),
ds = mit.rdmnc(pjoin(TEST_DATA_PATH, 'global_ocean.cs32x15',
'state.0000072000.*.nc'),
['XG', 'YG', 'Eta'])
x = ds['XG']
y = ds['YG']
Expand All @@ -78,8 +78,8 @@ def test_pcol_sphere(tmpdir):
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'),
ds = mit.rdmnc(pjoin(TEST_DATA_PATH, 'global_ocean.cs32x15',
'state.0000072000.*.nc'),
['XG', 'YG', 'Eta'])
x = ds['XG']
y = ds['YG']
Expand Down
6 changes: 3 additions & 3 deletions utils/python/MITgcmutils/tests/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import MITgcmutils as mit

def test_readstats_dims():
locals, totals, itrs = mit.readstats('tests/diagstats/hs94.cs-32x32x5/tr_run.impIGW/dynStDiag.0000025920.txt')
locals, totals, itrs = mit.readstats('tests/diagstats/hs94.cs-32x32x5.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'}
Expand All @@ -17,7 +17,7 @@ def test_readstats_dims():

def test_readstats_regions_dims():
statsPerLayer, statsVertInt, itrs = mit.readstats(
'tests/diagstats/aim.5l_cs/tr_run.thSI/landStDiag.0000000000.txt')
'tests/diagstats/aim.5l_cs.thSI/landStDiag.0000000000.txt')
assert set(statsVertInt) == {'GrdTemp', 'GrdWater', 'LdSnowH', 'GrdSurfT'}
assert list(itrs) == ['LdSnowH', 'GrdSurfT', 'GrdTemp', 'GrdWater']
assert itrs['LdSnowH'] == [0, 8]
Expand All @@ -35,7 +35,7 @@ def test_readstats_regions_dims():

def test_readstats_fields_regions():
statsPerLayer, statsVertInt, itrs = mit.readstats(
'tests/diagstats/global_ocean.cs32x15/tr_run.thsice/thSIceStDiag.0000036000.txt')
'tests/diagstats/global_ocean.cs32x15.thsice/thSIceStDiag.0000036000.txt')
assert statsVertInt.dtype.names == ('SI_Fract', 'SI_Thick', 'SI_SnowH', 'SI_Tsrf', 'SI_Tice1', 'SI_Tice2', 'SI_Qice1', 'SI_Qice2', 'SIsnwPrc', 'SIalbedo', 'SIsnwAge', 'SIflx2oc', 'SIfrw2oc', 'SIsaltFx', 'SIflxAtm', 'SIfrwAtm')
assert list(itrs) == ['SI_Fract', 'SI_Thick', 'SI_SnowH', 'SI_Tsrf', 'SI_Tice1', 'SI_Tice2', 'SI_Qice1', 'SI_Qice2', 'SIsnwPrc', 'SIalbedo', 'SIsnwAge', 'SIflx2oc', 'SIfrw2oc', 'SIsaltFx', 'SIflxAtm', 'SIfrwAtm']
assert itrs['SI_Fract'] == [36010, 36020]
Expand Down
4 changes: 2 additions & 2 deletions utils/python/MITgcmutils/tests/test_mnc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def test_rdmnc_eccov3():


def test_rdmnc_cs32():
ds = mit.rdmnc(pjoin(TEST_DATA_PATH, 'global_ocean.cs32x15', 'run',
'mnc_test_0001', 'oceDiag.*.nc'))
ds = mit.rdmnc(pjoin(TEST_DATA_PATH, 'global_ocean.cs32x15',
'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()
Expand Down

0 comments on commit 2ae1449

Please sign in to comment.