-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Adding Logging Support for Caught Exceptions #1701
Conversation
Before a pull request is accepted, it must meet the following criteria:
|
c83ccbf
to
5516a3a
Compare
tardis/analysis.py
Outdated
@@ -2,12 +2,15 @@ | |||
|
|||
import re | |||
import os | |||
import logging |
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.
Why are there changes in this file? They don't do anything.
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.
I wanted to ask about this. Do we need to log exceptions for this part of the source code 🤔
tardis/analysis/opacities.py
Outdated
@@ -329,7 +329,7 @@ def _calc_thomson_scattering_opacity(self): | |||
"""Calculate the Thomson scattering opacity for each grid cell | |||
|
|||
\[ | |||
\chi_{\mathrm{Thomson}} = n_{\mathrm{e}} \sigma_{\mathrm{T}} | |||
\chi_{\mathrm{Thomson}} = n_{\mathrm{e}} \sigma_{\mathrm{T}} |
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.
Why is this changed?
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.
Just for formatting consistency with Docstrings 😄
Codecov Report
@@ Coverage Diff @@
## master #1701 +/- ##
==========================================
- Coverage 61.06% 60.99% -0.08%
==========================================
Files 63 63
Lines 5820 5845 +25
==========================================
+ Hits 3554 3565 +11
- Misses 2266 2280 +14
Continue to review full report at Codecov.
|
I think that is a nice start to things. First of all - in general this PR seems to contain a variety of different fixes and a lot of files. In general, fewer PRs targeted to specific issues is better. |
Hello @wkerzendorf, This is actually due to how the formatting for the logger has been done. Continuing from #1632, I have added a new line & some tab spaces between the messages such that it is easier to read. If we remove this ( |
c294512
to
5699cfc
Compare
Now that you have a fix for the |
I have implemented it in PR #1704. I think we can merge this as it is here & then I can resolve this in that PR 😄 |
b62e878
to
0a6eb53
Compare
d841ec2
to
c6482c1
Compare
* Added Logging Support to Debug for Caught Exceptions * Removed \n\t formatting from Exception Messages
This PR aims to add logging support to caught exceptions.
Description
There are numerous exceptions that are caught but are not visible to the user. This PR aims to add support via logging for these exceptions such that it is visible when logging is turned on. Logs at
DEBUG
level 😄Motivation and context
Allows for better explanation for silent errors or exceptions that may happen. Logging them will benefit & make it more descriptive for the user to fix and see what is going on in the simulation.
How has this been tested?
Type of change
Checklist