-
Notifications
You must be signed in to change notification settings - Fork 11
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
Initial CMOR pytest examples #172
Conversation
change string formation from algebraic approach to f-strings break up some dense function calls remove globals adjust input arguments to permit global removal lots of snake_case adjustments
…der is not yet a pip package
add mysterious unused ierr var TODO item. add in helpful printouts and whitespace for readability. change most print statements w/ variable objects, exceptions, and path-formations to be driven by f-strings add in a second-class entry point for direct module import of cmor run tool for programmatic usage and testing, such that the click entry point functions the way it is. add in test for testing imported-module functionality of fre_cmor_run instead of just click-based cli-driven usage remove unneeded click directives for using cmor_mixer.py directly as an executable script. change order of defined functions such that it reflects the hierarchy of the scripts design change function name "var2process" to something more understandable "gfdl_to_pcmdi_var"
realizing part of the dir structure is a YYYYMMDD datetime string no return --> what to assert ... nccmp weird via tests but maybe i dont have the dir right so im gonna try a fresh clone to tidy that up _cmor_run_subtool argument order switch identified section in cmor_mixer with my favorite gfdl'ism - (seemingly) senseless filemovent logic! changed some opaque variable names in cmor_mixer var_i --> gfdl_var _tbl_ --> _table_ fl --> file nm --> name etc.
…assing nicely now these tests wont pass on the pipeline unforutnately... dependence on cmip6-data-tables ... dependence on a netcdf file that has megabytes assoc with it ... dont want to blow up repo size... can we do an ncgen + cdl for the metadata?
…note down of where it comes frmo add in a gitignore line ignoring other contents of that clone repository directory
tempted to just add 15MB of test file to the repo for FOREVER just because i wanna see a green circle
…e some pylint output to look at even if the tests fail
…r run subtool test. now does a git clone for the relevant cmip6 cmor table
…honGit as pip-package dependency... would be better to do this as a testing dependency specifically but nevermind that for now...
gitpython dependency in meta.yaml now encoded via the build script... not my favorite but it should work removed gitpython pip mod dependency in meta.yaml... it does not work that way. added in conda-forge::git as dependency for conda package / environment metadata
make it a quick command before claling pytest under commands: section/key
tests/build passing etc.. still some clean up to do here and there but overall ready to review @Ciheim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did a little self-review to help organize my clean up efforts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bodies i see here:
- L36, why is
CMIP6
in the directory structure twice? - L38-L39, why is
fre
tacked on to the end of{OUTDIR}
and before/{CMOR_CREATES_DIR}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, the full output directory structure has a pattern reflected by a field/variable at the bottom of fre/tests/test_files/CMOR_input_example.json
... this should be checked explicitly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ciheim @ceblanton this is not fun but i know we want to get this test in and running so other devs can start working with the tool.
fre/tests/test_files/ocean_sos_var_file/ocean_monthly_1x1deg.199301-199712.sos.nc
Show resolved
Hide resolved
swap which function click is looking for: `_cmor_run_subtool` v `cmor_run_subtool`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm happy.
Describe your changes
Issue ticket number and link (if applicable)
Checklist before requesting a review