-
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] Source inspection dispatcher for better IDLE compatibility #1222
Conversation
Not sure if this helps: https://ipython.readthedocs.io/en/stable/api/generated/IPython.core.oinspect.html?highlight=getsource
Sleepy now to prevent class drop, will fix this tmr. |
Hi @archibate , good morning! I will try to do some simple tests and review it once I am free this evening. May you have enjoyed your course :> |
IDLE OK. |
Hello? Let's try to merge this before v0.6.10, IDLE & IPython fans would like my PR :) |
Do you have IPython or IDLE on your windows machine? I would appreciate very much if you could test this PR for me ❤️ |
This comment has been minimized.
This comment has been minimized.
Should I separate IDLE to another PR? |
On my end, it seems to me that Taichi works in |
Could not get source code IIRC... will test later. |
Oh sorry! It did work:
My previous experience of IPython failure is because I used
So we still need both of them. |
Ok, now I reverted IDLE part and here's only Python native shell and IPython shell part now. Hope this make your review faster. |
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.
Thanks! I think the code mostly looks good. However, I'm still confused: given that IPython and Jupyter notebook already works well, do we need to do anything about them? Also maybe we should update the title and remove "IPython" there?
I know, but it's wise to use the IPython builtin inspector for better compatibility, also the framework may apply to IDLE and other shells. |
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 see. SGTM! Thank you for adding this feature. Maybe change the PR title into something like "Source inspection dispatcher for better IDLE compatibility"?
Co-authored-by: Yuanming Hu <[email protected]>
…aichi-dev#1222) * [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 off-topic cuda debug * [skip ci] clean * [skip ci] enforce code format * [skip ci] no atexit * fix * [skip ci] Update python/taichi/lang/shell.py Co-authored-by: Yuanming Hu <[email protected]> * add dill to jenkins Co-authored-by: Taichi Gardener <[email protected]> Co-authored-by: Yuanming Hu <[email protected]> Co-authored-by: Yuanming Hu <[email protected]>
Hi there, just tried this (I want to test convert an image readed from disk to gray scale, but just starting)
I got this also on my jupyter notebook with almost same code. I uninstalled and installed nightly and it istalled 5.11.
So it runs finds it... now I need to learn to use taichi. Sorry for the "updates" I runned this latest update on jupyter notebook With the cell
The output
|
Related issue = close #1221 close #1136
Inspired by https://stackoverflow.com/questions/60797338/get-ast-from-python-object-in-interpreter.
Working in
python
native shell:Not working inworking now.ipython
shell:WANT_VER = v0.6.10