Skip to content

Commit 0a141ca

Browse files
committed
Added MANIFEST.in
1 parent 15263a1 commit 0a141ca

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ before_install:
1313
- travis_retry conda create --yes -n TEST $CONDA --file requirements.txt
1414
- source activate TEST
1515
- travis_retry conda install --yes pytest
16+
# GUI
17+
- "export DISPLAY=:99.0"
18+
- "sh -e /etc/init.d/xvfb start"
1619

1720
script:
1821
- python setup.py test

MANIFEST.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include README.rst
2+
include *.txt
3+
recursive-include cmocean *.txt
4+
recursive-include cmocean *.py

tests/test_cmocean.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ def test_cmap_import():
1212
1313
'''
1414

15-
import cmocean
16-
17-
# find all methods in cmocean
18-
methods = dir(cmocean)
19-
20-
# loop through all methods in cmocean
21-
for method in methods:
22-
23-
# see if method is a colormap
24-
if type(eval('cmocean.' + method)) == matplotlib.colors.LinearSegmentedColormap:
15+
from cmocean import cm
16+
# Loop through all methods in cmocean.
17+
for name, cmap in vars(cm).items():
18+
# See if it is a colormap.
19+
if isinstance(cmap, matplotlib.colors.LinearSegmentedColormap):
20+
print(name)
2521
x = np.linspace(0, 10)
2622
X, _ = np.meshgrid(x, x)
2723
plt.figure()
28-
plt.pcolor(X, cmap=eval('cmocean.' + method))
24+
plt.pcolor(X, cmap=cmap)
25+
plt.title(name)

0 commit comments

Comments
 (0)