Skip to content

Commit 6b66d61

Browse files
committed
NF: added more tests and small fix
1 parent de69f0a commit 6b66d61

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

surfer/tests/test_viz.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ def test_brains():
7373
# testing backend breaks when passing in a figure, so we use 'auto' here
7474
# (shouldn't affect usability, but it makes testing more annoying)
7575
mlab.options.backend = 'auto'
76-
surfs = ['inflated', 'white', 'white', 'white']
77-
hemis = ['lh', 'rh', 'both', 'both']
78-
titles = [None, 'Hello', 'Good bye!', 'lut test']
76+
surfs = ['inflated', 'white', 'white', 'white', 'white', 'white', 'white']
77+
hemis = ['lh', 'rh', 'both', 'both', 'rh', 'both', 'both']
78+
titles = [None, 'Hello', 'Good bye!', 'lut test', 'dict test', 'None test', 'RGB test']
7979
cortices = ["low_contrast", ("Reds", 0, 1, False), 'hotpink',
80-
['yellow', 'blue']]
81-
sizes = [500, (400, 300), (300, 300), (300, 400)]
82-
backgrounds = ["white", "blue", "black", '0.75']
83-
foregrounds = ["black", "white", "0.75", 'red']
84-
figs = [None, mlab.figure(), None, None]
85-
subj_dirs = [None, subj_dir, subj_dir, subj_dir]
86-
alphas = [1.0, 0.5, 0.25, 0.7]
80+
['yellow', 'blue'], dict(colormap='Grays'), None, (0.5, 0.5, 0.5)]
81+
sizes = [500, (400, 300), (300, 300), (300, 400), 500, 400, 300]
82+
backgrounds = ["white", "blue", "black", "0.75", (0.2, 0.2, 0.2), "black", "0.75"]
83+
foregrounds = ["black", "white", "0.75", "red", (0.2, 0.2, 0.2), "blue", "black"]
84+
figs = [None, mlab.figure(), None, None, mlab.figure(), None, None]
85+
subj_dirs = [None, subj_dir, subj_dir, subj_dir, subj_dir, subj_dir, subj_dir]
86+
alphas = [1.0, 0.5, 0.25, 0.7, 0.5, 0.25, 0.7]
8787
for surf, hemi, title, cort, s, bg, fg, fig, sd, alpha \
8888
in zip(surfs, hemis, titles, cortices, sizes,
8989
backgrounds, foregrounds, figs, subj_dirs, alphas):

surfer/viz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def _get_geo_params(self, cortex, alpha=1.0):
591591
color = colorConverter.to_rgb(cortex)
592592
geo_params = dict(color=color, opacity=alpha), False, False
593593
except ValueError:
594-
pass
594+
geo_params = cortex, False, True
595595
# check for None before checking len:
596596
elif cortex is None:
597597
geo_params = dict(color=(0.5, 0.5, 0.5),

0 commit comments

Comments
 (0)