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 local branch for change in fre make command names #296

Merged
merged 369 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
369 commits
Select commit Hold shift + click to select a range
ea331f4
Update usage.rst
singhd789 Nov 7, 2024
007c21d
Put subtools in here
singhd789 Nov 7, 2024
f91b966
Need `include` back in here
singhd789 Nov 7, 2024
37e0fa4
Update fre_make.rst
singhd789 Nov 7, 2024
1ce5c53
reorganized intro and setup sections
Nov 7, 2024
fccc29a
Merge remote-tracking branch 'origin/main' into docs
Nov 7, 2024
4cca8d4
more reorganization and edits
Nov 7, 2024
e879d1e
Moved fre make and fre pp usages to standalone files with includes
Nov 7, 2024
a3a7188
Merge branch 'main' into update-ci-for-compilation
rem1776 Nov 8, 2024
07e7fb3
Organize guides and quickstarts
Nov 8, 2024
e482be0
Try to reference correctly
Nov 8, 2024
a366de9
Update references
Nov 8, 2024
40700aa
Dropdown option?
Nov 8, 2024
0fdfb40
Update index.rst
Nov 8, 2024
0e1b045
Fix link
Nov 8, 2024
9ba4552
Update tool_guides
Nov 8, 2024
3fc66af
Delete fre/make/gfdlfremake/fremake
ilaflott Nov 8, 2024
a541ea7
Update toold guides
Nov 8, 2024
f2813fc
Delete fre/make/gfdlfremake/.gitignore
ilaflott Nov 8, 2024
7bc1caf
Delete fre/make/gfdlfremake/.gitlab-ci.yml
ilaflott Nov 8, 2024
68acc08
Delete .gitlab-ci.yml
ilaflott Nov 8, 2024
6224b10
Delete ideas.md
ilaflott Nov 8, 2024
c4ef9fe
Delete .public directory
ilaflott Nov 8, 2024
067c50b
Update coveragerc
ilaflott Nov 8, 2024
9e65744
Update pytest.ini
ilaflott Nov 8, 2024
106bdd5
Delete fre/yamltools/freyamltoolsexample.py
ilaflott Nov 8, 2024
003b8c7
Update freyamltools.py
ilaflott Nov 8, 2024
bfdabf0
Fix reference link
Nov 8, 2024
bb7e5e0
more reorganization- keep tool-usage docs in a subdirectory
Nov 8, 2024
23042a8
Update coveragerc
ilaflott Nov 8, 2024
f4df6f2
Add space
Nov 8, 2024
26e2093
Merge pull request #245 from rem1776/update-ci-for-compilation
singhd789 Nov 8, 2024
9dcbc8a
Update meta.yaml
ilaflott Nov 8, 2024
0737de7
Fix links
Nov 8, 2024
854aeac
Update meta.yaml
ilaflott Nov 8, 2024
9a93a3d
Update guide name
Nov 8, 2024
84cca7f
Merge branch 'main' into delete-some-things
ilaflott Nov 8, 2024
dd0bf01
Update guide format
Nov 8, 2024
e18af66
Update coveragerc
ilaflott Nov 8, 2024
f1756d8
wrapper logic reworked #174
Nov 8, 2024
9a3ee16
Update coveragerc
ilaflott Nov 8, 2024
fb06dca
Update pytest.ini
ilaflott Nov 8, 2024
0af2db4
Update meta.yaml
ilaflott Nov 8, 2024
fce9775
Delete fre/app/generate_time_averages/tests/.unused_tests directory
ilaflott Nov 8, 2024
1b7f2c7
Update test_generate_time_averages.py
ilaflott Nov 8, 2024
fe1f809
Update meta.yaml
ilaflott Nov 8, 2024
e8f8ae4
Update pytest.ini
ilaflott Nov 8, 2024
463504d
Update coveragerc
ilaflott Nov 8, 2024
f161cd7
Update checkoutScript.py
kiihne-noaa Nov 8, 2024
1c0a531
varous small improvemnets to address comments
kiihne-noaa Nov 8, 2024
f91514c
Update checkoutScript.py
kiihne-noaa Nov 8, 2024
877eae7
Merge pull request #260 from NOAA-GFDL/delete-some-things
ilaflott Nov 12, 2024
b2a1eb9
Merge branch 'main' into main
singhd789 Nov 12, 2024
11160fc
Update tool_guides.rst
singhd789 Nov 12, 2024
08cb924
Start yaml dev documentation
Nov 12, 2024
101c6d5
Update setup.rst
Nov 12, 2024
17df5cd
Update format
Nov 12, 2024
88f51d1
Update publish_conda.yml
singhd789 Nov 12, 2024
c826eb7
Didn't mean to add space
singhd789 Nov 12, 2024
c82fc31
Merge pull request #262 from singhd789/main
ilaflott Nov 12, 2024
f710d3e
Merge branch 'main' of github.com:singhd789/fre-cli into yaml-dev-docs
Nov 12, 2024
68d8d86
Merge remote-tracking branch 'origin/main' into docs
Nov 12, 2024
7db1c19
Merge pull request #259 from NOAA-GFDL/docs
ceblanton Nov 12, 2024
298ee6a
Merge branch 'main' of github.com:singhd789/fre-cli into yaml-dev-docs
Nov 12, 2024
5a3672f
Move yaml framework to usage
Nov 12, 2024
5862f67
Update setup.rst
singhd789 Nov 12, 2024
4877ee5
Merge pull request #1 from singhd789/yaml-dev-docs
singhd789 Nov 12, 2024
fff988a
Creat yaml_framework.rst
Nov 12, 2024
63a2126
subsubsection format
Nov 12, 2024
d2307c1
Some more docs
Nov 13, 2024
806804e
Add yaml framework doc
Nov 13, 2024
fe1078d
reviewing checkoutScript.py
kiihne-noaa Nov 13, 2024
a6d6a82
syntax change
kiihne-noaa Nov 13, 2024
653a51d
Update format
Nov 13, 2024
a34f559
removed outdated aspects
kiihne-noaa Nov 13, 2024
d7ff341
Update format
Nov 13, 2024
715ef36
Update format
Nov 13, 2024
19a7e2a
testing
Nov 13, 2024
8f8d17f
spelling change
kiihne-noaa Nov 13, 2024
e658eb7
Update checkoutScript.py
kiihne-noaa Nov 13, 2024
e151d2f
add some additional tests
Nov 13, 2024
1ae9612
Update compile yaml doc
Nov 13, 2024
8cacfec
Update format
Nov 13, 2024
2f2c5ef
inital changes for run-fremake execute option
Nov 13, 2024
b3ceb30
Add guide and quickstart in usage
Nov 13, 2024
36b03f5
Update docs
Nov 14, 2024
955ab1e
fix some things
Nov 14, 2024
0d9e416
uncomment things
Nov 14, 2024
d0c5ddd
remove space
Nov 14, 2024
96f79ef
Update checkoutScript.py
kiihne-noaa Nov 14, 2024
744c3a5
documentation and version changes
kiihne-noaa Nov 14, 2024
0de08a8
order change
kiihne-noaa Nov 14, 2024
108a123
sanity check of recursive
kiihne-noaa Nov 14, 2024
fe5fc2c
more print statements
Nov 14, 2024
cdd6fa8
Merge pull request #264 from singhd789/main
singhd789 Nov 15, 2024
4b3cde4
update esm4p2 and null model yamls for c5 update
Nov 15, 2024
2d28f49
Update frepp.py so branch does not default to main
kiihne-noaa Nov 15, 2024
3eee452
Update checkoutScript.py documentation
kiihne-noaa Nov 15, 2024
67e7522
Merge branch 'NOAA-GFDL:main' into run-fremake-exec-option
rem1776 Nov 15, 2024
ec650ba
attempt to change default away from main
Nov 15, 2024
c29e311
add a function to generate a container build script if --execute not …
Nov 15, 2024
26956ba
delete yamls that are in the fre-examples repo (and not used here)
Nov 15, 2024
670cf66
add option to test_fre_make_run_fremake.py
rem1776 Nov 20, 2024
ed44e68
remove module check
rem1776 Nov 20, 2024
1c06ab3
Merge pull request #263 from NOAA-GFDL/docs
ilaflott Nov 22, 2024
d12ec53
Merge remote-tracking branch 'fre/main'
menzel-gfdl Nov 22, 2024
b980f03
fix click entry point, explicitly raise filenotfounderror when the ya…
ilaflott Nov 22, 2024
443d2bf
try resetting os.environ HOME back to default when makefile creation …
ilaflott Nov 22, 2024
b311a36
remove ch.dir from comments for searchability on github
ilaflott Nov 22, 2024
2da499c
swap entrypoint convention for fre pp validate
ilaflott Nov 22, 2024
ece0d33
tweak makfile test to restore homedir to what it once was before the …
ilaflott Nov 22, 2024
50999f3
fre pp chekcout test after fixing makefile test home directory path c…
ilaflott Nov 22, 2024
9fc7fe5
remove chdir dependency in fre pp checkout. fix click entrypoint conv…
ilaflott Nov 22, 2024
32a24a6
add missing os module import
ilaflott Nov 22, 2024
0b3bb50
add in missing pathlib.Path import
ilaflott Nov 22, 2024
9e5ee57
add some analysis subtools
menzel-gfdl Nov 22, 2024
781dc93
Adds containerBase stuff in a first pass
thomas-robinson Nov 25, 2024
6709ada
#216 Fix compile log and change some format to f-strings
singhd789 Nov 25, 2024
8876b2d
#216 Merge branch 'main' of github.com:NOAA-GFDL/fre-cli into 216.fi…
singhd789 Nov 25, 2024
68ec400
Merge branch '216.fix-compile-log-generation' of github.com:NOAA-GFDL…
Nov 25, 2024
ad7b893
Merge pull request #272 from NOAA-GFDL/fre-pp-click-fix-n-test
ceblanton Nov 25, 2024
6ae4995
#216 Add f-string
singhd789 Nov 25, 2024
211d9a1
Safer method of specifying None as default
Nov 26, 2024
558429f
The evils of changing directory- you must go back at least
Nov 26, 2024
bda67b2
Improve error message clarity (sort of)
Nov 26, 2024
822900b
Print 2024.1 as 2024.01 when called as fre --version
Nov 26, 2024
7492c80
Comment out version specifying in __init__.py for now
Nov 26, 2024
0f07d19
Remove hard-coded 2024.1 to 2024.01 translation
Nov 26, 2024
3770d33
Prepend the yaml directory to the sub-yamls when combining
Nov 26, 2024
35ae479
Removed old unused bash script
Nov 26, 2024
de6c8c7
logic for fre pp install to compare configurations
Nov 26, 2024
6bbf2cd
please help me learn python exceptions
Nov 26, 2024
dde4862
fre pp wrapper to print one round of 'fre pp status' and exit
Nov 26, 2024
c2f17d3
Merge remote-tracking branch 'origin/main' into checkout_edits
Nov 26, 2024
01023ef
Align some click bindings
Nov 26, 2024
bdfa7f5
Added --time option to fre pp wrapper, and standalone fre pp trigger
Nov 26, 2024
c42687b
Somewhat improved error message
Nov 26, 2024
5775bab
Merge pull request #270 from rem1776/platform-updates
singhd789 Nov 26, 2024
bb6a581
Merge branch 'main' into checkout_edits
ilaflott Nov 26, 2024
f81d60a
make create_test_conda_env.yml run on pull_request
ilaflott Nov 26, 2024
e5cce13
skip fre make test thats curently failing, fix in development.
ilaflott Nov 26, 2024
6ad3f1a
poke at for readability...
ilaflott Nov 26, 2024
e158de2
fix workflow to only run on pull_request, not BOTH a push AND a pull_…
ilaflott Nov 26, 2024
da1c041
import pytest to actually skip the test...
ilaflott Nov 26, 2024
cf02067
add try/except for dir creation.
ilaflott Nov 26, 2024
4a314c6
tweak fre pp checkout test
ilaflott Nov 26, 2024
b2ff4a5
toc_tree depth now 2
ilaflott Nov 26, 2024
16b5e65
snake case changes and reference tweaks elsewhere as needed
ilaflott Nov 26, 2024
0827afe
add gettid flag to null model
rem1776 Nov 26, 2024
5528378
pylint things, clean up of checkout_script functioning, fix fre versi…
ilaflott Nov 26, 2024
57780a4
fix fre versioning reference, remove version input to click version o…
ilaflott Nov 26, 2024
4b43e0c
pylint feedback
ilaflott Nov 26, 2024
cc8f830
switch target/time flags in wrapper calls to be consistent with other…
ilaflott Nov 26, 2024
caffa7f
add pull_request trigger to create_test_conda_env workflow
rem1776 Nov 26, 2024
7fe174e
put the -t/-T convention back to what it was for bronx
ilaflott Nov 26, 2024
8c3f40c
Merge pull request #249 from NOAA-GFDL/checkout_edits
ilaflott Nov 26, 2024
731e384
Merge branch 'main' into add-gettid-null-model
rem1776 Nov 26, 2024
18314b9
#216 Merge branch 'main' of github.com:NOAA-GFDL/fre-cli into 216.fi…
singhd789 Nov 26, 2024
caca0ee
Merge pull request #276 from NOAA-GFDL/add-gettid-null-model
singhd789 Nov 26, 2024
67ddb84
#216 Merge branch 'main' of github.com:NOAA-GFDL/fre-cli into 216.fi…
singhd789 Nov 26, 2024
7b06b5a
update null model platforms for latest c5 modules
Nov 26, 2024
b16ca8a
Merge branch 'main' of github.com:noaa-gfdl/fre-cli into run-fremake-…
Nov 26, 2024
c52a769
changes to always create the container build script
Nov 26, 2024
879a772
always create a container buildscript for createDockerfile subcommand
Nov 26, 2024
49a96bc
fix add and get methods for fre analysis
menzel-gfdl Nov 26, 2024
e18742f
rename fre/pp/*.py files to not clash with click cli command names. s…
ilaflott Nov 27, 2024
5503fee
adjust workflow run condition.
ilaflott Nov 27, 2024
ab50f68
unused arguments, a doc string here and there
ilaflott Nov 27, 2024
97719cd
timeout time now at top of script in constant var notation to avoid p…
ilaflott Nov 27, 2024
919ebe5
fix indentation for combine_yamls classes and functions
ilaflott Nov 27, 2024
a7f3ee9
#216 Wait for process1 to finish before checking return code
singhd789 Nov 27, 2024
8fa356b
add output for checkout and makefile creation for runfremake
Nov 27, 2024
2c887f3
attempting to address some bad indentation and variable names.
ilaflott Nov 27, 2024
3a786e7
Merge pull request #275 from NOAA-GFDL/216.fix-compile-log-generation
ilaflott Nov 27, 2024
c8d940e
Merge pull request #271 from rem1776/run-fremake-exec-option
singhd789 Nov 27, 2024
b1b0ec2
fix imports
ilaflott Nov 27, 2024
5b24ee9
Merge branch 'NOAA-GFDL:main' into createDockerfile-buildscript
rem1776 Nov 27, 2024
c9ea70d
typo fix
ilaflott Nov 27, 2024
0994770
fix merge conflics
ilaflott Nov 27, 2024
894d988
add positional argument for new execute flag
ilaflott Nov 27, 2024
999e459
add import to createDockerfile.py
Nov 27, 2024
eaa05ed
Merge pull request #277 from rem1776/createDockerfile-buildscript
singhd789 Nov 27, 2024
6a146a3
versioning is not fun
ilaflott Nov 27, 2024
69e1644
Merge branch 'main' into fix_ambiguous_click_command_calls
ilaflott Nov 27, 2024
712e4eb
GOT the version info all in one place!
ilaflott Nov 27, 2024
f78650b
fre version testing!!
ilaflott Nov 27, 2024
4409b58
Fixed logic for fre pp checkout's branch and tag checking
Nov 27, 2024
2a49f1d
Merge pull request #279 from NOAA-GFDL/fix_ambiguous_click_command_calls
ceblanton Nov 27, 2024
c28f08d
Updates for supporting container base other than the e4s 2023 container.
thomas-robinson Nov 29, 2024
43c7278
Resolves merge conflicts with create_checkout
thomas-robinson Dec 3, 2024
cf54489
Adds the schema update
thomas-robinson Dec 3, 2024
6887358
Adds the containerBase to the test yamls in fre make tests
thomas-robinson Dec 3, 2024
194b464
Updates test yamls with new keys for container platform
thomas-robinson Dec 3, 2024
2cddebe
Merge branch 'main' of github.com:NOAA-GFDL/fre-cli
Dec 4, 2024
d33771b
remove fc and cc from the platform options, clean up the get platform…
uramirez8707 Dec 4, 2024
13fea25
Merge branch 'remove_fc_cc' of github.com:uramirez8707/fre-cli
Dec 4, 2024
8ae286b
return a dictionary in getPlatformFromName
Dec 4, 2024
fe561c1
in-progress updates from Ray's /net2/rlm/cleanup-fre-cli location
Dec 5, 2024
d4413bc
Add --name option to fre-analysis-install to install a subdirectory i…
Dec 6, 2024
6281b28
install analysis scripts in custom locations
menzel-gfdl Dec 6, 2024
f6dbbce
fix install
menzel-gfdl Dec 6, 2024
bc97bf5
fix package name
menzel-gfdl Dec 6, 2024
f9283f4
fix path issue
menzel-gfdl Dec 6, 2024
2dd0421
remove fc and cc from documentation and the null model
uramirez8707 Dec 9, 2024
c19df89
Merge branch 'remove_fc_cc' of github.com:uramirez8707/fre-cli into r…
uramirez8707 Dec 9, 2024
efd48b3
Fix print statement to reflect full path to combined yaml
singhd789 Dec 9, 2024
c2cec0f
Fix combined yaml output path for compilation too
singhd789 Dec 9, 2024
4b6777e
fix path issue
menzel-gfdl Dec 9, 2024
3e385f9
Merge pull request #288 from NOAA-GFDL/singhd789-patch-1
singhd789 Dec 9, 2024
3c9cacb
Merge pull request #284 from uramirez8707/remove_fc_cc
singhd789 Dec 10, 2024
26ef07e
Update quickstart to use null_model example instead of AM5
Dec 10, 2024
2469555
Update combine-yamls documentation
Dec 10, 2024
6899f33
Merge branch 'main' of github.com:noaa-gfdl/fre-cli into add-run-frem…
Dec 10, 2024
b813396
Merge branch 'NOAA-GFDL:main' into add-run-fremake-tests
rem1776 Dec 11, 2024
d2d66ea
update null model yaml for updates
Dec 11, 2024
75a7dde
Fix create_makefile_script.py location message for container build
singhd789 Dec 11, 2024
2d349a8
Update buildBaremetal.py print statement
singhd789 Dec 11, 2024
097e772
Undo last edit
singhd789 Dec 11, 2024
c562acd
add any remaining tests that dont build anything
Dec 11, 2024
cdc2ca6
update compilation tests
Dec 11, 2024
b7789da
update some comments
Dec 11, 2024
a2070b1
fix a incorrect function name in test
Dec 11, 2024
4c30408
fix typos
Dec 11, 2024
dcbbcef
fix bug and add missing environment line
menzel-gfdl Dec 12, 2024
4d817eb
add fre analysis cli tests
menzel-gfdl Dec 12, 2024
0ad7e5c
Fix click decorator calls
singhd789 Dec 12, 2024
f4256fb
Merge pull request #293 from NOAA-GFDL/fix-decorators
singhd789 Dec 12, 2024
e5757e1
add analysis subtool tests
menzel-gfdl Dec 12, 2024
0d71d89
add directory so it is tested
menzel-gfdl Dec 12, 2024
5aa7720
skip container build test for now
rem1776 Dec 12, 2024
c9117ca
Add 'fre analysis list' listing tool
Dec 12, 2024
16e2cd3
Merge remote-tracking branch 'ray/add-analysis-tools' into add-analys…
Dec 12, 2024
bf86e36
print one found plugin per line in fre analyis list
Dec 12, 2024
8146c01
remove context pass
menzel-gfdl Dec 13, 2024
e50732b
Merge branch 'add-analysis-tools' of github.com:menzel-gfdl/fre-cli i…
menzel-gfdl Dec 13, 2024
304b485
Merge remote-tracking branch 'fre/main' into add-analysis-tools
menzel-gfdl Dec 13, 2024
be89d99
switch to using the venv tool
menzel-gfdl Dec 13, 2024
2173632
more updates to meta.yaml
menzel-gfdl Dec 13, 2024
8042284
add empty init file
menzel-gfdl Dec 13, 2024
b6750b5
try again
menzel-gfdl Dec 13, 2024
c70ff7b
Resolves comments in #281 review related to comment indentation and a…
thomas-robinson Dec 16, 2024
02f947d
Resolves merge conflicts
thomas-robinson Dec 16, 2024
fefb51f
Merge pull request #289 from singhd789/update-cli-doc
ilaflott Dec 16, 2024
5d4c5f6
fix docstrings
menzel-gfdl Dec 16, 2024
f6c8cdc
Merge pull request #273 from menzel-gfdl/add-analysis-tools
ilaflott Dec 16, 2024
2b172bb
Update create_makefile_script.py
singhd789 Dec 16, 2024
121b45c
Merge pull request #292 from rem1776/add-run-fremake-tests
ilaflott Dec 16, 2024
55af0a2
Updates the gfdl_msd_schemas for the updated RUNenv
thomas-robinson Dec 16, 2024
a42e499
Merge pull request #291 from NOAA-GFDL/singhd789-patch-1
ilaflott Dec 16, 2024
9fa8b27
Merge pull request #281 from thomas-robinson/containerBase
singhd789 Dec 17, 2024
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
7 changes: 6 additions & 1 deletion .github/workflows/build_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: continuumio/miniconda3:latest
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
steps:
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add mkmf to PATH
run: |
echo $PWD/mkmf/bin >> $GITHUB_PATH
- name: Run Conda to Build
run: |
conda config --append channels conda-forge
Expand Down
58 changes: 23 additions & 35 deletions .github/workflows/create_test_conda_env.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,58 @@
name: create_test_conda_env

on: [push]
on: [pull_request]

jobs:
build-linux:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '>=3.9'

- name: Add conda to system path
run: |
# $CONDA is an env var pointing to root of miniconda dir
echo $CONDA/bin >> $GITHUB_PATH

submodules: 'recursive'
- name: Create fre-cli environment
run: |
# create environment containing all dependencies
# the env cannot be explicitly activated in github CI/CD
conda env create -f environment.yml --name fre-cli

# add conda env's executables to github's PATH equiv.
# sets CONDA to wherever it may be on the image
source /root/.bashrc

# add conda env's executables and mkmf to github's PATH equiv.
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH

echo $PWD/mkmf/bin >> $GITHUB_PATH

# use *conda environment's pip* to install fre-cli
# called w/ full path to conda's python for explicitness
# called as a module (-m pip) for explicitness
$CONDA/envs/fre-cli/bin/python -m pip install --prefix $CONDA/envs/fre-cli .
$CONDA/envs/fre-cli/bin/python -m pip install --prefix $CONDA/envs/fre-cli .

- name: Run pytest in fre-cli environment
run: |
# try to make sure the right things are in GITHUB_PATH
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH

# are we talking to the right python?
which python
python --version
$CONDA/envs/fre-cli/bin/python --version

# add spack installed binaries to front of path so that
# conda's netcdf/hdf5 installs don't break compilation tests
export path_save=$PATH
export PATH="/opt/views/view/bin:$PATH"

# run pytest
pytest --junit-xml=pytest_results.xml --config-file=fre/pytest.ini --cov-config=fre/coveragerc --cov-report=xml --cov=fre fre/

# install genbadge to generate coverage badge based on xml

# restore original path and install genbadge to generate coverage badge based on xml
export PATH="$path_save"
pip install genbadge
genbadge coverage -v -i coverage.xml -o docs/cov_badge.svg
genbadge tests -v -i pytest_results.xml -o docs/pytest_badge.svg

- name: Run pylint in fre-cli environment
run: |
# try to make sure the right things are in GITHUB_PATH
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH

# are we talking to the right python?
which python
python --version
$CONDA/envs/fre-cli/bin/python --version

# run pylint, ignored modules avoid warnings arising from code internal to those modules
# run pylint, ignored modules avoid warnings arising from code internal to those modules
pylint --max-args 6 -ry --ignored-modules netCDF4,cmor fre/ || echo "pylint returned non-zero exit code. preventing workflow from dying with this echo."

- name: Install Sphinx and Build Documentation
run: |
pip install sphinx renku-sphinx-theme sphinx-rtd-theme
pip install sphinx renku-sphinx-theme sphinx-rtd-theme
pip install --upgrade sphinx-rtd-theme
sphinx-apidoc --output-dir docs fre/ --separate
sphinx-build docs build
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/publish_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ jobs:
publish:
runs-on: ubuntu-latest
container:
image: continuumio/miniconda3:latest
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
steps:
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add mkmf to PATH
run: |
echo $PWD/mkmf/bin >> $GITHUB_PATH
- name: Run Conda to Build and Publish
run: |
conda config --append channels conda-forge
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# fremake generated files that should be ignored
combined-null_model.yaml
combined-am5.yaml
tmp
makefile_out
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
13 changes: 0 additions & 13 deletions .gitlab-ci.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "mkmf"]
path = mkmf
url = https://github.com/NOAA-GFDL/mkmf
[submodule "fre/gfdl_msd_schemas"]
path = fre/gfdl_msd_schemas
url = https://github.com/NOAA-GFDL/gfdl_msd_schemas
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## **For Developers**

* Developers are free to use this repository's `README.md` to familiarize with the CLI and save time from having to install any dependencies, but development within a Conda environment is heavily recommended regardless
* Gain access to the repository with `git clone [email protected]:NOAA-GFDL/fre-cli.git` or your fork's link (recommended) and an SSH RSA key
* Gain access to the repository with `git clone --recursive [email protected]:NOAA-GFDL/fre-cli.git` or your fork's link (recommended) and an SSH RSA key
- Once inside the repository, developers can test local changes by running a `pip install .` inside of the root directory to install the fre-cli package locally with the newest local changes on top of the installed Conda fre-cli dependencies
- Test as a normal user would use the CLI
* Create a GitHub issue to reflect your contribution's background and reference it with Git commits
Expand Down
2 changes: 0 additions & 2 deletions docs/FAQ.rst

This file was deleted.

4 changes: 4 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
=============
API
=============
Auto-harvested goodness, coming soon.
2 changes: 2 additions & 0 deletions docs/badges.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. this file is explicitly for the hyperlinkage in the base README.md to the badge image files
======
Badges
======

Expand Down
62 changes: 62 additions & 0 deletions docs/contributing_to_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.. last updated early Nov 2024.
could use some refinement
===========================
Documentation-Documentation
===========================

Welcome to ``fre-cli``'s Documentation-documentation- where we document how the documentation is
documented

How to Contribute to ``fre-cli``'s documentation
================================================



fork and poke at the settings
-----------------------------

* Fork ``fre-cli`` on github

* On github, navigate to your ``fre-cli`` fork, and click “settings”

* In “settings”, click “pages”

* In “pages”, under “build and deployment”, make sure “source” is set to “Deploy from a branch”

* Under that, find “Branch”, make sure the branch selected is ``gh-pages``

* The branch ``gh-pages`` is "automagic”- i.e. do not change anything about it nor create a new one,
nor interact with anything in that branch directly


enable workflows for your fork
------------------------------

note: this step may depend on user-specific settings!

* Back on top where you found “settings”, find and click “actions” to the left

* Enable running the workflow actions assoc with the ``fre-cli`` repo under ``.github/workflows``


run your fork's first workflow
------------------------------

* The documentation builds as the last steps to ``create_test_conda_env.yml`` when theres a push to ``main``

* To get your first workflow run on your fork, comment out the ``github.ref == ‘refs/heads/main’`` bit
so that it runs when you push to any branch, and make a small, trivial, commit somewhere to your
remote fork

* You should be able to find the deployed webpage from a successful workflow at
https://your_username.github.io/fre-cli (if you did not change the fork’s name from ``fre-cli``, that is)

* If you’re only editing docs, you can make the turn-around time on your workflow ~3 min faster by
commenting-out the ``pylint`` and ``pytest`` steps in ``create_test_conda_env.yml``, and disable running the
``build_conda.yml`` workflow



Other Helpful Things
====================
`restructured text cheat-sheet <https://gist.github.com/SMotaal/24006b13b354e6edad0c486749171a70#sections>`_
118 changes: 118 additions & 0 deletions docs/for-developers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
===============
For developers
===============

Developers are free to use the user guide above to familiarize with the CLI and save time from
having to install any dependencies, but development within a Conda environment is heavily
recommended regardless.

Gain access to the repository with ``git clone --recursive [email protected]:NOAA-GFDL/fre-cli.git`` or your fork's
link (recommended) and an SSH RSA key. Once inside the repository, developers can test local changes
by running a ``pip install .`` inside of the root directory to install the ``fre-cli`` package locally
with the newest local changes. Test as a normal user would use the CLI.


Adding New Tools
================


From Other Repositories
-----------------------

Currently, the solution to this task is to approach it using Conda packages. The tool that is being
added must reside within a repository that contains a ``meta.yaml`` that includes Conda dependencies
like the one in this repository and ideally a ``setup.py`` (may be subject to change due to deprecation)
that may include any potentially needed pip dependencies

* Once published as a Conda package, ideally on the `NOAA-GFDL conda channel <https://anaconda.org/NOAA-GFDL>`_,
an addition can be made to the ``run`` section under ``requirements`` in ``meta.yaml`` of the ``fre-cli``
following the syntax ``channel::package``

* On pushes to the main branch, the package located at https://anaconda.org/NOAA-GFDL/fre-cli will automatically
be updated using by the workflow defined in ``.github/workflows/publish_conda.yml``


Checklist
---------

For the new tool you are trying to develop, there are a few criteria to satisfy

1. Create a subdirectory for the tool group inside the ``fre/`` directory; i.e. ``fre/<tool>``

2. Add an ``__init__.py`` inside of ``fre/<tool>``

* typically this file should be empty, but it depends on the ``<tool>``'s needs
* even if empty, the file facillitates module importability and must be present

3. Add a file named ``fre/<tool>/fre<tool>.py``. This will serve as the main entry point for ``fre``
into the ``<tool>``'s functionality

4. Add a ``click`` group named after ``<tool>`` within ``fre/<tool>/fre<tool>.py``

* This ``click`` group will contain all the functionality under the ``<tool>``

5. Create separate files as needed for different commands; do not code out the full
implemetation of ``<tool>`` inside of a ``click`` command within ``fre/<tool>/fre<tool>.py``.

* better yet, consider what structure your tool may need in the future for maintainability's sake
* if you need, specify a ``<subtool>`` like ``fre/<tool>/<subtool>``. ``fre/app`` currently has
this structure

6. Be sure to import the contents of the needed subcommand scripts inside of ``fre<tool>.py``

* i.e. from ``fre.<tool>.toolCommandScript import *``

7. At this point, you can copy and paste the parts of your main ``click`` command from its script
into ``fre<tool>.py`` when implementing the function reflective of the command function

* Everything will remain the same; i.e. arguments, options, etc.

* However, this new function within ``fre<tool>.py`` must a new line after the arguments, options,
and other command components; ``@click.pass_context``

* Along with this, a new argument ``context`` must now be added to the parameters of the command
(preferably at the beginning, but it won't break it if it's not)

8. From here, all that needs to be added after defining the command with a name is
``context.forward(mainFunctionOfToolCommand)``, and done!

9. The last step is to replicate the command in the same way as done in ``fre<tool>.py``
inside of ``fre.py``, but make sure to add ``from fre import <tool>`` and
``from fre.<tool> import *``

Please refer to this issue when encountering naming issues:
`NOAA-GFDL#31 <https://github.com/NOAA-GFDL/fre-cli/issues/31>`_


Example ``fre/`` Directory Structure
------------------------------------

``fre/``
├── ``__init__.py``
├── ``fre.py``
├── ``fre<tool>``
│ ├── ``__init__.py``
│ ├── ``toolCommandScript.py``
│ └── ``fre<tool>.py``


``MANIFEST.in``
---------------

In the case where non-python files like templates, examples, and outputs are to be included in the ``fre-cli`` package,
``MANIFEST.in`` can provide the solution. Ensure that the file exists within the correct folder, and add a line to the
``MANIFEST.in`` file saying something like ``include fre/fre<tool>/fileName.fileExtension``

* For more efficiency, if there are multiple files of the same type needed, the ``MANIFEST.in`` addition can be something
like ``recursive-include fre/fre<tool> *.fileExtension`` which would recursively include every file matching that
``fileExtension`` within the specified directory and its respective subdirectories.


Adding Documentation
--------------------

see section "Documentation-Documentation"




Loading
Loading