Closed jwarner8 closed 4 months ago
This is a good idea. We could probably say something like "If a function is used across more than one operator module it should be made common."
I wonder if it would be good to be _common.py
to file/metadata functions, and a separate _common_cubeutils.py
or something similar for computational/cube processing only?
Yeah, it would be nice to give a clear indication for what is intended for operators to use, and what is not. Both are not part of the public API, so we can move things after the fact if we need to.
What problem does your feature request solve?
Identifying the x/y coordinate name, and calculating the distance between two (lat,lon) tuples, is being used in quite a few operators. This is leading to increased repetition and may make code checks more burdensome as CSET grows. Some common used functions (not involving cubes) are stored in
_common.py
.Describe the solution you'd like
Would it be sensible to have something similar to
_common.py
to hold regularly used iris operations that are not already implemented as one-liners within the iris framework itself? The RMED toolbox had acube_utils.py
script which contained all of these.Describe alternatives you've considered
We could continue duplication of functions within each operator instead.