-
-
Notifications
You must be signed in to change notification settings - Fork 404
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 a logger widget for logging in run_tardis #2700
base: master
Are you sure you want to change the base?
Conversation
*beep* *bop* Hi, human. The Click here to see the build log. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
…NG/ERROR" instead of the initial five tabs
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
… INFO, DEBUG and ALL.
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
…8, where log level "ALL" was not added.
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
@DeekshaMohanty can you please fix the |
Points 6 and 7 for the issue linked to this PR need some further discussion. #2701 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2700 +/- ##
==========================================
- Coverage 69.68% 69.32% -0.36%
==========================================
Files 181 190 +9
Lines 14469 15016 +547
==========================================
+ Hits 10082 10410 +328
- Misses 4387 4606 +219 ☔ View full report in Codecov by Sentry. |
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.
This is a great addition @DeekshaMohanty - thanks for taking initiative on this!
I've left some comments, please address them when you get a chance. We need to make sure that we address all the points in #2701
@@ -116,7 +116,7 @@ | |||
"sim = run_tardis(\"tardis_example.yml\", \n", | |||
" virtual_packet_logging=True,\n", | |||
" show_convergence_plots=True,\n", | |||
" export_convergence_plots=True,\n", | |||
" export_convergence_plots=False, #TODO: to avoid double plots\n", |
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.
Maybe we need to replace this parameter with a new parameter (maybe called export_static_output
) which can show convergence plots and logger-widget (or atleast a fixed height html text area) for static HTML documentation website.
And setting this param to True should be controllable by identifying if the notebook execution is being done by nbsphinx/nbconvert - there should be some setting to detect that but needs research.
|
||
logging_level = ( | ||
log_level if log_level else tardis_config["debug"]["log_level"] | ||
tardis_config["debug"].get("specific_log_level", specific_log_level) |
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.
good cleanup!
"WARNING/ERROR": Output(layout=Layout(height='300px', overflow_y='auto')), | ||
"INFO": Output(layout=Layout(height='300px', overflow_y='auto')), | ||
"DEBUG": Output(layout=Layout(height='300px', overflow_y='auto')), | ||
"ALL": Output(layout=Layout(height='300px', overflow_y='auto')) |
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.
you can define a function that returns a Output widget and call for each of the keys, instead of repeating code.
tab.set_title(2, "DEBUG") | ||
tab.set_title(3, "ALL") | ||
|
||
display(tab) |
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.
do we really need to do it global level? shouldn't display be inside some function/class that gets called/instantiated?
If not, maybe move it together with other global level code at L184
elif record.levelno == logging.DEBUG: | ||
color = 'blue' | ||
else: | ||
color = 'black' |
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.
it will be cleaner if colors come from a dictionary, instead of defining here
@@ -517,7 +517,7 @@ def log_plasma_state( | |||
plasma_state_log["next_w"] = next_dilution_factor | |||
plasma_state_log.columns.name = "Shell No." | |||
|
|||
if is_notebook(): | |||
if False and is_notebook(): #TODO: remove it with something better |
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 think we can simply remove the if
block since we are controlling display
now
📝 Description
Fixes #2701
Type: 🚀
feature
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label