From d27fae5d8c1be6fceb1dc71108fc24e02d415f8b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Oct 2025 10:35:58 -0400 Subject: [PATCH 1/4] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..12f226ab --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within setup.cfg +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From ba5288bbae772f62fe0028123dd9eacf69cb88e4 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Oct 2025 10:35:58 -0400 Subject: [PATCH 2/4] Add rudimentary codespell config --- setup.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.cfg b/setup.cfg index 944f7258..fb48628e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,3 +35,10 @@ exclude_lines = omit = */phy/plot/gloo/* show_missing = True + +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.css,*.min.* +check-hidden = true +# ignore-regex = +ignore-words-list = thist From ddfb4d0531f9ca9934369a60ca4ee4ac231159e7 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Oct 2025 10:40:57 -0400 Subject: [PATCH 3/4] [DATALAD RUNCMD] run codespell throughout fixing typos automagically (but ignoring overall fail due to ambigous ones) === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- README.md | 2 +- docs/api.md | 140 +++++++++++++-------------- docs/clustering.md | 2 +- docs/customization.md | 2 +- docs/plugins.md | 2 +- docs/release.md | 4 +- docs/visualization.md | 4 +- phy/apps/base.py | 22 ++--- phy/apps/template/tests/test_gui.py | 2 +- phy/cluster/clustering.py | 2 +- phy/cluster/tests/test_clustering.py | 2 +- phy/cluster/views/base.py | 18 ++-- phy/cluster/views/histogram.py | 2 +- phy/gui/gui.py | 2 +- phy/plot/gloo/atlas.py | 2 +- phy/plot/gloo/program.py | 2 +- phy/plot/gloo/uniforms.py | 4 +- phy/plot/gloo/variable.py | 4 +- phy/plot/glsl/line_agg_geom.geom | 2 +- phy/utils/__init__.py | 2 +- plugins/README.md | 2 +- plugins/feature_view_custom_grid.py | 2 +- 22 files changed, 113 insertions(+), 113 deletions(-) diff --git a/README.md b/README.md index 219de69d..c111da10 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Phy provides two GUIs: ## Hardware requirements -It is recommanded to store the data on a SSD for performance reasons. +It is recommended to store the data on a SSD for performance reasons. There are no specific GPU requirements as long as relatively recent graphics and OpenGL drivers are installed on the system. diff --git a/docs/api.md b/docs/api.md index 92319ed3..4637d4b4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -150,7 +150,7 @@ phy: interactive visualization and manual spike sorting of large-scale ephys dat ## phy.utils -Utilities: plugin system, event system, configuration system, profiling, debugging, cacheing, +Utilities: plugin system, event system, configuration system, profiling, debugging, caching, basic read/write functions. --- @@ -1128,7 +1128,7 @@ A Qt main window containing docking widgets. This class derives from `QMainWindo view class. * `default_views : list-like` - List of view names to create by default (overriden by `view_count` if not empty). + List of view names to create by default (overridden by `view_count` if not empty). * `config_dir : str or Path` User configuration directory used to load/save the GUI state @@ -5804,7 +5804,7 @@ Switch to the next amplitudes type. **`AmplitudeView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -5846,7 +5846,7 @@ Return the spikes enclosed by the lasso. **`AmplitudeView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -5905,7 +5905,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -5969,7 +5969,7 @@ Size of the spike markers, in pixels. **`AmplitudeView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -6224,7 +6224,7 @@ Switch to the next color scheme. **`ClusterScatterView.on_cluster(self, sender, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -6257,7 +6257,7 @@ Change the scaling with the wheel. **`ClusterScatterView.on_select(self, *args, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -6388,7 +6388,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -6506,7 +6506,7 @@ Size of the spike markers, in pixels. **`ClusterScatterView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -6898,7 +6898,7 @@ results in a new cluster id being assigned. If a spike is assigned to a new cluster, then all other spikes belonging to the same cluster are assigned to a brand new cluster, -even if they were not changed explicitely by the `assign()` method. +even if they were not changed explicitly by the `assign()` method. In other words, the list of spikes affected by an `assign()` is almost always a strict superset of the `spike_ids` parameter. The only case @@ -7149,7 +7149,7 @@ Increase the window size. **`CorrelogramView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -7173,7 +7173,7 @@ Change the scaling with the wheel. **`CorrelogramView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -7243,7 +7243,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -7309,7 +7309,7 @@ Change the normalization of the correlograms. **`CorrelogramView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -7426,7 +7426,7 @@ Increase the scaling parameter. **`FeatureView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -7468,7 +7468,7 @@ Return the spikes enclosed by the lasso. **`FeatureView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -7554,7 +7554,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -7609,7 +7609,7 @@ Size of the spike markers, in pixels. **`FeatureView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -7680,7 +7680,7 @@ Increase the scaling parameter. **`FiringRateView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -7704,7 +7704,7 @@ Change the scaling with the wheel. **`FiringRateView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -7772,7 +7772,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -7836,7 +7836,7 @@ Return the bin size (in seconds or milliseconds depending on `self.bin_unit`). **`FiringRateView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -7852,7 +7852,7 @@ GUI is closed. To be overriden. ### phy.cluster.HistogramView This view displays a histogram for every selected cluster, along with a possible plot -and some text. To be overriden. +and some text. To be overridden. **Constructor** @@ -7914,7 +7914,7 @@ Increase the scaling parameter. **`HistogramView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -7938,7 +7938,7 @@ Change the scaling with the wheel. **`HistogramView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -8006,7 +8006,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -8070,7 +8070,7 @@ Return the bin size (in seconds or milliseconds depending on `self.bin_unit`). **`HistogramView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -8141,7 +8141,7 @@ Increase the scaling parameter. **`ISIView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -8165,7 +8165,7 @@ Change the scaling with the wheel. **`ISIView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -8233,7 +8233,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -8297,7 +8297,7 @@ Return the bin size (in seconds or milliseconds depending on `self.bin_unit`). **`ISIView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -8374,7 +8374,7 @@ To override. **`ManualClusteringView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -8389,7 +8389,7 @@ selected clusters (template view, raster view). **`ManualClusteringView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -8430,7 +8430,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -8467,7 +8467,7 @@ When on, the view is automatically updated when the cluster selection changes. **`ManualClusteringView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -8476,7 +8476,7 @@ GUI is closed. To be overriden. **`ManualClusteringView.status`** -To be overriden. +To be overridden. --- @@ -8536,7 +8536,7 @@ To override. **`ProbeView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -8592,7 +8592,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -8638,7 +8638,7 @@ Toggle the display of the channel ids. **`ProbeView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -8647,7 +8647,7 @@ GUI is closed. To be overriden. **`ProbeView.status`** -To be overriden. +To be overridden. --- @@ -8754,7 +8754,7 @@ Switch to the next color scheme. **`RasterView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -8787,7 +8787,7 @@ Change the scaling with the wheel. **`RasterView.on_select(self, *args, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -8864,7 +8864,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -8955,7 +8955,7 @@ Size of the spike markers, in pixels. **`RasterView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -9030,7 +9030,7 @@ Increase the scaling parameter. **`ScatterView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -9063,7 +9063,7 @@ Return the spikes enclosed by the lasso. **`ScatterView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -9113,7 +9113,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -9159,7 +9159,7 @@ Size of the spike markers, in pixels. **`ScatterView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -9168,7 +9168,7 @@ GUI is closed. To be overriden. **`ScatterView.status`** -To be overriden. +To be overridden. --- @@ -9934,7 +9934,7 @@ Switch to the next color scheme. **`TemplateView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -9967,7 +9967,7 @@ Change the scaling with the wheel. **`TemplateView.on_select(self, *args, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -10044,7 +10044,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -10126,7 +10126,7 @@ Return the grid scaling. **`TemplateView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -10345,7 +10345,7 @@ Switch to the next color scheme. **`TraceImageView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -10378,7 +10378,7 @@ Scroll through the data with alt+wheel. **`TraceImageView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -10446,7 +10446,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -10610,7 +10610,7 @@ Scaling of the colormap vrange. **`TraceImageView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -10843,7 +10843,7 @@ Switch to the next color scheme. **`TraceView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -10876,7 +10876,7 @@ Scroll through the data with alt+wheel. **`TraceView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -10944,7 +10944,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -11108,7 +11108,7 @@ Scaling of the channel boxes. **`TraceView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -11293,7 +11293,7 @@ Switch to the next waveforms type. **`WaveformView.on_cluster(self, up)`** -Callback function when a clustering action occurs. May be overriden. +Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -11326,7 +11326,7 @@ Change the scaling with the wheel. **`WaveformView.on_select(self, cluster_ids=None, **kwargs)`** -Callback function when clusters are selected. May be overriden. +Callback function when clusters are selected. May be overridden. --- @@ -11385,7 +11385,7 @@ Set the view state. The passed object is the persisted `self.state` bunch. -May be overriden. +May be overridden. --- @@ -11512,7 +11512,7 @@ Whether to overlap the waveforms belonging to different clusters. **`WaveformView.state`** View state, a Bunch instance automatically persisted in the GUI state when the -GUI is closed. To be overriden. +GUI is closed. To be overridden. --- @@ -11645,7 +11645,7 @@ Base controller for manual clustering GUI. **Methods to override** -The main methods that can be overriden when implementing a custom `Controller` are: +The main methods that can be overridden when implementing a custom `Controller` are: * `_create_model() : None => object` @@ -11737,7 +11737,7 @@ save_metadata(name, values) : str, dict => None The Model represents data as it is stored on disk. When cluster data changes during a manual clustering session (like spike-cluster assignments), the data in the model -is not expected to change (it is rather the responsability of the controller). +is not expected to change (it is rather the responsibility of the controller). The model implements saving option for spike cluster assignments and cluster metadata. @@ -11866,7 +11866,7 @@ Return the channel label of the best channel, for display in the cluster view. **`BaseController.get_best_channels(self, cluster_id)`** -Return the best channels of a given cluster. To be overriden. +Return the best channels of a given cluster. To be overridden. --- @@ -11876,7 +11876,7 @@ Return the best channels of a given cluster. To be overriden. **`BaseController.get_channel_amplitudes(self, cluster_id)`** Return the best channels of a given cluster along with their relative amplitudes. -To be overriden. +To be overridden. --- diff --git a/docs/clustering.md b/docs/clustering.md index 58df0b7f..e5ca8a63 100644 --- a/docs/clustering.md +++ b/docs/clustering.md @@ -40,7 +40,7 @@ For each similar cluster, you can either: * Press `space` to do nothing and go to the next similar cluster. * Press `g` to merge the best and similar clusters, and go to the next similar cluster. -* Press one of the keyboard shortcuts to move either the similar cluster, the best cluster, or both clusters, to either the `good`, `mua`, or `noise` group (there are nine keyboard shorcuts for nine possibilities, see below). The best and/or similar clusters change automatically afterwards. +* Press one of the keyboard shortcuts to move either the similar cluster, the best cluster, or both clusters, to either the `good`, `mua`, or `noise` group (there are nine keyboard shortcuts for nine possibilities, see below). The best and/or similar clusters change automatically afterwards. * Press `backspace` to unselect all similar clusters, and keep only best clusters (in the cluster view) selected. diff --git a/docs/customization.md b/docs/customization.md index 844de8cc..812d702f 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -94,7 +94,7 @@ myevent called with argument 123 The `connect()` function has a few optional parameters. -* `connect(f, event=event)` to specify the event name explicitely, without having to use a special `on_eventname()` name for the function. +* `connect(f, event=event)` to specify the event name explicitly, without having to use a special `on_eventname()` name for the function. * `connect(f, sender=sender)` to restrict the callback to a specific sender. *Note*: events are sent globally in the Python process. diff --git a/docs/plugins.md b/docs/plugins.md index 06398c08..049c733a 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -650,7 +650,7 @@ In this example, we show how to customize the subplots in the feature view. ```python # import from plugins/feature_view_custom_grid.py -"""Show how to customize the subplot grid specifiction in the feature view.""" +"""Show how to customize the subplot grid specification in the feature view.""" import re from phy import IPlugin, connect diff --git a/docs/release.md b/docs/release.md index 04e5c53d..0bcf4804 100644 --- a/docs/release.md +++ b/docs/release.md @@ -52,11 +52,11 @@ Current version is phy v2.0b1 (beta 1) (7 Feb 2020). * New default columns: mean firing rate, and template waveform amplitude * The styling can be customized with CSS in a plugin (see plugin examples in the documentation) * **Amplitude view**: - * Show an histogram of amplitudes overlayed with the amplitudes + * Show an histogram of amplitudes overlaid with the amplitudes * Support for multiple types of amplitudes (template waveform amplitude, raw waveform amplitude, feature amplitude) * Splitting is supported * Alt+click in the amplitude view to center the trace view to a certain time (position shown with the vertical yellow bar) - * Show the time interval currenty displayed in the trace view as a vertical yellow bar + * Show the time interval currently displayed in the trace view as a vertical yellow bar * **Correlogram view**: * Horizontal line for the baseline firing rate * Customizable vertical line for the refractory period diff --git a/docs/visualization.md b/docs/visualization.md index 08908d72..25971eb1 100644 --- a/docs/visualization.md +++ b/docs/visualization.md @@ -75,7 +75,7 @@ The **Cluster view** shows the list of all clusters in your dataset. #### Cluster selection -You can click on one cluster to select it. Select multiple clusters by keeping **Control** or **Shift** pressed. Selected clusters are shown in the different graphical views (detailled below). Clustering actions (merge, split, move, label...) operate on selected clusters. +You can click on one cluster to select it. Select multiple clusters by keeping **Control** or **Shift** pressed. Selected clusters are shown in the different graphical views (detailed below). Clustering actions (merge, split, move, label...) operate on selected clusters. Select quickly one or several cluster(s) by using **snippets**: for example, type `:c 47 49` to select clusters 47 and 49. See [the list of keyboard shortcuts and snippets](shortcuts.md) for more details. @@ -434,7 +434,7 @@ Extra spikes beyond those of the selected clusters are shown in gray. These spik #### Time range -The time interval currenty displayed in the trace view is shown as a vertical yellow bar. You can change the current time range with `Alt+click` in the amplitude view: that will automatically change the time range in the trace view. +The time interval currently displayed in the trace view is shown as a vertical yellow bar. You can change the current time range with `Alt+click` in the amplitude view: that will automatically change the time range in the trace view. #### Keyboard shortcuts diff --git a/phy/apps/base.py b/phy/apps/base.py index 8a169892..3acd868a 100644 --- a/phy/apps/base.py +++ b/phy/apps/base.py @@ -730,7 +730,7 @@ class BaseController(object): Methods to override ------------------- - The main methods that can be overriden when implementing a custom `Controller` are: + The main methods that can be overridden when implementing a custom `Controller` are: _create_model() : None => object Return a Model instance (any object, see below) from the controller constructor's @@ -804,7 +804,7 @@ class BaseController(object): The Model represents data as it is stored on disk. When cluster data changes during a manual clustering session (like spike-cluster assignments), the data in the model - is not expected to change (it is rather the responsability of the controller). + is not expected to change (it is rather the responsibility of the controller). The model implements saving option for spike cluster assignments and cluster metadata. @@ -934,7 +934,7 @@ def __init__( # ------------------------------------------------------------------------- def _create_model(self, dir_path=None, **kwargs): - """Create a model using the constructor parameters. To be overriden.""" + """Create a model using the constructor parameters. To be overridden.""" return def _clear_cache(self): @@ -962,7 +962,7 @@ def _set_cache(self, clear_cache=None): def _set_view_creator(self): """Set the view creator, a dictionary mapping view names to methods creating views. - May be overriden to add specific views. + May be overridden to add specific views. """ self.view_creator = { @@ -1194,16 +1194,16 @@ def get_best_channel_label(self, cluster_id): return self._get_channel_labels([self.get_best_channel(cluster_id)])[0] def get_best_channels(self, cluster_id): # pragma: no cover - """Return the best channels of a given cluster. To be overriden.""" + """Return the best channels of a given cluster. To be overridden.""" logger.warning( - "This method should be overriden and return a non-empty list of best channels.") + "This method should be overridden and return a non-empty list of best channels.") return [] def get_channel_amplitudes(self, cluster_id): # pragma: no cover """Return the best channels of a given cluster along with their relative amplitudes. - To be overriden.""" + To be overridden.""" logger.warning( - "This method should be overriden.") + "This method should be overridden.") return [] def get_channel_shank(self, cluster_id): @@ -1288,7 +1288,7 @@ def _get_amplitude_spike_ids(self, cluster_id, load_all=False): return self.get_spike_ids(cluster_id, n=n) def _amplitude_getter(self, cluster_ids, name=None, load_all=False): - """Return the data requested by the amplitude view, wich depends on the + """Return the data requested by the amplitude view, which depends on the type of amplitude. Parameters @@ -1318,7 +1318,7 @@ def _amplitude_getter(self, cluster_ids, name=None, load_all=False): # Get the amplitude method. f = self._get_amplitude_functions()[name] # Take spikes from the waveform selection if we're loading the raw amplitudes, - # or by minimzing the number of chunks to load if fetching waveforms directly + # or by minimizing the number of chunks to load if fetching waveforms directly # from the raw data. # Otherwise we load the spikes randomly from the whole dataset. subset_chunks = subset_spikes = None @@ -1594,7 +1594,7 @@ def toggle_spike_reorder(checked): logger.debug("%s spike time reordering.", 'Enable' if checked else 'Disable') emit('toggle_spike_reorder', self, checked) - # Action to switch the raw data filter inthe trace and waveform views. + # Action to switch the raw data filter in the trace and waveform views. @gui.view_actions.add(shortcut=self.default_shortcuts['switch_raw_data_filter']) def switch_raw_data_filter(): """Switch the raw data filter.""" diff --git a/phy/apps/template/tests/test_gui.py b/phy/apps/template/tests/test_gui.py index 7c862683..474724be 100644 --- a/phy/apps/template/tests/test_gui.py +++ b/phy/apps/template/tests/test_gui.py @@ -47,7 +47,7 @@ class TemplateControllerTests(GlobalViewsTests, BaseControllerTests): """Base template controller tests.""" @classmethod def _create_dataset(cls, tempdir): # pragma: no cover - """To be overriden in child classes.""" + """To be overridden in child classes.""" raise NotImplementedError() @classmethod diff --git a/phy/cluster/clustering.py b/phy/cluster/clustering.py index 872a49ba..c750b2b5 100644 --- a/phy/cluster/clustering.py +++ b/phy/cluster/clustering.py @@ -384,7 +384,7 @@ def assign(self, spike_ids, spike_clusters_rel=0): If a spike is assigned to a new cluster, then all other spikes belonging to the same cluster are assigned to a brand new cluster, - even if they were not changed explicitely by the `assign()` method. + even if they were not changed explicitly by the `assign()` method. In other words, the list of spikes affected by an `assign()` is almost always a strict superset of the `spike_ids` parameter. The only case diff --git a/phy/cluster/tests/test_clustering.py b/phy/cluster/tests/test_clustering.py index f920c8db..5e7f1d40 100644 --- a/phy/cluster/tests/test_clustering.py +++ b/phy/cluster/tests/test_clustering.py @@ -447,7 +447,7 @@ def test_clustering_long(): spike_clusters_new = spike_clusters.copy() spike_clusters_new[:10] = 100 clustering.spike_clusters[:] = spike_clusters_new[:] - # Need to update explicitely. + # Need to update explicitly. clustering._new_cluster_id = 101 clustering._update_cluster_ids() ae(clustering.cluster_ids, np.r_[np.arange(n_clusters), 100]) diff --git a/phy/cluster/views/base.py b/phy/cluster/views/base.py index 8dadc021..40f1aac9 100644 --- a/phy/cluster/views/base.py +++ b/phy/cluster/views/base.py @@ -136,7 +136,7 @@ def plot(self, **kwargs): # pragma: no cover # ------------------------------------------------------------------------- def on_select(self, cluster_ids=None, **kwargs): - """Callback function when clusters are selected. May be overriden.""" + """Callback function when clusters are selected. May be overridden.""" self.cluster_ids = cluster_ids if not cluster_ids: return @@ -223,7 +223,7 @@ def finished(): self._lock = None def on_cluster(self, up): - """Callback function when a clustering action occurs. May be overriden. + """Callback function when a clustering action occurs. May be overridden. Note: this method is called *before* on_select() so as to give a chance to the view to update itself before the selection of the new clusters. @@ -296,7 +296,7 @@ def _set_floating(): @property def status(self): - """To be overriden.""" + """To be overridden.""" return '' def update_status(self): @@ -322,7 +322,7 @@ def screenshot(self, dir=None): @property def state(self): """View state, a Bunch instance automatically persisted in the GUI state when the - GUI is closed. To be overriden.""" + GUI is closed. To be overridden.""" attrs = set(self.state_attrs + self.local_state_attrs) return Bunch({key: getattr(self, key, None) for key in attrs}) @@ -331,7 +331,7 @@ def set_state(self, state): The passed object is the persisted `self.state` bunch. - May be overriden. + May be overridden. """ logger.debug("Set state for %s.", getattr(self, 'name', self.__class__.__name__)) @@ -367,7 +367,7 @@ class BaseGlobalView(object): This view shows the clusters in the same order as in the cluster view. It reacts to sorting and filtering events. - The `get_cluster_data()` method (to be overriden) must return a list of Bunch instances + The `get_cluster_data()` method (to be overridden) must return a list of Bunch instances with each cluster's data, but also the attributes `cluster_rel`, `cluster_idx`, `cluster_id`. """ @@ -476,7 +476,7 @@ def previous_color_scheme(self): self._neighbor_color_scheme(-1) def update_color(self): - """Update the cluster colors depending on the current color scheme. To be overriden.""" + """Update the cluster colors depending on the current color scheme. To be overridden.""" pass def update_select_color(self): @@ -555,11 +555,11 @@ def on_mouse_wheel(self, e): # pragma: no cover self.decrease() def _get_scaling_value(self): # pragma: no cover - """Return the scaling parameter. May be overriden.""" + """Return the scaling parameter. May be overridden.""" return self.scaling def _set_scaling_value(self, value): # pragma: no cover - """Set the scaling parameter. May be overriden.""" + """Set the scaling parameter. May be overridden.""" self.scaling = value def increase(self): diff --git a/phy/cluster/views/histogram.py b/phy/cluster/views/histogram.py index 6d83e449..13f8dfb0 100644 --- a/phy/cluster/views/histogram.py +++ b/phy/cluster/views/histogram.py @@ -48,7 +48,7 @@ def _first_not_null(*l): class HistogramView(ScalingMixin, ManualClusteringView): """This view displays a histogram for every selected cluster, along with a possible plot - and some text. To be overriden. + and some text. To be overridden. Constructor ----------- diff --git a/phy/gui/gui.py b/phy/gui/gui.py index 947aac5e..cad91aa9 100644 --- a/phy/gui/gui.py +++ b/phy/gui/gui.py @@ -421,7 +421,7 @@ class GUI(QMainWindow): Map view classnames to integers specifying the number of views to create for every view class. default_views : list-like - List of view names to create by default (overriden by `view_count` if not empty). + List of view names to create by default (overridden by `view_count` if not empty). config_dir : str or Path User configuration directory used to load/save the GUI state enable_threading : boolean diff --git a/phy/plot/gloo/atlas.py b/phy/plot/gloo/atlas.py index f3b0933c..611bf128 100644 --- a/phy/plot/gloo/atlas.py +++ b/phy/plot/gloo/atlas.py @@ -64,7 +64,7 @@ def allocate(self, shape): ---------- shape : (int,int) - Shape of region as (heigth, width) + Shape of region as (height, width) Returns ------- diff --git a/phy/plot/gloo/program.py b/phy/plot/gloo/program.py index 242cab28..1e6cd03e 100644 --- a/phy/plot/gloo/program.py +++ b/phy/plot/gloo/program.py @@ -52,7 +52,7 @@ class Program(GLObject): def __init__(self, vertex=None, fragment=None, geometry=None, count=0, version="120"): """ - Initialize the program and optionnaly buffer. + Initialize the program and optionally buffer. """ GLObject.__init__(self) diff --git a/phy/plot/gloo/uniforms.py b/phy/plot/gloo/uniforms.py index 53d2ff8e..bda60f76 100644 --- a/phy/plot/gloo/uniforms.py +++ b/phy/plot/gloo/uniforms.py @@ -80,7 +80,7 @@ class Uniforms(Texture2D): This class is used in conjunction with collections in order to store a number of uniforms in a texture such that each vertices can retrieve a specific group of uniforms. The data type can be structured but must be - reduceable to n x np.float32. Note that you don't need to manipulate + reducible to n x np.float32. Note that you don't need to manipulate directly this function, it is done automagically in collections. .. note:: @@ -89,7 +89,7 @@ class Uniforms(Texture2D): function and is generated specifically for the actual data type. :param int size: Number of items to be stored in the texture - :param numpy.dtype dtype: Item data type (must be reduceable to n x np.float32) + :param numpy.dtype dtype: Item data type (must be reducible to n x np.float32) """ def __init__(self, size, dtype): diff --git a/phy/plot/gloo/variable.py b/phy/plot/gloo/variable.py index c3f4b6b8..5c0307b1 100644 --- a/phy/plot/gloo/variable.py +++ b/phy/plot/gloo/variable.py @@ -5,7 +5,7 @@ """ Variables are entry points in the shader that allow to upload CPU data to the GPU. For OpenGL ES 2.0, there are mainly two types: uniforms and -attributes. The correspondance betwenn GPU and CPU data types is given in the +attributes. The correspondence between GPU and CPU data types is given in the table below. =========== ================== == ================== ============== @@ -320,7 +320,7 @@ def __init__(self, program, name, gtype): # Number of elements this attribute links to (in the attached buffer) self._size = 0 - # Whether this attribure is generic + # Whether this attribute is generic self._generic = False def set_data(self, data): diff --git a/phy/plot/glsl/line_agg_geom.geom b/phy/plot/glsl/line_agg_geom.geom index c779e2bc..fd6d451c 100644 --- a/phy/plot/glsl/line_agg_geom.geom +++ b/phy/plot/glsl/line_agg_geom.geom @@ -19,7 +19,7 @@ varying out vec2 v_bevel_distance; float compute_u(vec2 p0, vec2 p1, vec2 p) { // Projection p' of p such that p' = p0 + u*(p1-p0) - // Then u *= lenght(p1-p0) + // Then u *= length(p1-p0) vec2 v = p1 - p0; float l = length(v); return ((p.x-p0.x)*v.x + (p.y-p0.y)*v.y) / l; diff --git a/phy/utils/__init__.py b/phy/utils/__init__.py index 624ba79a..6acf3798 100644 --- a/phy/utils/__init__.py +++ b/phy/utils/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # flake8: noqa -"""Utilities: plugin system, event system, configuration system, profiling, debugging, cacheing, +"""Utilities: plugin system, event system, configuration system, profiling, debugging, caching, basic read/write functions. """ diff --git a/plugins/README.md b/plugins/README.md index db11d029..16d4cc38 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -8,7 +8,7 @@ * [ExampleColorSchemePlugin](color_scheme.py): Show how to add a custom color scheme to a view. * [ExampleCustomButtonPlugin](custom_button.py): Show how to add custom buttons in a view's title bar. * [ExampleCustomColumnsPlugin](custom_columns.py): Show how to customize the columns in the cluster and similarity views. -* [ExampleCustomFeatureViewPlugin](feature_view_custom_grid.py): Show how to customize the subplot grid specifiction in the feature view. +* [ExampleCustomFeatureViewPlugin](feature_view_custom_grid.py): Show how to customize the subplot grid specification in the feature view. * [ExampleCustomSplitPlugin](custom_split.py): Show how to write a custom split action. * [ExampleFilterFiringRatePlugin](filter_action.py): Show how to create a filter snippet for the cluster view. * [ExampleFontSizePlugin](font_size.py): Show how to change the default text font size. diff --git a/plugins/feature_view_custom_grid.py b/plugins/feature_view_custom_grid.py index 6d384b5f..71e6f8ca 100644 --- a/plugins/feature_view_custom_grid.py +++ b/plugins/feature_view_custom_grid.py @@ -1,4 +1,4 @@ -"""Show how to customize the subplot grid specifiction in the feature view.""" +"""Show how to customize the subplot grid specification in the feature view.""" import re from phy import IPlugin, connect From bb230ca4721cb4b4940367d9fb5833fcbb9f6c85 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Oct 2025 10:44:45 -0400 Subject: [PATCH 4/4] [DATALAD RUNCMD] chore: run codespell throughout fixing a few typos interactively === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 4", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/api.md | 4 ++-- phy/cluster/tests/test_supervisor.py | 2 +- phy/plot/base.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api.md b/docs/api.md index 4637d4b4..e9e869ed 100644 --- a/docs/api.md +++ b/docs/api.md @@ -3054,7 +3054,7 @@ Insert all GLSL snippets in a vertex and fragment shaders. **Notes** -The vertex shader typicall contains `gl_Position = transform(data_var_name);` +The vertex shader typically contains `gl_Position = transform(data_var_name);` which is automatically detected, and the GLSL transformations are inserted there. Snippets can contain `{{var}}` placeholders for the transformed variable name. @@ -3086,7 +3086,7 @@ Insert a GLSL snippet into the vertex shader. * `origin : Interact` - The interact object that adds this GLSL snippet. Should be discared by + The interact object that adds this GLSL snippet. Should be discarded by visuals that are added with that interact object in `exclude_origins`. * `index : int` diff --git a/phy/cluster/tests/test_supervisor.py b/phy/cluster/tests/test_supervisor.py index 1bcb98fc..27c20695 100644 --- a/phy/cluster/tests/test_supervisor.py +++ b/phy/cluster/tests/test_supervisor.py @@ -603,7 +603,7 @@ def test_supervisor_label_cluster_3(supervisor): new = up.added[0] supervisor.block() - # It fot the label of its parents. + # It got the label of its parents. assert supervisor.get_labels('my_field')[new] == 3.14 # Now, we label a smaller cluster. diff --git a/phy/plot/base.py b/phy/plot/base.py index e82f4200..1b0ccb37 100644 --- a/phy/plot/base.py +++ b/phy/plot/base.py @@ -275,7 +275,7 @@ def insert_vert(self, glsl, location='transforms', origin=None, index=None): * `end`: end of the function origin : Interact - The interact object that adds this GLSL snippet. Should be discared by + The interact object that adds this GLSL snippet. Should be discarded by visuals that are added with that interact object in `exclude_origins`. index : int Index of the snippets list to insert the snippet. @@ -323,7 +323,7 @@ def insert_into_shaders(self, vertex, fragment, exclude_origins=()): Notes ----- - The vertex shader typicall contains `gl_Position = transform(data_var_name);` + The vertex shader typically contains `gl_Position = transform(data_var_name);` which is automatically detected, and the GLSL transformations are inserted there. Snippets can contain `{{var}}` placeholders for the transformed variable name.