-
Notifications
You must be signed in to change notification settings - Fork 142
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
Better control of warnings for users #1600
Comments
I'd be able to take this one on, motivated by my recent experiences with the Currently, the warnings in Parcels are implemented through the logging library. I was curious if there is any interest in transitioning to using the warnings library. This has several advantages, in my opinion:
The reason I wanted to check first is that there is one thing that could be seen as a negative if this is implemented, depending on the goals of the existing logger implementation. The default behavior of the warning library is to only show warnings once, so for the case of the empty I think this could be mitigated with an example in the tutorials showing how to use the warnings context manager if you desire old behavior (e.g., |
Thanks for the input here @andrew-s28 ! I agree that using the warnings package is a good direction forward, both from a users pov. as well as aligning ourselves with other project. I was just looking through the codebase, alot of the warnings are |
Thanks for your willingness to pick this up, @andrew-s28! I agree with @VeckoTheGecko that your strategy makes sense; so please go ahead and propose some changes. Note that it doesn't need to be a fully functional PR; even a start would already be great. We're here to help :-) |
@andrew-s28 just a note we've installed formatting across the codebase in the last couple days (#1655). I recommend merging with latest master soon to help minimise conflicts |
Thanks for the heads up @VeckoTheGecko. Just synced my fork, so should be good to go! I'll keep an eye on it going forward, since it seems there's lots of great developments happening quickly. PS thank you and @erikvansebille for all the work that is going into the project. I found the new projects tab really helpful for seeing where I could contribute (and the overall direction of the package development), so I think it is working well. |
Related to this is the parameter
|
@VeckoTheGecko sounds good. I should have a draft PR ready in the next couple of days, since I am assuming there will be some feedback in how I structure the new warnings classes and we can discuss from there. |
The warnings/logger implementation in parcels is a bit clunky; it would be nice to refactor this with a more advanced(?) library. It would especially be nice if users could control which messages they turn on and off.
For example, for some cases where it is expected that particle sets are empty for some time during the simulation, users may want to silence the
ParticleSet is empty on writing as array at time XXXX
warningThe text was updated successfully, but these errors were encountered: