Skip to content

Commit

Permalink
Unit tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
forsyth2 committed Nov 21, 2024
1 parent 506416d commit 23d8f75
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ years = "1985:1995:5",

[global_time_series]
active = True
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121"
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v2"
experiment_name = "v3.LR.historical_0051"
figstr = "v3.LR.historical_0051"
plots_original=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ walltime = "00:30:00"
[global_time_series]
active = True
climo_years = "1985-1989", "1990-1995",
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121"
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v2"
experiment_name = "v3.LR.historical_0051"
figstr = "v3.LR.historical_0051"
moc_file=mocTimeSeries_1985-1995.nc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ walltime = "00:30:00"

[global_time_series]
active = True
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121"
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v2"
experiment_name = "v3.LR.historical_0051"
figstr = "v3.LR.historical_0051"
plots_original="net_toa_flux_restom,global_surface_air_temperature,toa_radiation,net_atm_energy_imbalance,net_atm_water_imbalance"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ years = "1985:1989:2",
[global_time_series]
active = True
bundle = "bundle2"
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121"
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v2"
experiment_name = "v3.LR.historical_0051"
figstr = "v3.LR.historical_0051"
plots_original="net_toa_flux_restom,global_surface_air_temperature,toa_radiation,net_atm_energy_imbalance,net_atm_water_imbalance"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ walltime = "00:30:00"
[global_time_series]
active = True
climo_years ="1980-1984", "1985-1990",
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121"
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v2"
experiment_name = "v2.LR.historical_0201"
figstr = "v2.LR.historical_0201"
moc_file=mocTimeSeries_1980-1990.nc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ walltime = "00:30:00"
[global_time_series]
active = True
climo_years = "1985-1989", "1990-1995",
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121"
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v2"
experiment_name = "v3.LR.historical_0051"
figstr = "v3.LR.historical_0051"
moc_file=mocTimeSeries_1985-1995.nc
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_chyrsalis_expansions(config):
"e3sm_to_cmip_environment_commands": "",
"environment_commands_test": "",
"expected_dir": "/lcrc/group/e3sm/public_html/zppy_test_resources/",
"global_time_series_environment_commands": "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121",
"global_time_series_environment_commands": "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v2",
"mpas_analysis_walltime": "00:30:00",
"partition_long": "compute",
"partition_short": "debug",
Expand Down
18 changes: 10 additions & 8 deletions tests/test_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ def compare(tester, actual, expected):

def get_config(test_case, config_file):
# Subdirectory where templates are located
templateDir = os.path.join("zppy", "templates")
defaults_dir = os.path.join("zppy", "defaults")

# Read configuration file and validate it
config = ConfigObj(config_file, configspec=os.path.join(templateDir, "default.ini"))
config = ConfigObj(
config_file, configspec=os.path.join(defaults_dir, "default.ini")
)
validator = Validator()

test_case.assertTrue(config.validate(validator))

# Add templateDir to config
config["default"]["templateDir"] = templateDir
config["default"]["templateDir"] = os.path.join("zppy", "templates")

# For debugging
DISPLAY_CONFIG = False
Expand Down Expand Up @@ -104,7 +106,7 @@ def test_sections(self):
expected_section = {
"active": "True",
"area_nm": "area",
"cmip_metadata": "e3sm_to_cmip/default_metadata.json",
"cmip_metadata": "inclusions/e3sm_to_cmip/default_metadata.json",
"dpf": 30,
"extra_vars": "",
"input_component": "",
Expand All @@ -125,7 +127,7 @@ def test_sections(self):
"area_nm": "area",
"campaign": "none",
"case": "CASE",
"cmip_metadata": "e3sm_to_cmip/default_metadata.json",
"cmip_metadata": "inclusions/e3sm_to_cmip/default_metadata.json",
"constraint": "",
"debug": False,
"dpf": 30,
Expand Down Expand Up @@ -279,7 +281,7 @@ def test_subsections(self):
expected_section = {
"active": "True",
"area_nm": "area",
"cmip_metadata": "e3sm_to_cmip/default_metadata.json",
"cmip_metadata": "inclusions/e3sm_to_cmip/default_metadata.json",
"dpf": 30,
"extra_vars": "",
"input_component": "",
Expand Down Expand Up @@ -320,7 +322,7 @@ def test_subsections(self):
"bundle": "",
"campaign": "none",
"case": "CASE",
"cmip_metadata": "e3sm_to_cmip/default_metadata.json",
"cmip_metadata": "inclusions/e3sm_to_cmip/default_metadata.json",
"constraint": "",
"debug": False,
"dpf": 30,
Expand Down Expand Up @@ -364,7 +366,7 @@ def test_subsections(self):
"bundle": "",
"campaign": "none",
"case": "CASE",
"cmip_metadata": "e3sm_to_cmip/default_metadata.json",
"cmip_metadata": "inclusions/e3sm_to_cmip/default_metadata.json",
"constraint": "",
"debug": False,
"dpf": 30,
Expand Down

0 comments on commit 23d8f75

Please sign in to comment.