Create external scripts to break up lib/plotting_functions into organized helper methods#420
Conversation
nusbaume
left a comment
There was a problem hiding this comment.
Thanks for the great cleanup @justin-richling! I have some change requests, but hopefully they will all be easy to handle (it is mostly about commented-out lines of code).
|
Hi @nusbaume, it looks like almost all of these requested changes are resolved; I had some erroneous code that got committed in to this branch. My apologies for the extra work, but could you double check the |
nusbaume
left a comment
There was a problem hiding this comment.
Thanks for removing the erroneous code @justin-richling! I believe that has resolved all of my concerns except for the one request related to amwg_table.py. Once that is resolved this PR will be good to go (at least for me)!
nusbaume
left a comment
There was a problem hiding this comment.
Everything looks great to me now. Thanks again!
This PR will organize helper methods that currently live in
lib/plotting_functions.pywith the intent of bringing any ADF-wide utilities (non plotting related) to an external scriptlib/adf_untils.pyso methods such as validating dimensions likezm_validate_dims, or averaging schemes likeseasonal_mean, or any other non-plotting helpers likemask_land_or_ocean, etc would now fall under this script.A second external script
lib/plotting_utils.pyis created for helper methods related to plotting such asprep_contour_plotandget_central_longitude, etc. This script would be called inplotting_functions.pyso thatplotting_functions.pycan be specific to only plotting schemes for diagnostic plotting scripts.Breaking these methods up into external scripts will not only organize helper functions better, but it will eliminate roughly 1000 lines from
plotting_functions.py, specifically ones that are not related to plotting.Additionally, this PR will create a warnings function in
lib/adf_utils.pythat is defined in most scripts currently so it can be centralized and called in scripts via
adf_utils:I'm open to also making a plotting directory in
libto organize plotting scripts since we will probably want to extend color maps to NCL soon thanks to the work of @brianpm