-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring of exporter tests and updates to package data.
- Loading branch information
Showing
24 changed files
with
117 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_jupyter.bqplot.histogram import BqplotHistogramView | ||
|
||
from .base import TestBqplotExporter | ||
from .test_base import TestBqplotExporter | ||
|
||
|
||
class TestHistogram(TestBqplotExporter): | ||
|
||
viewer_type = BqplotHistogramView | ||
tool_id = 'save:bqplot_plotlyhist' | ||
|
||
def make_data(self): | ||
def test_data(self): | ||
return Data(x=[40, 41, 37, 63, 78, 35, 19, 100, 35, 86, 84, 99, | ||
87, 56, 2, 71, 22, 36, 10, 1, 26, 70, 45, 20, 8], | ||
label='d1') | ||
|
||
def test_default(self, tmpdir): | ||
output_path = self.export_figure(tmpdir, 'test_default.html') | ||
assert os.path.exists(output_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_jupyter.bqplot.image import BqplotImageView | ||
|
||
from numpy import arange, ones | ||
|
||
from .base import TestBqplotExporter | ||
from .test_base import TestBqplotExporter | ||
|
||
|
||
class TestImage(TestBqplotExporter): | ||
|
||
viewer_type = BqplotImageView | ||
tool_id = 'save:bqplot_plotlyimage' | ||
tool_id = 'save:bqplot_plotlyimage2d' | ||
|
||
def make_data(self): | ||
def test_data(self): | ||
return Data(label='d1', x=arange(24).reshape((2, 3, 4)), y=ones((2, 3, 4))) | ||
|
||
def test_default(self, tmpdir): | ||
output_path = self.export_figure(tmpdir, 'test_default.html') | ||
assert os.path.exists(output_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_jupyter.bqplot.profile import BqplotProfileView | ||
|
||
from .base import TestBqplotExporter | ||
from .test_base import TestBqplotExporter | ||
|
||
|
||
class TestProfile(TestBqplotExporter): | ||
|
||
viewer_type = BqplotProfileView | ||
tool_id = 'save:bqplot_plotlyprofile' | ||
|
||
def make_data(self): | ||
def test_data(self): | ||
return Data(x=[40, 41, 37, 63, 78, 35, 19, 100, 35, 86, 84, 99, | ||
87, 56, 2, 71, 22, 36, 10, 1, 26, 70, 45, 20, 8], | ||
label='d1') | ||
|
||
def test_default(self, tmpdir): | ||
output_path = self.export_figure(tmpdir, 'test_default.html') | ||
assert os.path.exists(output_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_jupyter.bqplot.scatter import BqplotScatterView | ||
|
||
from .base import TestBqplotExporter | ||
from .test_base import TestBqplotExporter | ||
|
||
|
||
class TestScatter2D(TestBqplotExporter): | ||
|
||
viewer_type = BqplotScatterView | ||
tool_id = 'save:bqplot_plotly2d' | ||
|
||
def make_data(self): | ||
def test_data(self): | ||
return Data(x=[1, 2, 3], y=[4, 5, 6], z=[7, 8, 9], label='d1') | ||
|
||
def test_default(self, tmpdir): | ||
output_path = self.export_figure(tmpdir, 'test_default.html') | ||
assert os.path.exists(output_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_qt.viewers.histogram import HistogramViewer | ||
|
||
from .base import TestQtExporter | ||
from .test_base import TestQtExporter | ||
|
||
|
||
class TestHistogram(TestQtExporter): | ||
|
||
viewer_type = HistogramViewer | ||
tool_id = 'save:plotlyhist' | ||
|
||
def setup_method(self, method): | ||
super().setup_method(method) | ||
self.viewer.state.x_att = self.data.id['x'] | ||
self.viewer.state.hist_n_bin = 6 | ||
|
||
def make_data(self): | ||
return Data(x=[40, 41, 37, 63, 78, 35, 19, 100, 35, 86, 84, 99, | ||
87, 56, 2, 71, 22, 36, 10, 1, 26, 70, 45, 20, 8], | ||
label='d1') | ||
|
||
def test_default(self, tmpdir): | ||
self.viewer.state.x_att = self.data.id['x'] | ||
self.viewer.state.hist_n_bin = 6 | ||
output_path = self.export_figure(tmpdir, 'test_default.html') | ||
assert os.path.exists(output_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import os | ||
|
||
from glue.core import Data | ||
from glue_qt.viewers.image.data_viewer import ImageViewer | ||
|
||
from numpy import arange, ones | ||
|
||
from .base import TestQtExporter | ||
from .test_base import TestQtExporter | ||
|
||
|
||
class TestImage(TestQtExporter): | ||
|
||
viewer_type = ImageViewer | ||
tool_id = 'save:plotlyimage' | ||
tool_id = 'save:plotlyimage2d' | ||
|
||
def make_data(self): | ||
return Data(label='d1', x=arange(24).reshape((2, 3, 4)), y=ones((2, 3, 4))) | ||
|
||
def test_default(self, tmpdir): | ||
output_path = self.export_figure(tmpdir, 'test.html') | ||
assert os.path.exists(output_path) |
Oops, something went wrong.