-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Logger Widget Panel #2872
base: master
Are you sure you want to change the base?
Logger Widget Panel #2872
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
*beep* *bop* 17 W293 [*] Blank line contains whitespace
8 G004 [ ] Logging statement uses f-string
5 F405 [ ] `exclude_patterns` may be undefined, or defined from star imports
3 FA102 [*] Missing `from __future__ import annotations`, but uses PEP 585 collection
3 F401 [*] `IPython.display.display` imported but unused
3 UP015 [*] Unnecessary open mode parameters
2 I001 [*] Import block is un-sorted or un-formatted
2 E402 [ ] Module level import not at top of file
2 W291 [*] Trailing whitespace
2 W605 [*] Invalid escape sequence: `\A`
1 RET505 [ ] Unnecessary `else` after `return` statement
1 RET506 [ ] Unnecessary `else` after `raise` statement
1 E712 [*] Avoid equality comparisons to `True`; use `if toml_config_tool_dict["tardis"]['edit_on_github']:` for truth checks
1 E902 [ ] No such file or directory (os error 2)
1 W292 [*] No newline at end of file
1 D204 [*] 1 blank line required after class docstring
1 PGH004 [ ] Use specific rule codes when using `noqa`
1 UP009 [*] UTF-8 encoding declaration is unnecessary
1 UP030 [*] Use implicit references for positional format fields
1 UP032 [*] Use f-string instead of `format` call
1 TRY300 [ ] Consider moving this statement to an `else` block
Complete output(might be large): docs/conf.py:1:1: UP009 [*] UTF-8 encoding declaration is unnecessary
docs/conf.py:27:1: I001 [*] Import block is un-sorted or un-formatted
docs/conf.py:30:8: F401 [*] `tardis` imported but unused
docs/conf.py:36:43: PGH004 Use specific rule codes when using `noqa`
docs/conf.py:46:6: UP015 [*] Unnecessary open mode parameters
docs/conf.py:67:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:68:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:69:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:70:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:71:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:140:1: W293 Blank line contains whitespace
docs/conf.py:175:1: W293 Blank line contains whitespace
docs/conf.py:192:13: UP030 Use implicit references for positional format fields
docs/conf.py:192:13: UP032 [*] Use f-string instead of `format` call
docs/conf.py:219:1: E402 Module level import not at top of file
docs/conf.py:292:4: E712 Avoid equality comparisons to `True`; use `if toml_config_tool_dict["tardis"]['edit_on_github']:` for truth checks
docs/conf.py:359:1: E402 Module level import not at top of file
docs/conf.py:374:10: UP015 [*] Unnecessary open mode parameters, use ""w""
docs/conf.py:389:10: UP015 [*] Unnecessary open mode parameters, use ""w""
docs/quickstart.ipynb:cell 13:1:39: W291 [*] Trailing whitespace
docs/quickstart.ipynb:cell 13:5:35: W291 [*] Trailing whitespace
docs/quickstart.ipynb:cell 18:10:26: W605 [*] Invalid escape sequence: `\A`
docs/quickstart.ipynb:cell 18:11:40: W605 [*] Invalid escape sequence: `\A`
tardis/io/logger/__init__.py:4:37: F401 `tardis.io.logger.logger.logger_widget` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/io/logger/__init__.py:4:50: W292 [*] No newline at end of file
tardis/io/logger/colored_logger.py:1:1: E902 No such file or directory (os error 2)
tardis/io/logger/logger.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/io/logger/logger.py:41:13: FA102 Missing `from __future__ import annotations`, but uses PEP 585 collection
tardis/io/logger/logger.py:50:13: FA102 Missing `from __future__ import annotations`, but uses PEP 585 collection
tardis/io/logger/logger.py:50:18: FA102 Missing `from __future__ import annotations`, but uses PEP 604 union
tardis/io/logger/logger.py:58:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:80:21: G004 Logging statement uses f-string
tardis/io/logger/logger.py:126:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:128:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:137:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:140:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:149:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:160:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:166:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:170:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:176:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:180:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:187:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:191:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:194:1: W293 [*] Blank line contains whitespace
tardis/io/logger/logger.py:204:5: D204 [*] 1 blank line required after class docstring
tardis/io/logger/logger.py:207:1: W293 [*] Blank line contains whitespace
tardis/simulation/base.py:8:29: F401 [*] `IPython.display.display` imported but unused
tardis/simulation/base.py:197:13: RET506 Unnecessary `else` after `raise` statement
tardis/simulation/base.py:261:17: G004 Logging statement uses f-string
tardis/simulation/base.py:268:9: RET505 Unnecessary `else` after `return` statement
tardis/simulation/base.py:449:13: G004 Logging statement uses f-string
tardis/simulation/base.py:547:13: G004 Logging statement uses f-string
tardis/simulation/base.py:636:21: G004 Logging statement uses f-string
tardis/simulation/base.py:639:13: G004 Logging statement uses f-string
tardis/simulation/base.py:644:13: G004 Logging statement uses f-string
tardis/simulation/base.py:695:13: TRY300 Consider moving this statement to an `else` block
tardis/simulation/base.py:697:26: G004 Logging statement uses f-string
Found 58 errors.
[*] 30 fixable with the `--fix` option (7 hidden fixes can be enabled with the `--unsafe-fixes` option).
|
8902d28
to
75f09b9
Compare
*beep* *bop* Hi, human. The Click here to see your results. |
tardis/io/logger/logger.py
Outdated
self.futures = [] | ||
|
||
# Single event loop and thread for all environments | ||
self.loop = asyncio.new_event_loop() |
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 do we need this to be created for environments outside of a notebook? e.g. what happens if you run TARDIS in the command line?
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'm afraid it creates a new loop there too. Do we want to show the logs in the terminal or do we want to show it as a Panel widget in the browser(it would be deployed on some port)? If it is the first case then I will change it so that this mechanism only works with VSCode and Jupyter Notebooks(since those are the places where we would be seeing the widget). Does that sound alright to you?
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.
Yes, please make the logs just print to terminal for CLI use of TARDIS.
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.
Sure, this change does that- 03d34f1#diff-2f4aaca893bcc603dd023f49b86f7243a7a52d1078eec0b6fa5742dd8da8d882
0ab316e
to
8fa0692
Compare
@@ -37,6 +37,9 @@ dependencies: | |||
- matplotlib-base | |||
- ipywidgets | |||
- plotly | |||
- panel | |||
- watchfiles |
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.
What is this used for?
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.
Panel recommends this library during installation, so I put it there.
https://panel.holoviz.org/getting_started/installation.html#installing-panel
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.
Hmm, seems to be for development purposes. I'm not sure if we want it as part of the standard TARDIS environment. @wkerzendorf thoughts?
b4f07d3
to
1483ee1
Compare
I really don't like pinning |
cc35495
to
1a0d44e
Compare
Also by default widget is disable in CLI
72de203
to
5738a20
Compare
📝 Description
Type: 🪲
bugfix
| 🚀feature
| ☣️breaking change
| 🚦testing
| 📝documentation
| 🎢infrastructure
Write a complete description of your changes, including the necessary context or any piece of information required to understand your work.
Also, link issues affected by this pull request by using the keywords:
close
,closes
,closed
,fix
,fixes
,fixed
,resolve
,resolves
orresolved
.📌 Resources
Examples, notebooks, and links to useful references.
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label