Skip to content

Commit 65233e0

Browse files
Further simplify workflow (#2)
1 parent 328434c commit 65233e0

File tree

4 files changed

+9
-47
lines changed

4 files changed

+9
-47
lines changed

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@ download_input_data:
55
./download_input_data.sh
66

77
test:
8-
docker/docker_run.sh \
8+
docker run \
99
-v $(shell pwd)/input_data:/input_data \
1010
-v $(shell pwd)/tests:/tests \
1111
shield:main pytest -vv /tests/test_regression.py
1212

1313
test_regtest_reset:
14-
docker/docker_run.sh \
14+
docker run \
1515
-v $(shell pwd)/input_data:/input_data \
1616
-v $(shell pwd)/tests:/tests \
1717
shield:main pytest -vv /tests/test_regression.py --regtest-reset
1818

1919
enter:
20-
docker/docker_run.sh \
20+
docker run \
21+
-v $(shell pwd)/input_data:/input_data \
2122
-v $(shell pwd)/tests:/tests \
2223
-it shield:main bash
2324

docker/docker_run.sh

-21
This file was deleted.

tests/default.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ diag_table:
133133
time_axis_name: time
134134
time_axis_units: minutes
135135
experiment_name: default
136-
field_table: gs://vcm-fv3config/config/field_table/TKE-EDMF/v1.1/field_table
137-
forcing: gs://vcm-ml-experiments/spencerc/2023-09-13-SHiELD-forcing-data
138-
initial_conditions: gs://vcm-fv3config/data/initial_conditions/gfs_c12_example/v1.0
136+
field_table: /input_data/field_table
137+
forcing: /input_data/forcing
138+
initial_conditions: /input_data/initial_conditions
139139
namelist:
140140
fms_affinity_nml:
141141
affinity: false
@@ -468,4 +468,4 @@ namelist:
468468
stress_ratio: 1.0
469469
use_old_mlm: true
470470
use_rain_flux: true
471-
orographic_forcing: gs://vcm-fv3config/data/orographic_data/v1.0
471+
orographic_forcing: /input_data/orographic_forcing

tests/test_regression.py

+1-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import copy
21
import hashlib
32
import os
43
import shutil
@@ -12,30 +11,13 @@
1211

1312

1413
CONFIG_DIR = Path(__file__).parent
15-
INPUT_DATA_DIR = CONFIG_DIR.parent / "input_data"
1614
EXECUTABLE = Path("/SHiELD/SHiELD_build/Build/bin/SHiELD_nh.prod.64bit.gnu.x")
1715

1816

1917
def get_config(filename):
2018
config_filename = CONFIG_DIR / filename
2119
with open(config_filename, "r") as f:
22-
return prepare_config(fv3config.load(f))
23-
24-
25-
def prepare_config(config: dict) -> dict:
26-
"""Convert GCS paths to local paths"""
27-
result = copy.deepcopy(config)
28-
29-
forcing = INPUT_DATA_DIR / "forcing"
30-
orographic_forcing = INPUT_DATA_DIR / "orographic_forcing"
31-
initial_conditions = INPUT_DATA_DIR / "initial_conditions"
32-
field_table = INPUT_DATA_DIR / "field_table"
33-
34-
result["forcing"] = forcing.as_uri()
35-
result["orographic_forcing"] = orographic_forcing.as_uri()
36-
result["initial_conditions"] = initial_conditions.as_uri()
37-
result["field_table"] = field_table.as_uri()
38-
return result
20+
return fv3config.load(f)
3921

4022

4123
def checksum_file(path: Path) -> str:

0 commit comments

Comments
 (0)