Ejemplo n.º 1
0
def test_dataframe_pane_streamz(document, comm):
    from streamz.dataframe import Random
    sdf = Random(interval='200ms', freq='50ms')
    pane = DataFrame(sdf)

    assert pane._stream is None

    # Create pane
    model = pane.get_root(document, comm=comm)
    assert pane._stream is not None
    assert pane._models[model.ref['id']][0] is model
    assert model.text == ''

    # Replace Pane.object
    pane.object = sdf.x
    assert pane._models[model.ref['id']][0] is model
    assert model.text == ''

    # Cleanup
    pane._cleanup(model)
    assert pane._stream is None
    assert pane._models == {}
Ejemplo n.º 2
0
def test_get_streamz_seriess_pane_type():
    from streamz.dataframe import Random
    sdf = Random(interval='200ms', freq='50ms').groupby('y').sum()
    assert PaneBase.get_pane_type(sdf.x) is DataFrame
Ejemplo n.º 3
0
def test_get_streamz_dataframe_pane_type():
    from streamz.dataframe import Random
    sdf = Random(interval='200ms', freq='50ms')
    assert PaneBase.get_pane_type(sdf) is DataFrame
Ejemplo n.º 4
0
 def test_streamz_dataframes_patched(self):
     from streamz.dataframe import Random
     random_df = Random()
     self.assertIsInstance(
         random_df.groupby('x').sum().hvplot, hvPlotTabular)
Ejemplo n.º 5
0
 def test_streamz_series_patched(self):
     from streamz.dataframe import Random
     random_df = Random()
     self.assertIsInstance(random_df.x.hvplot, hvPlotTabular)
Ejemplo n.º 6
0
 def test_streamz_series_patched(self):
     from streamz.dataframe import Random
     random_df = Random()
     self.assertIsInstance(random_df.x.holoplot, HoloPlot)