-
Notifications
You must be signed in to change notification settings - Fork 41
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
Replace print statements and verbose flag with logging and log levels #610
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adehecq @rhugonnet @duboise-cnes We reviewed it together with @vschaffn, what do you think of this first contribution?
Seems ok from my view of the xdem code. Maybe not useful to put the example from now and maybe not at this place ? As said before, the goal is to merge CNES/CS contributions into this branch-poc branch to aggregate contributions to xdem. @adehecq @rhugonnet feel free to propose other contribution way |
@vschaffn @adebardo This is great, thanks! 😄 Good initative for the example, and documentation page! I think your new documentation page (that is not listed in the For the example (not sure I'm commenting on the same commits), I agree with @duboise-cnes that it might not be the best spot, or maybe too generic. I could see it live well in the current "Basic" examples if re-structured into a Sphinx-Gallery format as the others, and calling a typical xDEM function (instead of In terms of the code modifications: It all looks great! I would add a note in the PR description about how you dealt with the interface between Happy with the organization of merging to |
Thank you for your feedback, @duboise-cnes and @rhugonnet .
|
ac9d0f1
to
3fe0932
Compare
@rhugonnet @duboise-cnes I have taken your feedbacks into account:
|
Replace
print
statements withlogging
Resolves #565
Summary
This pull request addresses the transition from using
print()
statements to the Pythonlogging
module. The update improves flexibility for managing output messages.Changes made:
print
with appropriate logging levels (debug
,info
,warning
,error
)verbose
flag in favor of log levelsf-strings
with%
formatting in logging statements to comply withpylint
requirementsNote on
tdqm
andlogging
integration inxdem.correg.affine.py
Since
tdqm
directly manages output to the console, mixing its output with standard logging (especially at lower verbosity levels) can lead to overlapping or garbled output.To addess this, I ensured that:
pbar
(fromtdqm.trange
) is conditionnally displayed depending on the current logging level. When the logging level is set toINFO
or higher, the progress bar is visible.pbar.write()
is used for logging messages within the loop, after checking the logging level.Documentation
Updated the documentation to include instructions on how users can configure logging verbosity.
Example
Added an example showing how a users can use and configure logging