Commit e5ef97c6 authored by Valentin Valls's avatar Valentin Valls
Browse files

Test stadard plot command

parent 01d775e5
......@@ -457,7 +457,7 @@ class Plot1D(BasePlot):
# Get default x
elif x is None:
key = next(iter(data_dict))
length, = data_dict[key].shape
length = len(data_dict[key])
x = numpy.arange(length)
# Add x data
if x is not None:
......
"""Testing the common plot API provided by BLISS."""
import numpy
from bliss.common import plot
def test_plot_list(flint_session):
data = [0, 1, 2, 0, 1, 2]
p = plot.plot(data)
vrange = p.get_data_range()
assert vrange[0:2] == [[0, 5], [0, 2]]
def test_plot_numpy_1d(flint_session):
data = numpy.array([0, 1, 2, 0, 1, 2])
p = plot.plot(data)
vrange = p.get_data_range()
assert vrange[0:2] == [[0, 5], [0, 2]]
def test_plot_numpy_2d(flint_session):
data = numpy.arange(10 * 10)
data.shape = 10, 10
p = plot.plot(data)
vrange = p.get_data_range()
assert vrange[0:2] == [[0, 10], [0, 10]]
def test_plot_numpy_3d(flint_session):
data = numpy.arange(10 * 10 * 10)
data.shape = 10, 10, 10
p = plot.plot(data)
vrange = p.get_data_range()
assert vrange[0:2] == [[0, 10], [0, 10]]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment