Skip to content
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

remove print() statements and fix logging usage #229

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ManuelHu
Copy link
Contributor

@ManuelHu ManuelHu commented Jan 30, 2025

  • add inline # noqa: T201 comments for intended print() usage
  • use properly module-scoped logger naming to avoid spamming the root logger
  • replace all other print() statements either with logging statements, or remove them
  • lower the log level from INFO to DEBUG in a lot of cases

there are some parts that have not been converted. Those are listed in pyproject.toml:

"src/pyg4ometry/gui/**" = ["T201"]
"src/pyg4ometry/{fluka,convert}/**" = ["T201"]
"src/pyg4ometry/{io,analysis,features}/**" = ["T201"]
"src/pyg4ometry/{freecad,pycgal,pyoce}/**" = ["T201"]
"src/pyg4ometry/visualisation/{UsdViewer,ViewerHierarchyBase}.py" = ["T201"]

Those are either "unfinished"(?) parts, or I do not know enough about that code.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 67.83439% with 101 lines in your changes missing coverage. Please review.

Project coverage is 74.69%. Comparing base (1fac855) to head (234cad2).

Files with missing lines Patch % Lines
src/pyg4ometry/visualisation/VtkViewerNew.py 0.00% 12 Missing ⚠️
src/pyg4ometry/gdml/Reader.py 47.36% 10 Missing ⚠️
src/pyg4ometry/geant4/LogicalVolume.py 69.23% 8 Missing ⚠️
src/pyg4ometry/geant4/Registry.py 61.90% 8 Missing ⚠️
src/pyg4ometry/compare/_Compare.py 12.50% 7 Missing ⚠️
src/pyg4ometry/geant4/ReplicaVolume.py 25.00% 6 Missing ⚠️
src/pyg4ometry/visualisation/VtkViewer.py 45.45% 6 Missing ⚠️
src/pyg4ometry/analysis/flukaData.py 28.57% 5 Missing ⚠️
src/pyg4ometry/geant4/_Material.py 28.57% 5 Missing ⚠️
src/pyg4ometry/usd/solid/SolidBase.py 44.44% 5 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #229      +/-   ##
==========================================
+ Coverage   74.61%   74.69%   +0.07%     
==========================================
  Files         157      157              
  Lines       22867    22910      +43     
==========================================
+ Hits        17063    17112      +49     
+ Misses       5804     5798       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ManuelHu
Copy link
Contributor Author

@stewartboogert this would be my changes to start with #220 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant