Skip to content

Commit 85d5df6

Browse files
committed
BF: check for dict needs to come first to avoid TypeError: unhashable type: 'dict'
1 parent 251cd81 commit 85d5df6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

surfer/viz.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,15 +552,15 @@ def _get_geo_params(self, cortex, alpha=1.0):
552552
bone=(dict(colormap="bone",
553553
vmin=-.2, vmax=2,
554554
opacity=alpha), True, True))
555-
if cortex in colormap_map:
555+
if isinstance(cortex, dict):
556+
geo_params = cortex, False, True
557+
if not geo_params[0].has_key('opacity'):
558+
geo_params[0]['opacity'] = alpha
559+
elif cortex in colormap_map:
556560
geo_params = colormap_map[cortex]
557561
elif cortex in lut_manager.lut_mode_list():
558562
geo_params = dict(colormap=cortex, vmin=-1, vmax=2,
559563
opacity=alpha), False, True
560-
elif isinstance(cortex, dict):
561-
geo_params = cortex, False, True
562-
if not geo_params[0].has_key('opacity'):
563-
geo_params[0]['opacity'] = alpha
564564
# check for None before checking len:
565565
elif cortex is None:
566566
geo_params = dict(color=(0.5, 0.5, 0.5),

0 commit comments

Comments
 (0)