Skip to content

Commit b36bdd4

Browse files
authored
Merge pull request #215 from yarikoptic/enh-codespell
chore: add codespell support (config, workflow to detect/not fix) and make it fix some typos
2 parents 689b547 + 3c52530 commit b36bdd4

14 files changed

Lines changed: 56 additions & 79 deletions

File tree

.github/workflows/codespell.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Codespell configuration is within pyproject.toml
2+
---
3+
name: Codespell
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
codespell:
16+
name: Check for spelling errors
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Annotate locations with typos
23+
uses: codespell-project/codespell-problem-matcher@v1
24+
- name: Codespell
25+
uses: codespell-project/actions-codespell@v2
26+
with:
27+
ignore_words_list: sortings,trough

TODO.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/source/views.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Controls
1212
~~~~~~~~
1313
- **left click** : select single unit
1414
- **ctrl + left click** : add unit to selection
15-
- **mouse drag from within circle** : change channel visibilty and unit visibility on other views
15+
- **mouse drag from within circle** : change channel visibility and unit visibility on other views
1616
- **mouse drag from "diamond"** : change channel / unit radii size
1717

1818
Screenshots

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,10 @@ docs = [
6464
"sphinx>=5.0",
6565
"sphinx_rtd_theme",
6666
]
67+
68+
[tool.codespell]
69+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
70+
skip = '.git*,pyproject.toml'
71+
check-hidden = true
72+
# ignore-regex = ''
73+
ignore-words-list = 'nd,gaus'

spikeinterface_gui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Some design notes:
33
* controller is a layer between spikeinterface objects and every view
4-
* every view can notify some signals to other view that are centralized bu the controller
4+
* every view can notify some signals to other view that are centralized by the controller
55
* views have settings
66
* views have 2 implementations : qt (legacy) and panel (for the web)
77
They need to implement the make_layout and the refresh for each backends (qt, panel).

spikeinterface_gui/backend_panel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def __init__(self, controller, layout_dict=None, user_settings=None):
207207
self.make_views(user_settings)
208208
self.create_main_layout()
209209

210-
# refresh all views wihtout notiying
210+
# refresh all views without notiying
211211
self.controller.signal_handler.deactivate()
212212
self.controller.signal_handler.activate()
213213

@@ -286,7 +286,7 @@ def create_main_layout(self):
286286
layout_zone = {}
287287
self.all_tabs = []
288288
for zone, view_names in preset.items():
289-
# keep only instanciated views
289+
# keep only instantiated views
290290
view_names = [view_name for view_name in view_names if view_name in self.view_layouts.keys()]
291291

292292
if len(view_names) == 0:

spikeinterface_gui/backend_qt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def notify_unit_color_changed(self):
4848
self.unit_color_changed.emit()
4949

5050

51-
# Used by controler to handle/callback signals
51+
# Used by controller to handle/callback signals
5252
class SignalHandler(QT.QObject):
5353
def __init__(self, controller, parent=None):
5454
QT.QObject.__init__(self, parent=parent)
@@ -171,13 +171,13 @@ def __init__(self, controller, parent=None, layout_dict=None, user_settings=None
171171
self.make_views(user_settings)
172172
self.create_main_layout()
173173

174-
# refresh all views wihtout notiying
174+
# refresh all views without notiying
175175
self.controller.signal_handler.deactivate()
176176
for view in self.views.values():
177177
# refresh do not work because view are not yet visible at init
178178
view._refresh()
179179
self.controller.signal_handler.activate()
180-
# TODO sam : all veiws are always refreshed at the moment so this is useless.
180+
# TODO sam : all views are always refreshed at the moment so this is useless.
181181
# uncommen this when ViewBase.is_view_visible() work correctly
182182
# for view_name, dock in self.docks.items():
183183
# dock.visibilityChanged.connect(self.views[view_name].refresh)

spikeinterface_gui/controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(
8484
self.main_settings.update(user_main_settings)
8585

8686
self.num_channels = self.analyzer.get_num_channels()
87-
# this now private and shoudl be acess using function
87+
# this now private and should be access using function
8888
self._visible_unit_ids = [self.unit_ids[0]]
8989

9090
# sparsity
@@ -574,7 +574,7 @@ def get_visible_unit_ids(self):
574574
return self._visible_unit_ids
575575

576576
def get_visible_unit_indices(self):
577-
"""Get list of indicies of visible units"""
577+
"""Get list of indices of visible units"""
578578
unit_ids = list(self.unit_ids)
579579
visible_unit_indices = [unit_ids.index(u) for u in self._visible_unit_ids]
580580
return visible_unit_indices

spikeinterface_gui/ndscatterview.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, controller=None, parent=None, backend="qt"):
3939
self.selected_comp = np.ones((ndim), dtype='bool')
4040
self.projection = self.get_one_random_projection()
4141

42-
#estimate limts
42+
#estimate limits
4343
data = self.data
4444
if data.shape[0] > 1000:
4545
inds = np.random.choice(data.shape[0], 1000, replace=False)
@@ -281,7 +281,7 @@ def _qt_refresh(self, update_components=True, update_colors=True):
281281
self.update_selected_components()
282282

283283
#ndscatter
284-
# TODO sam: I have the feeling taht it is a bit slow
284+
# TODO sam: I have the feeling that it is a bit slow
285285
self.scatter.clear()
286286

287287
# scatter_x, scatter_y, spike_indices, selected_scatter_x, selected_scatter_y = self.get_plotting_data(concatenated=True)
@@ -298,7 +298,7 @@ def _qt_refresh(self, update_components=True, update_colors=True):
298298
self.scatter_select.setData(selected_scatter_x, selected_scatter_y)
299299

300300

301-
# TODO sam : kepp the old implementation in mind
301+
# TODO sam : keep the old implementation in mind
302302
# for unit_index, unit_id in enumerate(self.controller.unit_ids):
303303
# if not self.controller.get_unit_visibility(unit_id):
304304
# continue
@@ -368,7 +368,7 @@ def _qt_on_lasso_finished(self, points, shift_held=False):
368368
vertices = np.array(points)
369369
self._lasso_vertices.append(vertices)
370370

371-
# inside lasso and visibles
371+
# inside lasso and visible
372372
ind_visibles, = np.nonzero(np.isin(self.random_spikes_indices, self.controller.get_indices_spike_visible()))
373373
projected = self.apply_dot(self.data[ind_visibles, :])
374374
inside = inside_poly(projected, vertices)
@@ -569,7 +569,7 @@ def _on_panel_selection_geometry(self, event):
569569
else:
570570
self._lasso_vertices = [polygon]
571571

572-
# inside lasso and visibles
572+
# inside lasso and visible
573573
ind_visibles, = np.nonzero(np.isin(self.random_spikes_indices, self.controller.get_indices_spike_visible()))
574574
inds = self.random_spikes_indices[ind_visibles[selected]]
575575
self.controller.set_indices_spike_selected(inds)

spikeinterface_gui/probeview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,6 @@ def circle_from_roi(roi):
761761
### Controls
762762
- **left click** : select single unit
763763
- **ctrl + left click** : add unit to selection
764-
- **mouse drag from within circle** : change channel visibilty and unit visibility on other views
764+
- **mouse drag from within circle** : change channel visibility and unit visibility on other views
765765
- **mouse drag from "diamond"** : change channel / unit radii size
766766
"""

0 commit comments

Comments
 (0)