-
Notifications
You must be signed in to change notification settings - Fork 25
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
Semantic & Syntactic Checking #59
Comments
From my perspective, this kind of argument checking should not be done in PICMI. Presumably the implementing code already does checking of the input it is getting. Implementing this in PICMI would only duplicate these checks. When developing the WarpX implementation, I have intentionally avoided adding such checks since I know that WarpX already has many checks of the input. Many checks are more complicated than the example you give and it becomes unwieldy to duplicate the checks (and error prone when the code changes and the checks need to be updated). |
This is correct to a certain degree, but I'd like to raise three points:
All this assumes that implementing PICMI is more than search-replacing the parameters in some input files -- for simple search-replace such thorough checking appears to be overkill. Put into different terms: I will include checks of the PICMI structure (at least on a shallow level) in the PIConGPU PICMI implementation, b/c it is the prime use-case for "fail fast". Are these beneficial upstream (here)? |
Here are my comments:
Overall, I would comment that PICMI is not a very large code and will likely be very stable. I think it will be much more maintainable to have any checks written out explicitly rather than introducing a new code architecture. |
Just my 2 cents: An implementation can then call the superclass checks and add their own. I see no reason why every implementation needs to implement the same checks again for things we already know in PICMI. This would make PICMI more useful. This allows us also to write correctness checks on general PICMI input files without invoking (or even installing) a code. This is very useful in my opinion, e.g., when adding inputs files to data archives and thinking about science gateways. We want to do such checks easy and lightweight (which the plain Also, adding such check interfaces automatically unifies how people implement input parameter checks downstream. That brings some order into implementations, too. Action items I would propose:
|
PICMI objects do not validate itself. I propose adding methods to each object along the lines of:
This method is mainly intended to ensure the integrity of an object, and could be called in the
__init__()
method automatically or (additionally) manually by an implementation/the user themselves.Such a check would guarantee a certain structure towards implementations and lift them of the burden of having to re-check the given python objects for errors.
The text was updated successfully, but these errors were encountered: