예제 #1
0
def test_plot_1d_cluster():
    data_reduced_1d = reducer(data, ndims=1)
    geo = plot.plot(data_reduced_1d, cluster='KMeans', show=False)
    assert all([i.shape[1] == 1
                for i in geo.data]) and len(geo.ax.get_lines()) == 3
예제 #2
0
def test_plot_3d():
    data_reduced_3d = reduc(data, ndims=3)
    _, _, data_3d = plot.plot(data_reduced_3d, show=False, return_data=True)
    assert all([i.shape[1] == 3 for i in data_3d])
예제 #3
0
def test_plot_data_is_list():
    _, _, data_nd = plot.plot(data, show=False, return_data=True)
    assert type(data_nd) is list
예제 #4
0
def test_plot_animate_check_line_ani():
    _, _, _, line_ani = plot.plot(data,
                                  animate=True,
                                  show=False,
                                  return_data=True)
    assert isinstance(line_ani, mpl.animation.FuncAnimation)
예제 #5
0
def test_plot_1dim():
    _, _, data_1dim = plot.plot(np.array([1, 2, 3, 4]),
                                show=False,
                                return_data=True)
    assert data_1dim[0].ndim == 2
예제 #6
0
def test_plot_reduce_align5d():
    # should return 5d data since ndims=5
    geo = plot.plot(weights, ndims=5, align=True, show=False)
    assert all([i.shape[1] == 5 for i in geo.xform_data])
예제 #7
0
def test_reduce_geo():
    geo = plot(data, show=False)
    reduced_data_3d = reducer(geo, ndims=3)
    assert reduced_data_3d[0].shape==(10,3)
예제 #8
0
def test_plot_animate_check_fig():
    geo = plot.plot(data, animate=True, show=False)
    assert isinstance(geo.fig, mpl.figure.Figure)
예제 #9
0
def test_plot_animate_check_ax():
    geo = plot.plot(data, animate=True, show=False)
    assert isinstance(geo.ax, mpl.axes._axes.Axes)
예제 #10
0
def test_plot_nd_animate():
    geo = plot.plot(data, animate=True, show=False)
    assert all([i.shape[1] == d.shape[1] for i, d in zip(geo.data, data)])
예제 #11
0
def test_plot_data_animate_is_list():
    geo = plot.plot(data, animate=True, show=False)
    assert type(geo.data) is list
예제 #12
0
def test_plot_2d_animate():
    data_reduced_2d = reducer(data, ndims=2)
    with pytest.raises(Exception) as e_info:
        plot.plot(data_reduced_2d, animate=True, show=False)
예제 #13
0
def test_plot_data_is_list():
    geo = plot.plot(data, show=False)
    assert type(geo.data) is list
예제 #14
0
def test_plot_nd():
    geo = plot.plot(data, show=False)
    assert all([i.shape[1] == d.shape[1] for i, d in zip(geo.data, data)])
예제 #15
0
def test_plot_reduce2d():
    # should return 2d data since ndims=2
    geo = plot.plot(data, ndims=2, show=False)
    assert all([i.shape[1] == 2 for i in geo.xform_data])
예제 #16
0
def test_plot_animate_check_line_ani():
    geo = plot.plot(data, animate=True, show=False)
    assert isinstance(geo.line_ani, mpl.animation.FuncAnimation)
예제 #17
0
def test_plot_reduce1d():
    # should return 1d data since ndims=1
    geo = plot.plot(data, ndims=1, show=False)
    assert all([i.shape[1] == 1 for i in geo.xform_data])
예제 #18
0
def test_plot_1d():
    data_reduced_1d = reducer(data, ndims=1)
    geo = plot.plot(data_reduced_1d, show=False)
    assert all([i.shape[1] == 1 for i in geo.data])
예제 #19
0
def test_plot_reduce10d():
    # should return 10d data since ndims=10
    geo = plot.plot(weights, ndims=10, show=False)
    assert all([i.shape[1] == 10 for i in geo.xform_data])
예제 #20
0
def test_plot_1dim():
    geo = plot.plot(np.array([1, 2, 3, 4]), show=False)
    assert geo.data[0].ndim == 2
예제 #21
0
def test_plot_animate_check_ax():
    _, ax, _, _ = plot.plot(data, animate=True, show=False, return_data=True)
    assert isinstance(ax, mpl.axes._axes.Axes)
예제 #22
0
def test_plot_2d():
    data_reduced_2d = reducer(data, ndims=2)
    geo = plot.plot(data_reduced_2d, show=False)
    assert all([i.shape[1] == 2 for i in geo.data])
예제 #23
0
def test_plot_1d():
    data_reduced_1d = reduc(data, ndims=1)
    _, _, data_1d = plot.plot(data_reduced_1d, show=False, return_data=True)
    assert all([i.shape[1] == 1 for i in data_1d])
예제 #24
0
def test_plot_3d():
    data_reduced_3d = reducer(data, ndims=3)
    geo = plot.plot(data_reduced_3d, show=False)
    assert all([i.shape[1] == 3 for i in geo.data])
예제 #25
0
def test_plot_2d():
    data_reduced_2d = reduc(data, ndims=2)
    _, _, data_2d = plot.plot(data_reduced_2d, show=False, return_data=True)
    assert all([i.shape[1] == 2 for i in data_2d])
예제 #26
0
def test_plot_reduce_none():
    # Should return same dimensional data if ndims is None
    geo = plot.plot(data, show=False)
    assert all([i.shape[1] == d.shape[1] for i, d in zip(geo.data, data)])
예제 #27
0
def test_plot_nd():
    _, _, data_nd = plot.plot(data, show=False, return_data=True)
    assert all([i.shape[1] == 3 for i in data_nd])
예제 #28
0
def test_plot_reduce3d():
    # should return 3d data since ndims=3
    geo = plot.plot(data, ndims=3, show=False)
    assert all([i.shape[1] == 3 for i in geo.xform_data])
예제 #29
0
def test_plot_check_fig():
    fig, _, _ = plot.plot(data, show=False, return_data=True)
    assert isinstance(fig, mpl.figure.Figure)
예제 #30
0
def test_normalize_geo():
    geo = plot(data, show=False)
    norm_data = normalize(geo, normalize='row')
    assert np.allclose(np.mean(np.vstack(norm_data), axis=1),0)