pyg4ometry
pyg4ometry copied to clipboard
Replace `print()` statements with `logging` module calls
And uncomment this:
https://github.com/g4edge/pyg4ometry/blob/ebbcc37f1707c5b1cba8e41849d53d83c11b50a6/pyproject.toml#L120
I already have a large patch for some other print calls, where I
- replace them with
logging - or with exceptions
- or remove them entirely....
But removing all of them is a huge amount of work, so I stopped at some point.
Do you have this WIP on some branch? Maybe you could open a draft PR and someone else can work on it at some point.
not yet, but I will try to get it up in the near future.
Happy to contribute to this once there is a WIP PR there is a mixture of IO, and there are some areas which logging is used others with a profusion of print. Moving to a more notebook environment, the printout is very annoying. I learned to program in the 80s and still love a print out, apologies.
after #229, there are some parts that have not been converted from print to logging. 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"]
this is all code that I personally do not use ever/very often, so I do not have a good understanding of it. After converting the files (switchting to logging calls, or adding noqa comments), the files should be removed from the exclusion list.