-
Notifications
You must be signed in to change notification settings - Fork 949
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
Mention ipython_blocking in the async docs #2417
Comments
@jasongrout yep that sounds great. I was planning on making a PR to the docs (and talk about potential improvements to the library) at the Dashboarding conference in two weeks. If you get to it before then, I'm sure we'll find other conversation topics. I appreciate the kind words and mention, thanks. |
# cell 1
x = view.render_image()
# cell 2
time.sleep(1)
# cell 3
print(x.value[:10]) with # cell 1
c = CaptureExecution()
with c:
x = view.render_image()
while True:
if x.value:
break
c.step()
# cell2
print(x.value[:10]) By the way, it would be nicer if I can do this with CaptureExecution() as c:
bla bla
# `__enter__` just return `self`. |
@hainm, I can't think offhand how I would implement the # cell 1
import ipython_blocking # enables %block and %blockrun
x = view.render_image()
# cell 2
%block x
# cell 3
print(x.value[:10]) |
hi @kafonek, thanks.
|
@hainm when you are running them manually, I think the image is getting rendered before you run the cell with def exit_function():
return x.value # or len(x.value) > 1 or some other validation function
%block exit_function Your solution to put them in the same cell is also totally valid. |
thanks @kafonek, I am actually more interested in non-magic code so I could implement something in |
very cool, thanks for the heads up @hainm. cheers. |
https://github.com/kafonek/ipython_blocking is a clever way to block execution on user input. It essentially monkey-patches the kernel execution on the kernel side to save execution messages until a condition is met, then executes the saved messages.
@kafonek - is it all right with you if we note that your package is another way to write a notebook where cell execution waits on user input? We would note that it is provided by a community package.
The text was updated successfully, but these errors were encountered: