File tree 3 files changed +15
-11
lines changed
3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ before_install:
13
13
- travis_retry conda create --yes -n TEST $CONDA --file requirements.txt
14
14
- source activate TEST
15
15
- travis_retry conda install --yes pytest
16
+ # GUI
17
+ - " export DISPLAY=:99.0"
18
+ - " sh -e /etc/init.d/xvfb start"
16
19
17
20
script :
18
21
- python setup.py test
Original file line number Diff line number Diff line change
1
+ include README.rst
2
+ include *.txt
3
+ recursive-include cmocean *.txt
4
+ recursive-include cmocean *.py
Original file line number Diff line number Diff line change @@ -12,17 +12,14 @@ def test_cmap_import():
12
12
13
13
'''
14
14
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 )
25
21
x = np .linspace (0 , 10 )
26
22
X , _ = np .meshgrid (x , x )
27
23
plt .figure ()
28
- plt .pcolor (X , cmap = eval ('cmocean.' + method ))
24
+ plt .pcolor (X , cmap = cmap )
25
+ plt .title (name )
You can’t perform that action at this time.
0 commit comments