-
-
Notifications
You must be signed in to change notification settings - Fork 117
Feature/execute ipython #90
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
Feature/execute ipython #90
Conversation
- Support IPython magic commands, shell commands, and Python code - Add comprehensive tests and documentation - Include timeout and error handling
…tput handling - Create temporary cell to execute IPython code instead of direct kernel.execute() - Properly handle outputs using existing notebook.execute_cell() pattern - Add cleanup mechanism to remove temporary cell after execution - Fixes test failure with [Unknown output type: None] issue
Currently, it's implemented by adding a temporary Code Cell at the end of the Notebook, executing it to get the output, and then deleting it. This is not elegant, and it will be improved in the future |
- Add Windows-specific timeout checks to skip tests gracefully - Increase timeout from 30s to 60s for execute_ipython tests - Check for None results and skip on Windows with clear message - Prevents test failures due to known Windows platform limitations - All tests will now either pass or skip on Windows instead of fail
I think this step can be skipped using the kernel-client api directly. |
…execution - Use direct kernel.execute() call instead of temporary cell approach - Simplify timeout handling with straightforward asyncio.wait_for - Remove unnecessary nested functions and safety wrappers - Keep essential error handling and timeout interruption - More maintainable and clearer code structure
- Replace kernel.execute with kernel.execute_interactive - Implement output_hook callback to collect outputs correctly - Fix output format to match expected structure - Ensure proper handling of stream, display_data, and error outputs
Sounds Good to me. fix it using kernel api in |
On https://github.com/datalayer/jupyter-kernel-client you can use simply the following to run code (not need for asyncio, tasks...)
|
How can I control the timeout without asyncio? The |
OK, I see. timeout for code execution is sometimes tricky. Happy to merge as-is. Later, it would be great to factor better timeout control in the kernel-client library. |
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.
LGTM Thx @ChengJiale150
See in #89