NOAA-GFDL / fre-cli

Python-based command line interface for FRE (FMS Runtime Environment) to compile and run FMS-based models and post-process their output.
GNU Lesser General Public License v3.0
3 stars 9 forks source link

generate-time-averages & some fre make organization #97

Closed bcc2761 closed 5 months ago

bcc2761 commented 5 months ago

Pretty much just copied over generate_time_averages and its tests, tweaking them to fit into fre-cli. May need to copy over some GitHub action files?

ceblanton commented 5 months ago

Thank you so much! This looks great.

Were you able to run the pytests?

ilaflott commented 5 months ago

Thank you so much! This looks great.

Were you able to run the pytests?

$] pytest -x ./tests/test_generate_time_averages.py
==================================================================================================================================== 1 failed, 14 passed, 2 warnings in 93.33s (0:01:33) =====================================================================================================================================

note that the one test "fails" because it's trying to show that cdo will not reproduce fre-nctools' timavg.csh, nor the in-house coded one. We should change the condition for success, but the code is running in the manner expected from what i can tell.

the two warnings come from the python bindings to cdo:

fre/app/tests/test_generate_time_averages.py::test_monthly_cdo_time_unwgt_avgs
  /home/Ian.Laflotte/conda/envs/freCli_PR97/lib/python3.9/site-packages/cdo/cdo.py:10: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import parse_version

fre/app/tests/test_generate_time_averages.py::test_monthly_cdo_time_unwgt_avgs
  /home/Ian.Laflotte/conda/envs/freCli_PR97/lib/python3.9/site-packages/pkg_resources/__init__.py:2825: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)