Skip to content

Commit

Permalink
Set matplotlib backend for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRyanIrish committed Mar 28, 2018
1 parent 47f8ec3 commit b80dc28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ matrix:

include:

# Add a matploblib backend for generating plots in tests.
- env: MPLBACKEND='Agg'
# Add a matplotlib backend for generating plots in tests.
- env: MPLBACKEND='Agg'

# Do a basic test.
- os: linux
Expand Down
4 changes: 2 additions & 2 deletions ndcube/mixins/sequence_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def plot(self, axes=None, plot_axis_indices=None,
Returns
-------
ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence` # noqa
ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence`
Axes or animation object depending on dimensionality of NDCubeSequence
"""
Expand Down Expand Up @@ -184,7 +184,7 @@ def plot_as_cube(self, axes=None, plot_axis_indices=None,
Returns
-------
ax: ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence` # noqa
ax: ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence`
Axes or animation object depending on dimensionality of NDCubeSequence
"""
Expand Down
3 changes: 3 additions & 0 deletions ndcube/tests/test_sequence_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
from ndcube.utils.wcs import WCS
import ndcube.mixins.sequence_plotting

# Set matplotlib display for testing
matplotlib.use('Agg')

# sample data for tests
# TODO: use a fixture reading from a test file. file TBD.
data = np.array([[[1, 2, 3, 4], [2, 4, 5, 3], [0, -1, 2, 3]],
Expand Down

0 comments on commit b80dc28

Please sign in to comment.