Skip to content

Commit

Permalink
Windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rossant committed Jun 4, 2019
1 parent 2390e15 commit 47655e4
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ dependencies:
- requests
- traitlets
- tqdm
- six
- joblib
- click
1 change: 0 additions & 1 deletion installer/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies:
- vispy
- requests
- traitlets
- six
- joblib
- click
- tqdm
2 changes: 1 addition & 1 deletion phy/apps/template/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_template_gui_split_amplitude(qtbot, tempdir, template_controller):

av = gui.list_views(AmplitudeView)[0]

a, b = 50, 1000
a, b = 10, 1000
mouse_click(qtbot, av.canvas, (a, a), modifiers=('Control',))
mouse_click(qtbot, av.canvas, (a, b), modifiers=('Control',))
mouse_click(qtbot, av.canvas, (b, b), modifiers=('Control',))
Expand Down
2 changes: 1 addition & 1 deletion phy/cluster/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def split(self, spike_ids=None, spike_clusters_rel=0):
if spike_ids is None:
# Concatenate all spike_ids returned by views who respond to request_split.
spike_ids = emit('request_split', self)
spike_ids = np.concatenate(spike_ids)
spike_ids = np.concatenate(spike_ids).astype(np.int64)
assert spike_ids.dtype == np.int64
assert spike_ids.ndim == 1
if len(spike_ids) == 0:
Expand Down
4 changes: 3 additions & 1 deletion phy/cluster/views/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ def test_manual_clustering_view_1(qtbot, tempdir):
v.set_state({'auto_update': False})
assert v.auto_update is False

qtbot.wait(1)
qtbot.wait(10)

path = v.screenshot(dir=tempdir)
qtbot.wait(10)

assert str(path).startswith(str(tempdir))
assert path.exists()

Expand Down
4 changes: 3 additions & 1 deletion phy/gui/tests/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#------------------------------------------------------------------------------

import logging
import os
import shutil

from ..state import GUIState, _gui_state_path, _get_default_state_path, _filter_nested_dict
Expand All @@ -24,7 +25,8 @@ class MyClass(object):


def test_get_default_state_path():
assert str(_get_default_state_path(MyClass())).endswith('gui/tests/static/state.json')
assert str(_get_default_state_path(MyClass())).endswith(
os.sep.join(('gui', 'tests', 'static', 'state.json')))


def test_gui_state_view_1(tempdir):
Expand Down
5 changes: 3 additions & 2 deletions phy/plot/panzoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,9 @@ def imap(self, arr):
return arr

def update_visual(self, visual):
visual.program[self.pan_var_name] = self._pan
visual.program[self.zoom_var_name] = self._zoom_aspect()
if hasattr(visual, 'program'):
visual.program[self.pan_var_name] = self._pan
visual.program[self.zoom_var_name] = self._zoom_aspect()

def update(self):
"""Update all visuals in the attached canvas."""
Expand Down
4 changes: 2 additions & 2 deletions phy/utils/tests/test_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def test_benchmark():


@mark.parametrize('line_by_line', [False, True])
def test_profile(chdir_tempdir, line_by_line):
def test_profile(tempdir, line_by_line):
# Remove the profile from the builtins.
prof = _enable_profiler(line_by_line=line_by_line)
_profile(prof, 'import time; time.sleep(.001)', {}, {})
assert (chdir_tempdir / '.profile/stats.txt').exists()
assert (tempdir / '.profile/stats.txt').exists()
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ requests
traitlets
qtconsole
tqdm
six
joblib
click
mkdocs==1.0.4
4 changes: 1 addition & 3 deletions tools/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import re
import sys

from six import string_types


#------------------------------------------------------------------------------
# Utility functions
Expand Down Expand Up @@ -112,7 +110,7 @@ def _import_module(module_name):
#------------------------------------------------------------------------------

def _is_public(obj):
name = _name(obj) if not isinstance(obj, string_types) else obj
name = _name(obj) if not isinstance(obj, str) else obj
if name:
return not name.startswith('_')
else:
Expand Down
4 changes: 1 addition & 3 deletions tools/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import re
from subprocess import call

import six
from six.moves import input
from github3 import login


Expand Down Expand Up @@ -59,7 +57,7 @@ def _update_version(dev_n='+1', dev=True):

def func(m):
if dev:
if isinstance(dev_n, six.string_types):
if isinstance(dev_n, str):
n = int(m.group(3)) + int(dev_n)
assert n >= 0
else:
Expand Down

0 comments on commit 47655e4

Please sign in to comment.