tensorwatch icon indicating copy to clipboard operation
tensorwatch copied to clipboard

Jupyter Lab

Open romesco opened this issue 5 years ago • 0 comments

The examples I've tried are running just fine in a classic jupyter notebook server, but fail to dynamically update in jupyter lab.

One testable instance to reproduce the issue is the quickstart:

import tensorwatch as tw
import time

# streams will be stored in test.log file
w = tw.Watcher(filename='test.log')

# create a stream for logging
s = w.create_stream(name='metric1')

# generate Jupyter Notebook to view real-time streams
w.make_notebook()

for i in range(1000):
    # write x,y pair we want to log
    s.write((i, i*i))

    time.sleep(1)

After making the change in the autogenerated test.ipynb: %matplotlib notebook -> %matplotlib inline, a plot is drawn upon running the cells but this plot remains static unless it is refreshed (re-run the cell manually).

I know this is somewhat due to a difference in how the classic notebook handles inline content vs. lab, but I'm not able to determine the changes necessary to accommodate lab.

I noticed this file: https://github.com/microsoft/tensorwatch/blob/master/install_jupyterlab.bat, but since there isn't much context for it, I am wondering if there's been an effort to get streams plotting in jupyter lab.

Appreciate any insights!

romesco avatar Feb 22 '20 20:02 romesco