-
Notifications
You must be signed in to change notification settings - Fork 13
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
simple fastplotlib example #88
Conversation
This is really cool! I'm going to ask that we wait on merging this until @draelos finishes her review and we merge I will also want us to think about how we write a test for this. I don't want/need full coverage for demos, but it would be good to have ways to check we aren't breaking them in future, especially since lots of people may want this feature. |
Sure! I mostly wanted to make sure that this is the right way to approach sending data to notebooks. Looking into testing notebooks, this looks like it should work: https://github.com/treebeardtech/nbmake I'll have to make sure the tests actually execute in the notebook, some of the other jupyter notebook testing options just extract the code and run it in a regular python kernel. When |
Co-authored-by: jmp33 <[email protected]> Co-authored-by: draelos <[email protected]>
@kushalkolar Can you try this again with TUI merged? That way I can see the status of tests? |
I'm running into this with (mescore) kushalk@hantman-calcium:~/repos/improv/demos/fastplotlib (kushal-onacid-fpl)
└─ $ ▶ improv run ./fastplotlib.ipynb
Traceback (most recent call last):
File "/home/kushalk/python-venvs/mescore/bin/improv", line 8, in <module>
sys.exit(default_invocation())
File "/home/kushalk/repos/improv/improv/cli.py", line 100, in default_invocation
args.func(args)
File "/home/kushalk/repos/improv/improv/cli.py", line 213, in run
args.logging_port = logging_port
UnboundLocalError: local variable 'logging_port' referenced before assignment
/usr/local/lib/python3.10/subprocess.py:1070: ResourceWarning: subprocess 874199 is still running
_warn("subprocess %s is still running" % self.pid, with (mescore) kushalk@hantman-calcium:~/repos/improv/demos/fastplotlib (kushal-onacid-fpl)
└─ $ ▶ improv server ./fastplotlib.ipynb
Traceback (most recent call last):
File "/home/kushalk/python-venvs/mescore/bin/improv", line 8, in <module>
sys.exit(default_invocation())
File "/home/kushalk/repos/improv/improv/cli.py", line 100, in default_invocation
args.func(args)
File "/home/kushalk/repos/improv/improv/cli.py", line 127, in run_server
control_port, output_port = server.createNexus(file=args.configfile, control_port=args.control_port, output_port=args.output_port)
File "/home/kushalk/repos/improv/improv/nexus.py", line 82, in createNexus
self.loadConfig(file=file)
File "/home/kushalk/repos/improv/improv/nexus.py", line 105, in loadConfig
self.config.createConfig()
File "/home/kushalk/repos/improv/improv/config.py", line 48, in createConfig
for name,actor in cfg['actors'].items():
KeyError: 'actors'
sys:1: ResourceWarning: Unclosed socket <zmq.asyncio.Socket(zmq.PUB) at 0x7f8a09012e00>
sys:1: ResourceWarning: Unclosed socket <zmq.asyncio.Socket(zmq.REP) at 0x7f8a09012f80>
/usr/local/lib/python3.10/subprocess.py:1070: ResourceWarning: subprocess 874537 is still running
_warn("subprocess %s is still running" % self.pid, |
I'm not sure calling improv server on a .ipynb file works anyway? But the first error is likely due to what John mentioned. The file global.log should have more traceback. |
Correct. You’d need to do
```
improv server <config yaml>
```
and then use `zmq` inside the notebook (connecting on the ports the server outputs) to send the `setup`, `run`, etc. commands.
|
Sets up a docs directory and a github pages action to deploy its contents to https://project-improv.github.io/improv/. Closes project-improv#79. Co-authored-by: cyzhou1028 <[email protected]> Co-authored-by: jmp33 <[email protected]> Co-authored-by: draelos <[email protected]>
This actually works, I think I had a weird character in my yaml config file on my end. |
continued in #104 |
very simple example with fastplotlib to show updating frames with randomly generated data.
Closes #85
The jupyterlab server is running on my lab workstation but I'm connecting to it from home just through my browser so the remote frame buffer is being streamed over the internet.
improv-fpl-2023-03-18_01.48.16.mp4
Basically:
Generator: 512 x 512 random frames -> queue -> Processor, sends zmq message
jupyter notebook: receives zmq message, updates image graphic in fastplotlib
https://github.com/kushalkolar/improv/blob/fastplotlib-demo/demos/fastplotlib/fastplotlib.ipynb