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

Update DevOps configs #755

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Fix pre-commit issues
  • Loading branch information
tomvothecoder committed Nov 29, 2023
commit d7b22c12f4619705a7c44675f3f235a4548ffd67
2 changes: 1 addition & 1 deletion e3sm_diags/plot/cartopy/aerosol_aeronet_plot.py
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ def plot(test, test_site, ref_site, parameter):
subpage = np.array(p).reshape(2, 2)
subpage[1, :] = subpage[0, :] + subpage[1, :]
subpage = subpage + np.array(border).reshape(2, 2)
subpage = list(((subpage) * page).flatten())
subpage = list(((subpage) * page).flatten()) # type: ignore
extent = matplotlib.transforms.Bbox.from_extents(*subpage)
# Save subplot
fname = fnm + ".%i." % (i) + f
2 changes: 1 addition & 1 deletion e3sm_diags/plot/cartopy/area_mean_time_series_plot.py
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ def plot(var, regions_to_data, parameter):
subpage = np.array(p).reshape(2, 2)
subpage[1, :] = subpage[0, :] + subpage[1, :]
subpage = subpage + np.array(border).reshape(2, 2)
subpage = list(((subpage) * page).flatten())
subpage = list(((subpage) * page).flatten()) # type: ignore
extent = matplotlib.transforms.Bbox.from_extents(*subpage)
# Save subplot
fname = fnm + ".%i." % (i) + f
2 changes: 1 addition & 1 deletion e3sm_diags/plot/cartopy/qbo_plot.py
Original file line number Diff line number Diff line change
@@ -231,7 +231,7 @@ def plot(parameter, test, ref):
subpage = np.array(p).reshape(2, 2)
subpage[1, :] = subpage[0, :] + subpage[1, :]
subpage = subpage + np.array(border).reshape(2, 2)
subpage = list(((subpage) * page).flatten())
subpage = list(((subpage) * page).flatten()) # type: ignore
extent = matplotlib.transforms.Bbox.from_extents(*subpage)
# Save subplot
subplot_suffix = (".%i." % i) + f
31 changes: 14 additions & 17 deletions tests/complete_run.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
"""The complete E3SM Diagnostic run.

Due to the large amount of data required to run, this test will be run manually
on Anvil (rather than as part of the CI tests).

Run the following first:
- srun --pty --nodes=1 --time=01:00:00 /bin/bash
- source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh
- Or: source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_anvil.sh
"""
import os
import unittest

# This test should be run with the latest E3SM Diags tutorial code.
from examples.run_v2_6_0_all_sets_E3SM_machines import run_lcrc
from tests.integration.test_diags import compare_images

# Due to the large amount of data required to run, this test will be run manually on Anvil
# (rather than as part of the CI tests).
from tests.integration.test_diags import _compare_images


class TestCompleteRun(unittest.TestCase):
class TestCompleteRun:
def test_complete_run(self):
actual_images_dir = run_lcrc(".")

@@ -25,20 +31,11 @@ def test_complete_run(self):
path_to_actual_png = os.path.join(actual_images_dir, image_name)
path_to_expected_png = os.path.join(expected_images_dir, image_name)

compare_images(
self,
mismatched_images = _compare_images(
mismatched_images,
image_name,
path_to_actual_png,
path_to_expected_png,
)

self.assertEqual(mismatched_images, [])


if __name__ == "__main__":
# Run the following first:
# srun --pty --nodes=1 --time=01:00:00 /bin/bash
# source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh
# Or: source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_anvil.sh
unittest.main()
assert len(mismatched_images) == 0