-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[IPython] Support IDLE and Blender scripting module as interactive shell #1308
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1308 +/- ##
==========================================
- Coverage 66.84% 66.26% -0.58%
==========================================
Files 38 41 +3
Lines 5450 5775 +325
Branches 956 998 +42
==========================================
+ Hits 3643 3827 +184
- Misses 1644 1777 +133
- Partials 163 171 +8
Continue to review full report at Codecov.
|
d4aa3a2
to
73bff6c
Compare
taichi_dir = os.path.dirname(os.path.abspath(ti.__file__)) | ||
filename = os.path.join(taichi_dir, '.tidle_' + str(os.getpid())) | ||
with open(filename, 'a') as f: | ||
f.write('\n===\n' + source) |
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.
We have to use this dirty method since idle and taichi is running in separate process... any idea?
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.
IIUIC you want to inject part of the process info of taichi into IDLE so they could work together? I'm not so sure but would ZeroMQ work in this scenario without the dirty hack? Its binding with Python is really easy to work with and is pretty fast at IPC.
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.
or we can directly wrap sockets and pass arbitrary python objects using multiprocessing? Correct me if I'm wrong, I feel like I'm missing sth here lol
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.
sockets
In fact, the IDLE already using socket as IPC, and that could be an ultimate solution, however:
- Not sure if it's invarient over different versions.
- I'm not super familiar about sockets :(
So I'd rather write a portable file IPC instead, WDYT?
ZeroMQ
No, Taichi is already a highly dedicated package, having too heavy dependencies could easily ban it from everyday people, sorry.
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.
Ahh I see. Then I think this solution's good enough. The one that works is always the best one.
1121ab3
to
7847dc3
Compare
I don't have a Blender, could you confirm this PR works for the Blender scripting module too? |
Hi Yubin, My first time hearing taichi script in Blender. Does Blender have sth like IDLE for running interactive python? I could help confirm when free later. Thx I read that in the #1483 that there is a Blender Python environment. :> |
Why nobody review this.. Here're tons of ad-hoc engineering effort to make the stupid IDLE happy :( |
Is this going to be closed? |
Please don't close this (╯︵╰) |
Of course I won't! ❤️ But given that people never review our PR (why??), I think we can merge on our own if they don't hit the |
Thanks for all the contributions here! This is a useful feature and the PR should stay open. I just need more time to review given the large change (and my packed daily schedule...) Sorry about that. |
* [Misc] Use 'dill.source' of 'inspect' to run codes in interactive shell * [skip ci] Add dill to CI * _ShellInspectorWrapper * Hack IDLE to make it happy * Fix IDLE * [skip ci] cache: we do care user experience!! * improve stability * [skip ci] fix example exit * [skip ci] fix exit in IPython * [skip ci] improve comment * fix exec risk in ti debug (@rexwangcc) * [skip ci] Fix ti debug too verbose * Better line * fix test_cli * [skip ci] idle_hacker.py * fix typo and improve hacker * [skip ci] reimprov * improve idle inspector * [skip ci] add tag [IPython] * revert idle * [skip ci] Revert "revert idle" This reverts commit 794bf05. * tmp save * well * clean * [skip ci] re * [skip ci] al * t * improve hack * nice message * [skip ci] enforce code format * ti idle_hacker -r * [skip ci] enforce code format * fix ipython * revert Co-authored-by: Taichi Gardener <taichigardener@gmail.com>
This reverts commit 202c235.
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.
The injector LGTM so far! If the other solutions wouldn't work I think this is a good choice
taichi_dir = os.path.dirname(os.path.abspath(ti.__file__)) | ||
filename = os.path.join(taichi_dir, '.tidle_' + str(os.getpid())) | ||
with open(filename, 'a') as f: | ||
f.write('\n===\n' + source) |
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.
IIUIC you want to inject part of the process info of taichi into IDLE so they could work together? I'm not so sure but would ZeroMQ work in this scenario without the dirty hack? Its binding with Python is really easy to work with and is pretty fast at IPC.
taichi_dir = os.path.dirname(os.path.abspath(ti.__file__)) | ||
filename = os.path.join(taichi_dir, '.tidle_' + str(os.getpid())) | ||
with open(filename, 'a') as f: | ||
f.write('\n===\n' + source) |
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.
or we can directly wrap sockets and pass arbitrary python objects using multiprocessing? Correct me if I'm wrong, I feel like I'm missing sth here lol
Co-authored-by: Danni <38550500+isdanni@users.noreply.github.com>
Hi! I searched for the Internet and realized that there are no such package capable of inspecting these various shells yet.
WDYT about this solution? @yuanming-hu @EaryChow @isdanni Inputs are welcome! |
Related issue = #1483
[Click here for the format server]