Skip to content
Merged
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
dd48ab1
Start for climo wrapper (fre app gen-time-averages-wrapper)
Jun 6, 2025
9c2e202
Merge remote-tracking branch 'origin/main' into add-climo-wrapper
Jul 10, 2025
f74645d
Updated click parsing for fre app gen-time-averages-wrapper
Jul 11, 2025
c7c7f1d
Add the wrapper.py this time
Jul 11, 2025
8886a26
Convert pathlib objects to strings during cdo call creation
Aug 11, 2025
dfa40e5
Needed updates to climo wrapper
Aug 11, 2025
dd06814
Start of climo wrapper test
Aug 11, 2025
c4825a1
Generate netcdf test input files from ascii CDF files
Aug 12, 2025
5467c55
simplify directory setup
Aug 12, 2025
3b29798
Completed test for monthly history to annual climo
Aug 12, 2025
e7f4367
type adjustments
Aug 12, 2025
542a0f3
add annual-av-from-annual-history test
Aug 12, 2025
e0a230d
fix typo
Aug 12, 2025
6a081be
Fix output filename for monthly climatologies
Aug 13, 2025
fc5ce14
Save monthly output in the same user-specified directory
Aug 13, 2025
fa2d0df
Added monthly climo from monthly timeseries test
Aug 13, 2025
691418f
add fre app combine-time-averages
Aug 20, 2025
7e3172a
docstrings for fre app gen-time-averages-wrapper
Aug 20, 2025
a5a9afc
finished the climo combiner
Aug 20, 2025
b34b538
add docstrings for fre app combine-timeavgs
Aug 20, 2025
4ee12af
remove do_timeavgs pp yaml switch (now controlled in 'climatology' se…
Aug 25, 2025
7773a83
Added test for combining annual climatologies
Aug 25, 2025
7e3bca6
fre app combine-time-averages good to go
Aug 25, 2025
5318365
Add chdir to return to original working directory
Aug 26, 2025
6fce01e
Add test for monthly average combining
Aug 26, 2025
868f02a
Remove test files erroneously included in the repository.
Sep 9, 2025
7126721
Python f-strings are the superior method for string concatenation
Sep 9, 2025
892cd67
Simplify imports for metomi date parsers
Sep 9, 2025
22d193e
Merge remote-tracking branch 'origin/main' into add-climo-wrapper
Sep 9, 2025
dab3775
Move poorly-formatted filepaths out of doc-strings
Sep 12, 2025
2f00fff
Fixed docstrings
Sep 15, 2025
e0c9dd5
Add docstrings for exceptions
Sep 15, 2025
3fd53f5
Cleaned up imports in pytests
Sep 15, 2025
c592969
Merge remote-tracking branch 'origin/main' into add-climo-wrapper
Sep 15, 2025
1c60dbd
add combine.py module to fre.app.generate_time_averages module
Sep 15, 2025
d785566
Removed do_timeavgs switch from test yamls
Sep 15, 2025
3bc0e87
clean up fre/app/freapp.py
Sep 15, 2025
7f629bf
Update fre-cli click tests to look for exit 0 when running non-error …
Sep 15, 2025
8bbd1e8
one more removal of do_timeavgs option from example yamls
Sep 15, 2025
9508f4b
Set 'fre pp generate-time-averages-wrapper' tests to xfail
Sep 15, 2025
a310e5b
fre app combine-time-averages begin and end should be integars not st…
Sep 16, 2025
f79da97
remap bugfix
Sep 16, 2025
a188316
remap bugfix- string boolean is odd
Sep 17, 2025
1154893
Revert "Update fre-cli click tests to look for exit 0 when running no…
Sep 17, 2025
d4ffcd3
Replace string to boolean conversion with a click option
Sep 18, 2025
0b2f833
Merge branch 'main' into add-climo-wrapper
ilaflott Sep 22, 2025
93937b2
Initial plan
Copilot Sep 22, 2025
1359293
Fix remap_pp_components file naming issue causing test failures
Copilot Sep 22, 2025
49fa0a6
Enable workflow to run for this specific PR branch
Copilot Sep 22, 2025
dd10e4b
Add pkg parameter to generate time averages wrapper and CDO tests
Copilot Sep 22, 2025
76cbf57
Fix Path vs string typing issues and timavg.csh availability check in…
Copilot Sep 23, 2025
632a372
Fix CDO monthly test expectations and mark timavg.csh tests as xfail
Copilot Sep 23, 2025
b0fc58d
print --> logging
ilaflott Sep 23, 2025
04f0b0d
more specific error message
ilaflott Sep 23, 2025
6ce3dfe
print --> logging
ilaflott Sep 23, 2025
709deb6
better output handling, reduce annoying and useless locals output
ilaflott Sep 23, 2025
c504126
remove worthless output printing thats redundant with logging functio…
ilaflott Sep 23, 2025
c54cc7f
break up a long line
ilaflott Sep 23, 2025
fd7f999
clean up and proper TODO
ilaflott Sep 23, 2025
142513d
clarify tests
ilaflott Sep 23, 2025
129d2dc
reduce input test data files to minimum, to help with debugging by-ey…
ilaflott Sep 23, 2025
7b0bb2b
use unweighted stats for averaging
ilaflott Sep 23, 2025
8a9dbb0
Merge pull request #655 from NOAA-GFDL/copilot/fix-8ed54e3a-c382-4fe1…
ilaflott Sep 23, 2025
4cf6da6
Change pytest log level from INFO to DEBUG
ilaflott Sep 23, 2025
423699d
Merge branch 'main' into add-climo-wrapper
ilaflott Sep 24, 2025
c9eae1d
Adjust cdoTimeAverage to save out per-month files like fre-nctools ti…
Sep 26, 2025
bc52ad8
fre app gen-time-averages-wrapper to use cdo backend for now
Sep 26, 2025
3a183fc
remove xfails from climo tests
Sep 26, 2025
d00329b
Merge branch 'add-climo-wrapper-chris' into add-climo-wrapper
Sep 26, 2025
6cf201b
disable timavg.csh test
Sep 27, 2025
b5c9dcf
updated cdo climo test
Sep 27, 2025
a63a058
disable fre-nctools tests
Sep 27, 2025
58d08f9
adjust cdo climo monthly tests
Sep 27, 2025
ff659f7
Merge branch 'main' into add-climo-wrapper
ilaflott Oct 2, 2025
926ae4c
Add branches filter for pull request in spell check
ilaflott Oct 2, 2025
7f5fe52
Remove branch filter for copilot and update pylint failure threshold …
ilaflott Oct 3, 2025
4006b4e
for github codespace
ilaflott Oct 3, 2025
65c2905
Refactor combine function to use context manager for directory change…
ilaflott Oct 3, 2025
b3db6c4
move mask atmos plevel tests
ilaflott Oct 3, 2025
20c3c67
tweak reqs and alphabetize dep/req lists. remove host requirements an…
ilaflott Oct 3, 2025
9b1cf2e
pin cftime to 1.6 something
ilaflott Oct 3, 2025
b347735
remove jinja template pointing to... a host installed python, i think?
ilaflott Oct 3, 2025
2ae2dee
ok fine random jinja variable definitions for PYTHON it is...
ilaflott Oct 3, 2025
39b521c
curious experiment: test reqs for pytest pytest-cov and pylint, what …
ilaflott Oct 3, 2025
edb5f17
tweak pyproject
ilaflott Oct 3, 2025
137f2b1
not clear why pylint cant be found at the testing step
ilaflott Oct 3, 2025
fc88604
is it a slight race condition? is the test step executing slightly be…
ilaflott Oct 3, 2025
bb4c298
stop installing a non-existent conda-forge::conda-verify
ilaflott Oct 3, 2025
3934af0
OH the test key under requirements doesnt exist. testing reqs go unde…
ilaflott Oct 3, 2025
e722c91
heavily update test_generate_time_averages
ilaflott Oct 7, 2025
1d93dd5
init for mask_atmost_plevel tests
ilaflott Oct 7, 2025
29ffd69
update the other bits too
ilaflott Oct 7, 2025
013088b
readability edits, remove a redundant test case or two, condtional xs…
ilaflott Oct 7, 2025
95bae4f
some module import changes, comment out a case i prefer xfail, but se…
ilaflott Oct 7, 2025
f6b221c
increase clarity of testing constant file names. try weird shutil,whi…
ilaflott Oct 7, 2025
65d4a62
actually add the timeaverager edit this time
ilaflott Oct 7, 2025
8886291
verbose flag to timavg.csh, and comment out the fre-nctools calls, si…
ilaflott Oct 7, 2025
4b405e4
explicitly list packages and their versions from the environment. als…
ilaflott Oct 8, 2025
be974fc
remove a bad assertion i used for local debugging, aadd some extra c…
ilaflott Oct 8, 2025
9d58b14
omg environment please just solve
ilaflott Oct 8, 2025
86e5a63
why is this happening to me
ilaflott Oct 8, 2025
d153832
Update numpy and xarray version constraints
ilaflott Oct 8, 2025
9d65240
Remove netcdf4 from environment.yml
ilaflott Oct 8, 2025
e0fe628
Update meta.yaml
ilaflott Oct 8, 2025
e3d61c2
Update dependencies and Python version in meta.yaml
ilaflott Oct 8, 2025
b76136a
Modify environment.yml for dependency updates
ilaflott Oct 8, 2025
beab0a8
more explicitly configure conda in create_test_conda_env workflow, re…
ilaflott Oct 8, 2025
04adfbe
conda build has a debug flag, not a verbose flag
ilaflott Oct 8, 2025
1fd9686
ok now remove pylint pytest-cov and pytest from the environment yaml …
ilaflott Oct 8, 2025
5ff7586
remove pip as a dep, its a std module of python for awhile now. remov…
ilaflott Oct 8, 2025
fa1070f
another attempt at env resolution, mark a comparison test xfail
ilaflott Oct 8, 2025
2d2840f
xfail the right test
ilaflott Oct 8, 2025
e4b8066
conda update conda in workflows, change channel order as it affects e…
ilaflott Oct 9, 2025
dc16413
make conda confguration very explcit, show config before final calls,…
ilaflott Oct 9, 2025
9a04a13
make conda confguration very explcit, show config before final calls,…
ilaflott Oct 9, 2025
e0f754e
Merge remote-tracking branch 'origin/add-climo-wrapper' into add-clim…
ilaflott Oct 9, 2025
b2f6ac0
fine, lets try a conda init
ilaflott Oct 9, 2025
2472d3d
try normal conda-verify and anaconda-client. also directly source /pa…
ilaflott Oct 9, 2025
16ff1f1
forget the root/bashrc sourcing. add some extra steps
ilaflott Oct 9, 2025
cc18f08
move the conda sourcing and conda init to where the env activation is
ilaflott Oct 9, 2025
9e509f8
newer condabuilds seem unhappy with a None version specifier in the m…
ilaflott Oct 9, 2025
87dee76
syntax error...
ilaflott Oct 9, 2025
a751f29
missing parenthesis in meta yaml. activate the fre-cli environment ex…
ilaflott Oct 9, 2025
c779ae6
remove now unused and always-not-working load_setup_py_data from meta…
ilaflott Oct 9, 2025
2ea1a62
better echos, line spacing, workflow file formatting, propagate the c…
ilaflott Oct 9, 2025
30a024d
ok so the options key is not negotiable, i understand
ilaflott Oct 9, 2025
8280676
pylint feedback, env tweak, put the testing stuff back where it was, …
ilaflott Oct 10, 2025
2d97382
increase num of allowed positional args to 6 from 5, inch up the thre…
ilaflott Oct 10, 2025
a752650
break up a long line and implement way of avoiding redefining a pytho…
ilaflott Oct 10, 2025
2440bcc
largely pylint feedback, and some review feedback
ilaflott Oct 10, 2025
fb1ddd6
update cdoTimeAverager according to some feedbacl
ilaflott Oct 10, 2025
958cf45
better comments for workflow files
ilaflott Oct 10, 2025
008cf24
some review feedback
ilaflott Oct 10, 2025
cc42140
fixing a bug i introduced
ilaflott Oct 10, 2025
2a962f6
pylintrc file for explicit pylint call configuration. add new --rcfil…
ilaflott Oct 10, 2025
0c07ebc
remove time use from click entrypoint file and put with generate_time…
ilaflott Oct 10, 2025
1211192
add some TODO items now, dont be shy! pylint wont ding you for trying…
ilaflott Oct 10, 2025
7f650b6
spacing mostly to address feedback
ilaflott Oct 10, 2025
4010ce3
fix an oops in the workflow file
ilaflott Oct 10, 2025
ed18d34
spacing / review fedback
ilaflott Oct 10, 2025
0e0b752
removed unreachable else statement, since the error condition is chec…
ilaflott Oct 10, 2025
7dd313c
clean up how the value error for an unsupported frequency gets raised…
ilaflott Oct 14, 2025
4bdcff9
touch up when/how value error is raised in generate_time_Averages, ad…
ilaflott Oct 14, 2025
6117d24
last tweaks and last env experiment, let cmor be >=3.11
ilaflott Oct 14, 2025
dbef853
remove unneeded file
ilaflott Oct 14, 2025
5dabfd0
prototype CLI tests for the time-averager, printouts for the non-cli …
ilaflott Oct 15, 2025
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
39 changes: 27 additions & 12 deletions .github/workflows/build_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,51 @@ concurrency:
cancel-in-progress: true

jobs:
build:
condabuild:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24_gcc14_v2
steps:
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Run Conda to Build
- name: Configure Conda
run: |
# append the reqd channels
echo "removing defaults, appending reqd channels"
conda config --append channels conda-forge
conda config --append channels noaa-gfdl

# remove any default channels
conda config --remove channels defaults

# just in case
conda config --show channels
echo "setting strict channel priority"
conda config --set channel_priority strict

echo "setting anaconda_upload to no"
conda config --set anaconda_upload no

# install conda-build and conda-verify
conda install conda-build conda-verify
echo "printing conda config just in case"
conda config --show

- name: Update Conda and Conda Package Indices
run: |
echo "updating conda and package channel indices for conda-forge, noaa-gfdl"
conda update -y conda
conda update -y --all --override-channels -c conda-forge
conda update -y --all --override-channels -c noaa-gfdl

# conda build
- name: Conda install conda-build
run: |
echo "conda install conda-build"
conda install conda-forge::conda-build

- name: Build fre-cli Conda Package
run: |
echo "conda building fre-cli package and outputting as a tarball"
mkdir -p /app/fre-cli-tarball
conda build --package-format tar.bz2 --output-folder /app/fre-cli-tarball .

- name: Upload fre-cli tarball
- name: Upload fre-cli Tarball
uses: actions/upload-artifact@v4
with:
name: fre-cli-tarball
Expand Down
103 changes: 85 additions & 18 deletions .github/workflows/create_test_conda_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
cancel-in-progress: true

jobs:
build-linux:
condaenvcreate:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24_gcc14_v2
Expand All @@ -24,36 +24,103 @@ jobs:
with:
submodules: 'recursive'

- name: Create fre-cli environment
- name: Configure Conda
run: |
# create env holding all deps, the env cant be explicitly activated in CI/CD
conda env create -f environment.yml --name fre-cli
echo "removing defaults, appending reqd channels"
conda config --append channels conda-forge
conda config --append channels noaa-gfdl
conda config --remove channels defaults

# sets CONDA to wherever it may be on the image
source /root/.bashrc
echo "setting strict channel priority"
conda config --set channel_priority strict

# add conda env's executables and mkmf to github's PATH equiv.
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH
echo "printing conda config just in case"
conda config --show

# use *conda environment's pip* to install fre-cli, called w/ full path as module for explicitness
$CONDA/envs/fre-cli/bin/python -m pip install --prefix $CONDA/envs/fre-cli .
- name: Update Conda and Channel Package Indices
run: |
echo "updating conda and package channel indices for conda-forge, noaa-gfdl"
conda update -y conda
conda update -y --all --override-channels -c conda-forge
conda update -y --all --override-channels -c noaa-gfdl

- name: Create fre-cli Environment
run: |
echo "creating fre-cli env holding all deps"
conda env create -y -f environment.yml --name fre-cli

- name: Run pytest in fre-cli environment
- name: Activate fre-cli Environment and Install fre-cli
run: |
# add spack installed binaries to front of path so that conda's netcdf/hdf5 installs don't break compilation tests
echo "sourcing /some/path/to/conda/etc/profile.d/conda.sh"
source /opt/software/linux-rocky9-zen2/gcc-11.4.1/miniconda3-24.7.1-akg5caxhoqv3oasili3pgukbyryceq74/etc/profile.d/conda.sh

echo "conda initializing"
conda init

echo "listing packages installed in the fre-cli environment"
conda env list
conda list -n fre-cli

echo "activating the fre-cli environment"
conda activate fre-cli

echo "pip installing fre-cli into the environment"
python -m pip install .

echo "listing packages installed again after pip installing fre-cli"
conda list -n fre-cli
which fre

- name: Install pytest, pylint, and pytest-cov into fre-cli Env
run: |
echo "sourcing /some/path/to/conda/etc/profile.d/conda.sh"
source /opt/software/linux-rocky9-zen2/gcc-11.4.1/miniconda3-24.7.1-akg5caxhoqv3oasili3pgukbyryceq74/etc/profile.d/conda.sh

echo "conda initializing"
conda init

echo "activating the fre-cli environment"
conda activate fre-cli

echo "conda install testing-reqs"
conda install conda-forge::pytest conda-forge::pylint conda-forge::pytest-cov

- name: Run pytest In fre-cli Env
run: |
echo "sourcing /some/path/to/conda/etc/profile.d/conda.sh"
source /opt/software/linux-rocky9-zen2/gcc-11.4.1/miniconda3-24.7.1-akg5caxhoqv3oasili3pgukbyryceq74/etc/profile.d/conda.sh

echo "conda initializing"
conda init

echo "activating the fre-cli environment"
conda activate fre-cli

echo "adding spack installed binaries of netcdf/hdf5 to front of path, so conda installed ones don't break compilation tests"
export path_save=$PATH
export PATH="/opt/views/view/bin:$PATH"
echo $PATH

# run pytest
pytest --durations=20 --log-level INFO --cov-report=xml --cov-config=coveragerc --cov=fre fre/
echo "running pytest, will print 20 longest durations"
pytest --durations=20 --log-level DEBUG --cov-report=xml --cov-config=coveragerc --cov=fre fre/

# restore original path and install genbadge to generate coverage badge based on xml
echo "restoring original PATH"
export PATH="$path_save"
echo $PATH

- name: Run pylint in fre-cli environment
- name: Run pylint On fre/ In fre-cli Env
run: |
# run pylint, ignored modules avoid warnings arising from code internal to those modules
pylint --fail-under 7.10 --max-line-length 120 --max-args 6 -ry --ignored-modules netCDF4,cmor fre/
echo "sourcing /some/path/to/conda/etc/profile.d/conda.sh"
source /opt/software/linux-rocky9-zen2/gcc-11.4.1/miniconda3-24.7.1-akg5caxhoqv3oasili3pgukbyryceq74/etc/profile.d/conda.sh

echo "conda initializing"
conda init

echo "activating the fre-cli environment"
conda activate fre-cli

echo "running pylint on fre"
pylint --fail-under 7.30 --max-line-length 120 --max-args 6 -ry --ignored-modules netCDF4,cmor fre/

- name: Upload results to Codecov
uses: codecov/codecov-action@v5
Expand Down
41 changes: 35 additions & 6 deletions .github/workflows/publish_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,53 @@ on:
push:
branches:
- main






jobs:
publish:
condapublish:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24_gcc14_v2
steps:
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Run Conda to Build and Publish
- name: Configure Conda
run: |
echo "removing defaults, appending reqd channels"
conda config --append channels conda-forge
conda config --append channels noaa-gfdl
conda config --remove channels defaults
conda config --show channels
conda install conda-build anaconda-client conda-verify
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}

echo "setting strict channel priority"
conda config --set channel_priority strict

echo "setting anaconda_upload to yes"
conda config --set anaconda_upload yes

echo "printing conda config just in case"
conda config --show

- name: Update Conda and Conda Package Indices
run: |
echo "updating conda and package channel indices for conda-forge, noaa-gfdl"
conda update -y conda
conda update -y --all --override-channels -c conda-forge
conda update -y --all --override-channels -c noaa-gfdl

- name: Conda install conda-build
run: |
echo "conda install conda-build"
conda install conda-forge::conda-build

- name: Build fre-cli Conda Package
run: |
echo "conda building fre-cli package and outputting as a tarball"
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
conda build .
4 changes: 4 additions & 0 deletions .github/workflows/spell_check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: 'Check spelling'
on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
spellcheck:
Expand Down
24 changes: 10 additions & 14 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,21 @@ channels:
- noaa-gfdl
dependencies:
- python=3.11.*
- pip
- noaa-gfdl::analysis_scripts
- noaa-gfdl::catalogbuilder>=2.0.2
- noaa-gfdl::fre-nctools
- noaa-gfdl::analysis_scripts==0.0.1
- noaa-gfdl::catalogbuilder==2.0.3
- noaa-gfdl::fre-nctools==2022.02.01
- conda-forge::cdo>=2
- conda-forge::cftime
- conda-forge::click>=8.2
- conda-forge::cylc-flow>=8.2.0
- conda-forge::cmor=3.11.*
- conda-forge::cylc-flow>=8.2
- conda-forge::cylc-rose
- conda-forge::cmor>=3.11.0
- conda-forge::cdo>=2.0.0
- conda-forge::jinja2=3.0.*
- conda-forge::jinja2>=3
- conda-forge::jsonschema
- conda-forge::metomi-rose
- conda-forge::nccmp
- conda-forge::numpy<2
- conda-forge::pylint
- conda-forge::pytest
- conda-forge::pytest-cov
- conda-forge::numpy=1.26.*
- conda-forge::python-cdo
- conda-forge::pyyaml
- conda-forge::xarray
- conda-forge::netcdf4
- conda-forge::xarray>=2024.*
- conda-forge::netcdf4=1.7.*
78 changes: 78 additions & 0 deletions fre/app/freapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

from .mask_atmos_plevel.mask_atmos_plevel import mask_atmos_plevel_subtool
from .generate_time_averages.generate_time_averages import generate
from .generate_time_averages.wrapper import generate_wrapper
from .regrid_xy.regrid_xy import regrid_xy
from .generate_time_averages.combine import combine
from .remap_pp_components.remap_pp_components import remap_pp_components

@click.group(help=click.style(" - app subcommands", fg=(250,154,90)))
Expand Down Expand Up @@ -158,3 +160,79 @@
start_time = time.perf_counter()
generate(inf, outf, pkg, var, unwgt, avg_type)
click.echo(f'Finished in total time {round(time.perf_counter() - start_time , 2)} second(s)')

@app_cli.command()
@click.option("--cycle-point",
type = str,
required = True,
help = "Beginning cycle-point in ISO8601")
@click.option("--dir",
type = str,
required = True,
help = "Root directory containing the shards")
@click.option("--sources",
type = str,
required = True,
help = "Sources (history file) input file, comma-separated")
@click.option("--output-interval",
type = str,
required = True,
help = "ISO interval of the desired climatology")
@click.option("--input-interval",
type = str,
required = True,
help = "ISO interval of the input timeseries")
@click.option("--grid",
type = str,
required = True,
help = "Grid label corresponding to the shards directory (e.g. 'native' and 'regrid-xy/180_288.conserve_order2'")
@click.option("--frequency",
type = str,
required = True,
help = "Frequency of desired climatology: 'mon' or 'yr'")
@click.option("-p", "--pkg",
type = click.Choice(["cdo","fre-nctools","fre-python-tools"]),
default = "cdo",
help = "Time average approach")
def gen_time_averages_wrapper(cycle_point, dir, sources, output_interval, input_interval, grid, frequency, pkg):
"""
Wrapper for climatology tool.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better description needed

Timeaverages all variables for a desired cycle point, source, and grid.

Check warning on line 200 in fre/app/freapp.py

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Timeaverages)
"""
sources_list = sources.split(',')
generate_wrapper(cycle_point, dir, sources_list, output_interval, input_interval, grid, frequency, pkg)

@app_cli.command()
@click.option("--in-dir",
type = str,
required = True,
help = "Input directory")
@click.option("--out-dir",
type = str,
required = True,
help = "Output directory")
@click.option("--component",
type = str,
required = True,
help = "Component name to combine")
@click.option("--begin",
type = int,
required = True,
help = "Beginning year")
@click.option("--end",
type = int,
required = True,
help = "Ending year")
@click.option("--frequency",
type = str,
required = True,
help = "Climatology frequency; 'mon' or 'yr'")
@click.option("--interval",
type = str,
required = True,
help = "Climatology interval in ISO8601")
def combine_time_averages(in_dir, out_dir, component, begin, end, frequency, interval):
"""
Combine per-variable climatologies into one file
"""
combine(in_dir, out_dir, component, begin, end, frequency, interval)
2 changes: 1 addition & 1 deletion fre/app/generate_time_averages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'''required for generate_time_averages module import functionality'''
__all__ = ['generate_time_averages', 'timeAverager',
__all__ = ['generate_time_averages', 'timeAverager', 'wrapper', 'combine',
'frenctoolsTimeAverager', 'cdoTimeAverager', 'frepytoolsTimeAverager']
Loading
Loading