Quick question on iris.load callback and constraints #4185
Answered
by
pp-mo
larsbarring
asked this question in
Q&A
-
If I am loading a netcdf file using both a callback function and a constraint, which is done first? |
Beta Was this translation helpful? Give feedback.
Answered by
pp-mo
Jun 8, 2021
Replies: 1 comment 5 replies
-
Just spent 5mins looking through the Iris source and I'm pretty sure it's constraints first, then callbacks. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, I just spent 20 minutes chasing this, and I think constraints come afterwards ...
The callback is invoked within the low-level loader (e.g. here, or here), but the constraints are mostly used by the "_CubeFilterCollection.from_cubes" call in iris._load_collection,
This underlies the various iris.load_xxx functions, but it works on "raw cubes" delivered by the loader.
I say "mostly", because the constraints are passed down to the low-level loaders.
But I think that is only so that "special cases" can be interpreted, to filter file data and speed up loading, notably, here, but see also recent #4176.
But those are, by definition, "exceptional" cases.
Whatever, this is an amazingly…