-
Notifications
You must be signed in to change notification settings - Fork 281
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
Constrained load on MeshCoord bypasses callback #5939
Comments
I think the problem here is really the logic of what callbacks are for + what order they happen in. |
So does this mean that using a callback to validate the data being loaded is a bad idea? Rather than "validate during load", should we doing an approach of "load then validate"? |
Well I guess it depends what you're trying to achieve. So maybe it isn't really appropriate for this purpose. |
For our work on UG-ANTS, we want to validate that people are loading cubes with meshes for the applications that should be working with UGrid data, and that there is no mesh for applications that should be working with regular grid data. I'd like the validation to be on load or at worst immediately after load: it gives us a chance to give a clear error message (a message saying "loading wrong type of data" is more useful than a message saying "tried to access a mesh but couldn't find it" - the first is definitely a load problem; the second could be a problem in subsequent processing), and it gives the error message before any expensive or time consuming processing has occurred. A callback seemed a good way to ensure the load and the validation were "simultaneous" (I think it may have been yourself that suggested a callback?), but it's starting to look like the combination of callback and constraint is cryptic enough that we may want to go "load then validate" rather than "validate during load". |
This has been worked on, but should remain open until #6014 can be implemented. |
🐛 Bug Report
When applying a constraint on a
MeshCoord
and a callback which checks the loaded cube has a mesh, the callback is not applied on the returned cube.How To Reproduce
Steps to reproduce the behaviour:
MeshCoord
) and pass the custom callback.MeshCoord
s have been converted toAuxCoord
s as expected, but no exception was raised.Expected behaviour
I expected an exception to have been raised by the custom callback function, since the returned cube has no mesh.
Reproducible example
Output:
Environment
The text was updated successfully, but these errors were encountered: