E3SM-Project / polaris

Testing and analysis for OMEGA, MPAS-Ocean, MALI and MPAS-Seaice
BSD 3-Clause "New" or "Revised" License
6 stars 13 forks source link

Add sea ice components along with single column test case #71

Closed darincomeau closed 1 year ago

darincomeau commented 1 year ago

Adding sea ice as a component, along with a single column test group for MPAS-Seaice.

Checklist

darincomeau commented 1 year ago

Results from running the newly added tests (currently 10 and 11):

seaice/single_column/standard_physics
  * step: forward
  * step: viz
  test execution:      SUCCESS
  test runtime:        00:09
seaice/single_column/exact_restart
  * step: full_run
  * step: restart_run
  test execution:      SUCCESS
  test validation:     PASS
  test runtime:        00:01
Test Runtimes:
00:09 PASS seaice/single_column/standard_physics
00:01 PASS seaice/single_column/exact_restart
Total runtime 00:11
PASS: All passed successfully!

Documentation also builds locally with no new seaice related errors.

xylar commented 1 year ago

@darincomeau, please ping me when you would like me to review.

darincomeau commented 1 year ago

Sorry for the delay here @xylar . The only thing missing is the sea ice api.md part. I'd like to get that done before this falls off the back burner. But the testing itself and the docs (apart from some broken links due to missing api.md) otherwise are ready for review (but understand if you'd rather wait until all the boxes are ticked).

In the meantime, @erinethomas if you could do a fresh checkout of this branch and run these tests as a check that the behavior is the same as your working branch (i.e. everything runs and passes) as a review, that'd be great.

xylar commented 1 year ago

Great, I'd rather review this in one go so just ping me once the API is in place. Also, let me know if that gives you trouble.

xylar commented 1 year ago

@darincomeau and @erinethomas, I wanted to check in on this work. Just wanting to make sure we haven't completely lost momentum.

darincomeau commented 1 year ago

I was actually working on this last week trying to get the sea ice API part working, but it's still not generating. But yes I'd like to get this wrapped up, as we were talking about brining in another single column test case that will be useful in the Icepack merge work.

darincomeau commented 1 year ago

Ok found what was missing to get the seaice API to work properly, and the documentation now builds locally and includes the API part. Last box ticked!

Ready for review.

xylar commented 1 year ago

@darincomeau, I tried to do polaris list --suites, I see:

$ polaris list --suite
Suites:
  -c ocean -t cosine_bell
  -c ocean -t cosine_bell_cached_init
  -c ocean -t nightly
  -c ocean -t pr
Traceback (most recent call last):
  File "/gpfs/fs1/home/ac.xylar/chrysalis/mambaforge/envs/polaris_test/bin/polaris", line 33, in <module>
    sys.exit(load_entry_point('polaris', 'console_scripts', 'polaris')())
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/add-seaice-single-column/polaris/__main__.py", line 62, in main
    commands[args.command]()
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/add-seaice-single-column/polaris/list.py", line 149, in main
    list_suites(verbose=args.verbose)
  File "/gpfs/fs1/home/ac.xylar/e3sm_work/polaris/add-seaice-single-column/polaris/list.py", line 99, in list_suites
    imp_res.files(package).iterdir() if
  File "/gpfs/fs1/home/ac.xylar/chrysalis/mambaforge/envs/polaris_test/lib/python3.10/importlib/_common.py", line 22, in files
    return from_package(get_package(package))
  File "/gpfs/fs1/home/ac.xylar/chrysalis/mambaforge/envs/polaris_test/lib/python3.10/importlib/_common.py", line 66, in get_package
    resolved = resolve(package)
  File "/gpfs/fs1/home/ac.xylar/chrysalis/mambaforge/envs/polaris_test/lib/python3.10/importlib/_common.py", line 57, in resolve
    return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand)
  File "/gpfs/fs1/home/ac.xylar/chrysalis/mambaforge/envs/polaris_test/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'polaris.seaice.suites'

We need to create a directory polaris/seaice/suites with an empty file in it called __init__.py. Later on, it would be good to add an actual test suite.

xylar commented 1 year ago

@darincomeau, one other quick thing. If you can rebase onto main and fix the conflict in docs/conf.py, that would be great. I just commented out the nonexistent landice API for now, and git is confused because that happened close to where you added the seaice API.

darincomeau commented 1 year ago

Thanks for the comments @xylar ! I've rebased, and added an empty seaice suite:

$ polaris list --suite
Suites:
  -c ocean -t cosine_bell
  -c ocean -t cosine_bell_cached_init
  -c ocean -t nightly
  -c ocean -t pr
darincomeau commented 1 year ago

Also, if you'd like, I can close this and make a fresh branch to make the history cleaner before going in. Since 95% of the content here is new files that's pretty easy to do.

xylar commented 1 year ago

@darincomeau, it's a lot of commits so if you don't mind simplifying things, that would be great!

There's no need to close this PR, though. You can make a new branch and clean things up the way you would for making a new PR but then instead of actually making a new PR with the branch, just hard-reset this branch to match the new one. With this branch checked out, do:

git reset --hard <new_branch_name>

Then, just force-push this branch to your fork.

git push --force darincomeau/polaris add-seaice-single-column

That saves having multiple PRs for the same development.

darincomeau commented 1 year ago

Ok all cleaned up, I git diffed against the head of the branch before force-pushing the cleanup. I reran the single_column test suite to make sure nothing broke.