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

[WIP] Plumber2 Implementation #2406

Draft
wants to merge 144 commits into
base: b4b-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
99e01fc
preliminary plumber files
TeaganKing Feb 21, 2024
7378576
include plumber2site values in config_component.xml
TeaganKing Feb 22, 2024
9fe6a5a
general setup to run plumber
TeaganKing Mar 7, 2024
92f827e
update cime config
TeaganKing Mar 8, 2024
bddb343
reformat
TeaganKing Mar 8, 2024
af1237e
remove run_length since overwritten by usermods dirs
TeaganKing Mar 25, 2024
0d1d3dc
remove run_length from plumber_site and update args
TeaganKing Mar 25, 2024
5889ec2
update tests; include cases with experiment label in gitignore
TeaganKing Mar 26, 2024
d863c13
Add 1979 and 1979-2026 ne0np4 files to namelist defaults
slevis-lmwg Apr 25, 2024
c4debee
Replace 3 vr-grid test compsets with ISSP245Clm50BgcCrop compset
slevis-lmwg Apr 26, 2024
73ac9d7
Remove sim_year_range from new flanduse_timeseries for xml file to work
slevis-lmwg Apr 26, 2024
e95f9ea
Add to Makefile for automatic generation 1979-2026 fsurdat/landuse files
slevis-lmwg Apr 26, 2024
ee5efec
Fix the clm6_0 issues identified in #2492
ekluzek Apr 29, 2024
9769e2f
Start adding a namelist comparision tool
ekluzek Apr 29, 2024
cb32dd1
Get the physicsA and physicsB options working
ekluzek Apr 29, 2024
de8406b
Update namelist_defaults_ctsm.xml for 1979 fsurdat files
slevis-lmwg Apr 30, 2024
99d7100
Draft modifications to address new compset and new test for 1979-2026
slevis-lmwg Apr 30, 2024
75cdcd2
Improve a comment in namelist_defaults_ctsm.xml
slevis-lmwg Apr 30, 2024
c063060
Request same #tasks in Makefile as when I generated the ne0np4 files
slevis-lmwg Apr 30, 2024
4c07dcc
Add basic script to compare testlist baseline lnd_in files
ekluzek May 2, 2024
5192bd1
Fix for #2504 so tests of use-cases is done, and also done over all p…
ekluzek May 2, 2024
480ae1b
Simplify and correct the use-cases, with this the difference between …
ekluzek May 2, 2024
9ba3c23
revert changes in buildnml and config_component b/c in other PR
TeaganKing May 2, 2024
3401a68
fully revert config_component.xml
TeaganKing May 2, 2024
f80e323
config_conmponent.xml undo
TeaganKing May 2, 2024
b368096
Merge tag 'ctsm5.2.002' into merge-b4bdev-20240502
samsrabin May 2, 2024
37a5c60
Update ChangeLog and ChangeSum.
samsrabin May 2, 2024
10a2345
Merge pull request #2513 from samsrabin/merge-b4bdev-20240502
samsrabin May 2, 2024
39cd37d
Provide scalar cth and cbh in unit tests. Failing.
samsrabin May 6, 2024
486d634
Ensure cth and cbh are iterable before zipping. Unit tests now pass.
samsrabin May 6, 2024
af672fb
Fix comparison to a baseline directory
ekluzek May 6, 2024
cfeb9d6
Move ensure_iterable() to utils.py and add testing. One failure.
samsrabin May 6, 2024
a696d95
ensure_iterable() now errors if already iterable but wrong length. Te…
samsrabin May 6, 2024
475831f
Clean up ctsm/utils.py with black and pylint.
samsrabin May 6, 2024
0819983
Add previous commit to .git-blame-ignore-revs.
samsrabin May 6, 2024
3e23cd9
Merge branch 'b4b-dev' into fix-subset-data-cth
samsrabin May 6, 2024
9a28e2a
Merge pull request #2528 from samsrabin/fix-subset-data-cth
samsrabin May 6, 2024
eec4e79
Update testlist based on what's needed for CAM and CESM test lists
ekluzek May 7, 2024
e529c2f
Add IHistClm60BgcCropG which is needed for CESM testing, change NoAnt…
ekluzek May 7, 2024
d6beae7
Merge tag 'ctsm5.2.003' into fixclm50defaults
ekluzek May 7, 2024
9b5001d
Fix #2519 so that the mksurfdata_esmf build can work in a CESM checkout
ekluzek May 7, 2024
89a4d1d
Update ctsm_sci tests for 3 VR grids
May 7, 2024
b64ceb6
Change an expected failure "status" from PEND to FAIL
slevis-lmwg May 8, 2024
f330407
Change comments about clm5_1 to clm6_0
ekluzek May 8, 2024
524cbc0
Revert order of irrigate and add note that it's also set in the use-c…
ekluzek May 8, 2024
b9e947d
Get mksurfdata_esmf build and namelist build working under a CESM che…
ekluzek May 8, 2024
7d91ac1
Correct clm60 typo in testlist
ekluzek May 8, 2024
010a008
Add a description and usage and error check command line args
ekluzek May 8, 2024
181dff2
Merge branch 'fixclm50defaults' of github.com:ekluzek/CTSM into fixcl…
ekluzek May 8, 2024
fc02613
Adjustments to the testlist
ekluzek May 8, 2024
f8c6a49
Add a ctsm_sci test for I1850Clm50BgcCropG to verify that current B18…
ekluzek May 9, 2024
d2cccd8
Merge remote-tracking branch 'escomp/master' into vr_grid_updates
slevis-lmwg May 9, 2024
c37f743
Add more tests of finidat file settings, a bunch of things fail becau…
ekluzek May 9, 2024
f997494
Updated ChangeLog/ChangeSum
slevis-lmwg May 9, 2024
7cf411a
Merge pull request #2490 from slevis-lmwg/vr_grid_updates
slevis-lmwg May 9, 2024
cf1a297
Update Externals.cfg to cesm2_3_beta17
slevis-lmwg May 9, 2024
2aa76c4
Remove mct from Externals.cfg
slevis-lmwg May 9, 2024
ccce061
Remove cpl7 from Externals.cfg
slevis-lmwg May 9, 2024
4861125
Remove MCT from README and .config_files.xml
slevis-lmwg May 10, 2024
db147cd
Remove MCT from CLMBuildNamelist.pm
slevis-lmwg May 10, 2024
68d46b6
Remove MCT from build-namelist_test.pl
slevis-lmwg May 10, 2024
190be8b
Fix the 2010 use case, and get the namelist testing working better
ekluzek May 10, 2024
f3386bc
Remove MCT from config_definition_ctsm.xml
slevis-lmwg May 10, 2024
dc70323
Remove MCT from ExpectedTestFails.xml and update README.NUOPC_driver.md
slevis-lmwg May 10, 2024
629961c
Remove reference to MCT in fsurdat_modifier.py
slevis-lmwg May 10, 2024
fb5b631
Remove src/unit_test_stubs/csm_share/CMakeLists.txt
slevis-lmwg May 10, 2024
3d1ab9b
Remove MCT from test_driver.sh
slevis-lmwg May 10, 2024
371f093
Remove the src/cpl/mct directory
slevis-lmwg May 10, 2024
788f499
Remove a couple more references to MCT
slevis-lmwg May 10, 2024
cc0e04d
Update ntests in build-namelist_test.pl
slevis-lmwg May 10, 2024
2b8c042
Fix the tests so expected fails, actually fail
ekluzek May 11, 2024
8c10965
Set use_init_interp=T for finidat files that are older than ctsm5.2
ekluzek May 11, 2024
0b72035
Merge tag 'ctsm5.2.004' into fixclm50defaults
ekluzek May 11, 2024
e14303f
Fix irrigate for two use-cases so namelists all agree with the ctsm5.…
ekluzek May 13, 2024
9fa2841
New finidat files for clm5_1/clm6_0 for 1850
ekluzek May 13, 2024
0b41efe
Change name to remove shell type extension
ekluzek May 13, 2024
ac3cb73
Reverse comparision so agrees with how documented
ekluzek May 13, 2024
942fee9
remove clm5_1 old finidat file so will always use the ne30 new one
ekluzek May 13, 2024
77690ed
Start on Change files
ekluzek May 13, 2024
a09d223
Some tests were failing to find the 1850 finidat file, more changes t…
ekluzek May 13, 2024
9ecc1bc
Fix a resoplution name in a test
ekluzek May 13, 2024
8bf5f5a
Add test to expected fails
ekluzek May 13, 2024
672da6d
Update change log a bit
ekluzek May 13, 2024
75b34d2
Merge pull request #2501 from ekluzek/fixclm50defaults
ekluzek May 13, 2024
4715afe
Bring back src/unit_test_stubs/csm_share/CMakeLists.txt for FUNIT test
slevis-lmwg May 15, 2024
39dc01e
Revert "Remove the src/cpl/mct directory"
slevis-lmwg May 16, 2024
7c295b8
Remove test/tools/test_driver.sh, unrelated to this PR, good to clean up
slevis-lmwg May 16, 2024
0a08723
Fix for issue #2546
slevis-lmwg May 16, 2024
e454451
Add izumi nag debug tests to ExpectedTestFails as per ESCOMP/CMEPS#460
slevis-lmwg May 17, 2024
7008575
Merge tag 'ctsm5.2.005' into upd_externals_to_beta17
May 17, 2024
9397431
First draft ChangeLog/ChangeSum
May 17, 2024
6b460a2
Update ntests in build-namelist_test.pl
slevis-lmwg May 18, 2024
7072f7a
Resolve the mizuRoute issue
ekluzek May 20, 2024
ff4d35f
Remove set_glc2lnd_fields_mct (not tested, yet)
slevis-lmwg May 21, 2024
4d62578
Remove /src/cpl/mct again; I was right the first time
slevis-lmwg May 21, 2024
4cbc00d
Remove another mct comment
slevis-lmwg May 21, 2024
854ff9d
Remove cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb directory
slevis-lmwg May 21, 2024
6b6ea52
Remove mention of mct in README.NUOPC_driver.md
slevis-lmwg May 21, 2024
40367c5
Remove an expected failure the mentions mct in ExpectedTestFails.xml
slevis-lmwg May 21, 2024
e99eaea
Add back mct to Externals.cfg
slevis-lmwg May 21, 2024
fed6805
Remove /test subdirectory
slevis-lmwg May 21, 2024
69dbee8
Remove bld/unit_testers/xFail/wrapClmTests.pl
slevis-lmwg May 21, 2024
8ef1ff4
Remove obsolete parts of bld/unit_testers/xFail/expectedFail.pm
slevis-lmwg May 21, 2024
0c26697
Remove obsolete parts of expectedClmTestFails.xml: DID I rm ENOUGH?
slevis-lmwg May 21, 2024
882425a
Remove mention of test_driver_*.sh in .gitignore
slevis-lmwg May 21, 2024
9407ce5
Remove reference to /test in /doc/.../testing.rst
slevis-lmwg May 21, 2024
93c274d
Update README by removing mention of /test directory
slevis-lmwg May 21, 2024
802b989
Second draft of ChangeLog/ChangeSum
slevis-lmwg May 21, 2024
a14ab08
Update cmeps to cmeps0.14.63 in Externals.cfg
slevis-lmwg May 23, 2024
fc53412
Fix for the LILACSMOKE test to pass
slevis-lmwg May 24, 2024
b7a0adf
Rm expected fails associated w https://github.com/ESCOMP/CMEPS/pull/460
slevis-lmwg May 24, 2024
9fc1352
Correct a testname in ExpectedTestFails.xml
slevis-lmwg May 24, 2024
a7b60fa
first remove manage_externals and update docs
jedwards4b May 27, 2024
0f7d429
add submodules
jedwards4b May 27, 2024
aa54473
update submodules
jedwards4b May 27, 2024
798d43c
Add comment in lilacsmoke.py as per code review
slevis-lmwg May 28, 2024
aaeae95
Updated ChangeLog and ChangeSum
slevis-lmwg May 28, 2024
62d8ad0
Update share in Externals.cfg
slevis-lmwg May 28, 2024
26c1222
Update ChangeLog with latest info about tests
slevis-lmwg May 28, 2024
6aebaad
Merge pull request #2539 from slevis-lmwg/upd_externals_to_beta17
slevis-lmwg May 28, 2024
5cdf117
update ChangeLog
jedwards4b May 28, 2024
51079bf
update run_sys_tests.py for fleximod
jedwards4b May 29, 2024
6b550b1
Replace checkout_externals with git-fleximod in documentation
slevis-lmwg May 29, 2024
6129622
Restore .gitignore as it was
slevis-lmwg May 29, 2024
5a577cd
Delete README_EXTERNALS.rst to be like #2559
slevis-lmwg May 29, 2024
61c97a1
Add dummy ./manage_externals/checkout_externals with ERROR message
slevis-lmwg May 29, 2024
1ed3f19
Replace cheyenne with derecho in a .rst file
slevis-lmwg May 29, 2024
4f9db00
Add "bin/" before git-fleximod in README documentation
slevis-lmwg May 30, 2024
8ac86a1
Replacing README_EXTERNALS.rst with README_GITFLEXIMOD.rst
slevis-lmwg May 30, 2024
03762a0
Updates to README_GITFLEXIMOD.rst as per Jim's review
slevis-lmwg May 30, 2024
6fa0255
Jim's suggestions for doc/.../lilac/.../obtaining-and-building-ctsm.rst
slevis-lmwg May 30, 2024
ae93d22
Remove cheyenne from testlis_clm.xml
slevis-lmwg May 30, 2024
256877f
Merge remote-tracking branch 'slevis-lmwg/git-fleximod_documentation'…
slevis-lmwg May 31, 2024
b25a02d
fix subtree add
jedwards4b May 31, 2024
eb94e4d
Squashed '.lib/git-fleximod/' content from commit a354b0528
jedwards4b May 31, 2024
7fcad57
Merge commit 'eb94e4d298564d52197d9cf632d73ffad74c5f61' as '.lib/git-…
jedwards4b May 31, 2024
a7f62da
Merge remote-tracking branch 'mydev/ctsm5.2.007/candidate' into ctsm5…
jedwards4b May 31, 2024
c834c30
Draft of ChangeLog/ChageSum
slevis-lmwg May 31, 2024
9a82a3f
Replace manage_externals with git-fleximod in an error message
slevis-lmwg May 31, 2024
c9020ec
Replace "externals directories" with "git submodules" in ChangeLogs
slevis-lmwg May 31, 2024
a943377
Merge pull request #2559 from jedwards4b/ctsm5.2.007/candidate
slevis-lmwg May 31, 2024
a0f834f
update plumber for consistency and fix import
TeaganKing Jun 25, 2024
bc1ac5d
merge
TeaganKing Jun 25, 2024
76f7220
updates to run_tower
TeaganKing Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .config_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
<values>
<value component="clm" >$SRCROOT</value>
<value component="slim" >$SRCROOT/components/slim/</value>
<value component="dlnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/data_comps_$COMP_INTERFACE/dlnd</value>
<value component="dlnd" comp_interface="nuopc" >$SRCROOT/components/cdeps/dlnd</value>
<value component="slnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/stub_comps_$COMP_INTERFACE/slnd</value>
<value component="slnd" comp_interface="nuopc" >$CIMEROOT/CIME/non_py/src/components/stub_comps_$COMP_INTERFACE/slnd</value>
<value component="xlnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/xcpl_comps_$COMP_INTERFACE/xlnd</value>
<value component="xlnd" comp_interface="nuopc" >$CIMEROOT/CIME/non_py/src/components/xcpl_comps_$COMP_INTERFACE/xlnd</value>
</values>
<group>case_comps</group>
Expand Down
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ a9d96219902cf609636886c7073a84407f450d9a
d866510188d26d51bcd6d37239283db690af7e82
0dcd0a3c1abcaffe5529f8d79a6bc34734b195c7
e096358c832ab292ddfd22dd5878826c7c788968
475831f0fb0e31e97f630eac4e078c886558b61c
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
8056ae649c1b37f5e10aaaac79005d6e3a8b2380
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Testing performed, if any:
(List what testing you did to show your changes worked as expected)
(This can be manual testing or running of the different test suites)
(Documentation on system testing is here: https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide)
(aux_clm on cheyenne for intel/gnu and izumi for intel/gnu/nag/pgi is the standard for tags on master)
(aux_clm on derecho for intel/gnu and izumi for intel/gnu/nag/nvhpc is the standard for tags on master)

**NOTE: Be sure to check your coding style against the standard
(https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines) and review
Expand Down
15 changes: 3 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# directories checked out by manage_externals, and other files created
# by manage_externals
manage_externals.log
ccs_config
/src/fates/
/cime/
/components/
/libraries/
/share/
/doc/doc-builder/

# ignore svn directories
**/.svn/**
.svn/
Expand Down Expand Up @@ -75,7 +64,6 @@ buildnmlc
td.*.status
td.*.log
td.*.status.xFail
test_driver_*.sh

# mksurfdata output
surfdata_*.log
Expand Down Expand Up @@ -108,8 +96,11 @@ unit_test_build
/tools/site_and_regional/listing.csv
/tools/site_and_regional/????/
/tools/site_and_regional/????.ad/
/tools/site_and_regional/????.*.ad/
/tools/site_and_regional/????.postad/
/tools/site_and_regional/????.*.postad/
/tools/site_and_regional/????.transient/
/tools/site_and_regional/????.*.transient/
/tools/site_and_regional/archive/

# build output
Expand Down
90 changes: 90 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[submodule "fates"]
path = src/fates
url = https://github.com/NGEET/fates
fxtag = sci.1.73.0_api.35.0.0
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/NCAR/fates-release

[submodule "cism"]
path = components/cism
url = https://github.com/ESCOMP/CISM-wrapper
fxtag = cismwrap_2_2_001
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper

[submodule "rtm"]
path = components/rtm
url = https://github.com/ESCOMP/RTM
fxtag = rtm1_0_79
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/RTM

[submodule "mosart"]
path = components/mosart
url = https://github.com/ESCOMP/MOSART
fxtag = mosart1_0_49
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/MOSART

[submodule "mizuRoute"]
path = components/mizuRoute
url = https://github.com/ESCOMP/mizuRoute
fxtag = cesm-coupling.n02_v2.1.2
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute

[submodule "ccs_config"]
path = ccs_config
url = https://github.com/ESMCI/ccs_config_cesm.git
fxtag = ccs_config_cesm0.0.106
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git

[submodule "cime"]
path = cime
url = https://github.com/ESMCI/cime
fxtag = cime6.0.246
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESMCI/cime

[submodule "cmeps"]
path = components/cmeps
url = https://github.com/ESCOMP/CMEPS.git
fxtag = cmeps0.14.63
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git

[submodule "cdeps"]
path = components/cdeps
url = https://github.com/ESCOMP/CDEPS.git
fxtag = cdeps1.0.34
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git

[submodule "share"]
path = share
url = https://github.com/ESCOMP/CESM_share
fxtag = share1.0.19
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share

[submodule "mct"]
path = libraries/mct
url = https://github.com/MCSclimate/MCT
fxtag = MCT_2.11.0
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/MCSclimate/MCT

[submodule "parallelio"]
path = libraries/parallelio
url = https://github.com/NCAR/ParallelIO
fxtag = pio2_6_2
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NCAR/ParallelIO

[submodule "doc-builder"]
path = doc/doc-builder
url = https://github.com/ESMCI/doc-builder
fxtag = v1.0.8
fxrequired = ToplevelOptional
fxDONOTUSEurl = https://github.com/ESMCI/doc-builder
13 changes: 13 additions & 0 deletions .lib/git-fleximod/.github/workflows/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pre-commit
on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
77 changes: 77 additions & 0 deletions .lib/git-fleximod/.github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Run this job on pushes to `main`, and for pull requests. If you don't specify
# `branches: [main], then this actions runs _twice_ on pull requests, which is
# annoying.

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# If you wanted to use multiple Python versions, you'd have specify a matrix in the job and
# reference the matrixe python version here.
- uses: actions/setup-python@v5
with:
python-version: '3.9'

# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be
# mildly cleaner by using an environment variable, but I don't really care.
- name: cache poetry install
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-1.7.1

# Install Poetry. You could do this manually, or there are several actions that do this.
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
# Poetry's default install script, which feels correct. I pin the Poetry version here
# because Poetry does occasionally change APIs between versions and I don't want my
# actions to break if it does.
#
# The key configuration value here is `virtualenvs-in-project: true`: this creates the
# venv as a `.venv` in your testing directory, which allows the next step to easily
# cache it.
- uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
- name: cache deps
id: cache-deps
uses: actions/cache@v4
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}

# Install dependencies. `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'

# Now install _your_ project. This isn't necessary for many types of projects -- particularly
# things like Django apps don't need this. But it's a good idea since it fully-exercises the
# pyproject.toml and makes that if you add things like console-scripts at some point that
# they'll be installed and working.
- run: poetry install --no-interaction

# And finally run tests. I'm using pytest and all my pytest config is in my `pyproject.toml`
# so this line is super-simple. But it could be as complex as you need.
- run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
poetry run pytest

18 changes: 18 additions & 0 deletions .lib/git-fleximod/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
exclude: ^utils/.*$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/pylint
rev: v2.11.1
hooks:
- id: pylint
args:
- --disable=I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement,logging-format-interpolation,no-name-in-module,arguments-renamed,unspecified-encoding,protected-access,import-error,no-member
20 changes: 20 additions & 0 deletions .lib/git-fleximod/License
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2024 NSF National Center for Atmospheric Sciences (NCAR)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
108 changes: 108 additions & 0 deletions .lib/git-fleximod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# git-fleximod

Flexible, Enhanced Submodule Management for Git

## Overview

Git-fleximod is a Python-based tool that extends Git's submodule and sparse checkout capabilities, offering additional features for managing submodules in a more flexible and efficient way.

## Installation

If you choose to locate git-fleximod in your path you can access it via command: git fleximod

## Usage

Basic Usage:
git fleximod <command> [options]
Available Commands:
status: Display the status of submodules.
update: Update submodules to the tag indicated in .gitmodules variable fxtag.
test: Make sure that fxtags and submodule hashes are consistant,
make sure that official urls (as defined by fxDONOTUSEurl) are set
make sure that fxtags are defined for all submodules
Additional Options:
See git fleximod --help for more details.

## Supported .gitmodules Variables

fxtag: Specify a specific tag or branch to checkout for a submodule.
fxrequired: Mark a submodule's checkout behavior, with allowed values:
- ToplevelRequired: Top-level and required (checked out only when this is the Toplevel module).
- ToplevelOptional: Top-level and optional (checked out with --optional flag if this is the Toplevel module).
- AlwaysRequired: Always required (always checked out).
- AlwaysOptional: Always optional (checked out with --optional flag).
fxsparse: Enable sparse checkout for a submodule, pointing to a file containing sparse checkout paths.
fxDONOTUSEurl: This is the url used in the test subcommand to assure that protected branches do not point to forks
**NOTE** the fxDONOTUSEurl variable is only used to identify the official project repository and should not be
changed by users. Use the url variable to change to a fork if desired.

## Sparse Checkouts

To enable sparse checkout for a submodule, set the fxsparse variable
in the .gitmodules file to the path of a file containing the desired
sparse checkout paths. Git-fleximod will automatically configure
sparse checkout based on this file when applicable commands are run.
See [git-sparse-checkout](https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set)
for details on the format of this file.

## Tests

The git fleximod test action is designed to be used by, for example, github workflows
to assure that protected branches are consistant with respect to submodule hashes and fleximod fxtags

## Examples

Here are some common usage examples:

Update all submodules, including optional ones:
```bash
git fleximod update --optional
```

Updating a specific submodule to the fxtag indicated in .gitmodules:

```bash
git fleximod update submodule-name
```
Example .gitmodules entry:
```ini, toml
[submodule "cosp2"]
path = src/physics/cosp2/src
url = https://github.com/CFMIP/COSPv2.0
fxsparse = ../.cosp_sparse_checkout
fxrequired = AlwaysRequired
fxtag = v2.1.4cesm
```
Explanation:

This entry indicates that the submodule named cosp2 at tag v2.1.4cesm
should be checked out into the directory src/physics/cosp2/src
relative to the .gitmodules directory. It should be checked out from
the URL https://github.com/CFMIP/COSPv2.0 and use sparse checkout as
described in the file ../.cosp_sparse_checkout relative to the path
directory. It should be checked out anytime this .gitmodules entry is
read.

Additional example:
```ini, toml
[submodule "cime"]
path = cime
url = https://github.com/jedwards4b/cime
fxrequired = ToplevelRequired
fxtag = cime6.0.198_rme01
```

Explanation:

This entry indicates that the submodule cime should be checked out
into a directory named cime at tag cime6.0.198_rme01 from the URL
https://github.com/jedwards4b/cime. This should only be done if
the .gitmodules file is at the top level of the repository clone.

## Contributing

We welcome contributions! Please see the CONTRIBUTING.md file for guidelines.

## License

Git-fleximod is released under the MIT License.
Loading
Loading