Skip to content

Commit

Permalink
BUG: Fixes [circle full]
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Oct 22, 2020
1 parent 3ab92c9 commit 278608f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 0 additions & 1 deletion mne/minimum_norm/spatial_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def _localisation_error(resmat, src, function, metric):
return locerr


#@profile
def _spatial_extent(resmat, src, function, metric, threshold=0.5):
"""Compute spatial width metrics for resolution matrix.
Expand Down
25 changes: 16 additions & 9 deletions mne/viz/_brain/_brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,9 @@ def _clean(self):
# app_window cannot be set to None because it is used in __del__
for key in ('lighting', 'interactor', '_RenderWindow'):
setattr(self.plotter, key, None)

class FakeIren():
def LeaveEvent(self):
pass

def SetEventInformation(self, *args, **kwargs):
pass
# Qt LeaveEvent requires _Iren so we use FakeIren instead of None
# Qt LeaveEvent requires _Iren so we use _FakeIren instead of None
# to resolve the ref to vtkGenericRenderWindowInteractor
self.plotter._Iren = FakeIren()
self.plotter._Iren = _FakeIren()
if getattr(self.plotter, 'scalar_bar', None) is not None:
self.plotter.scalar_bar = None
if getattr(self.plotter, 'picker', None) is not None:
Expand Down Expand Up @@ -2968,3 +2961,17 @@ def _get_range(brain):

def _normalize(point, shape):
return (point[0] / shape[1], point[1] / shape[0])


class _FakeIren():
def EnterEvent(self):
pass

def MouseMoveEvent(self):
pass

def LeaveEvent(self):
pass

def SetEventInformation(self, *args, **kwargs):
pass
2 changes: 1 addition & 1 deletion mne/viz/_brain/tests/test_brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def test_brain_linkviewer(renderer_interactive, brain_gc):
brain_data.close()


def test_brain_colormap(brain_gc):
def test_calculate_lut():
"""Test brain's colormap functions."""
colormap = "coolwarm"
alpha = 1.0
Expand Down

0 comments on commit 278608f

Please sign in to comment.