Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codespell support (config, workflow to detect/not fix) and make it fix few typos #43

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within setup.cfg
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

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
6 changes: 3 additions & 3 deletions docs/source/gui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Open your project by going to ``File > Open Project``, navigate to the project d
Navigate the timeline
~~~~~~~~~~~~~~~~~~~~~

The brower is divided into two sections. The track-stack (on the right below) contains data-views that have time as a dimension, such as heatmaps, trace plots and spike plots. The tracks are always synchronized so that the same horizontal coordinate represents the same point in time.
The browser is divided into two sections. The track-stack (on the right below) contains data-views that have time as a dimension, such as heatmaps, trace plots and spike plots. The tracks are always synchronized so that the same horizontal coordinate represents the same point in time.

* Click/drag to change the current time.
* Use scrolls/gestures to change the visible time window.
* Use the play button and speed slider at the bottom to watch in real time
* Toggle "center playhead" to keep the current time centered
* Toggle the timeline unit between minutes:seconds and "timestemps". Timesteps are multiples of the ``min_step`` parameters in the projects config file, and can be useful for accessing specific timepoinmts (e.g. video frames) outside of SNUB.
* Toggle the timeline unit between minutes:seconds and "timestamps". Timesteps are multiples of the ``min_step`` parameters in the projects config file, and can be useful for accessing specific timepoinmts (e.g. video frames) outside of SNUB.

.. image:: ../media/use_case1.gif
:align: center
Expand Down Expand Up @@ -84,7 +84,7 @@ Another way to probe the scatter plot is through node coloring.
Annotate videos
~~~~~~~~~~~~~~~

Annotation of videos, e.g., marking the intervals when one or more behaviors occur, can be performed using the annotator widget (see tutorial). The widget is divided into rows corresonding to each annotation label.
Annotation of videos, e.g., marking the intervals when one or more behaviors occur, can be performed using the annotator widget (see tutorial). The widget is divided into rows corresponding to each annotation label.

* Use shift+drag within a row to add an interval.
* Use command/control+drag within a row to subtract an interval.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/nwb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following neurodata types are supported:
Contains fluorescence traces for regions of interest (ROIs). A SNUB heatmap is generated containing one row per ROI. Metadata associated with each ROI is not linked in the SNUB plot.

- ``TimeSeries``
Contains time series in one or more dimensions. A SNUB heatmap is generated for 15 or more dimensions, and a SNUB trace plot is generaed for fewer than 15 dimensions.
Contains time series in one or more dimensions. A SNUB heatmap is generated for 15 or more dimensions, and a SNUB trace plot is generated for fewer than 15 dimensions.

- ``PoseEstimation``
Contains pose tracking data (available via the ``ndx-pose`` extension). A SNUB trace plot is generated for each tracked body part and spatial dimension. For 3D data, a 3D pose plot is also generated.
Expand All @@ -31,7 +31,7 @@ The following neurodata types are supported:
Contains annotated intervals. Each interval has a start time, a stop time, and an arbitrary number of additional metadata fields. A SNUB trace plot is generated with one trace showing the start and stop times of each interval. All other metadata is ignored since it cannot be canonically represented using the currently available SNUB plot types.

- ``Position``
Contains position data in the form of one or more ``SpatialSeries`` objects. A SNUB trace plot is generated with traces for each spatial dimensions of each consistuent spatial series.
Contains position data in the form of one or more ``SpatialSeries`` objects. A SNUB trace plot is generated with traces for each spatial dimensions of each constituent spatial series.

- ``SpatialSeries``
Contains spatial data in the form of a time series with one or more dimensions. A standalone SNUB trace plot is generated for the spatial series if it is not contained within a ``Position`` object.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Add a plot of mouse velocity
Video Annotation
----------------

The code below shows how to set up a SNUB project for video annotation, e.g., for marking the intervals when one or more behaviors are occuring.
The code below shows how to set up a SNUB project for video annotation, e.g., for marking the intervals when one or more behaviors are occurring.


.. code-block:: python
Expand Down
8 changes: 7 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@ style = pep440
versionfile_source = snub/_version.py
versionfile_build = snub/_version.py
tag_prefix =
parentdir_prefix =
parentdir_prefix =
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,versioneer.py,*.css
check-hidden = true
ignore-regex = \bChilds Memorial\b
# ignore-words-list =
2 changes: 1 addition & 1 deletion snub/gui/help/heatmaps.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Heatmaps

Heatmaps dispay time-series data using color intensity (one time-series per row). They are aligned to the [timeline](timeline.md) at the bottom of the window and can be navigated using gestures (pan and zoom).
Heatmaps display time-series data using color intensity (one time-series per row). They are aligned to the [timeline](timeline.md) at the bottom of the window and can be navigated using gestures (pan and zoom).

* **To adjust the colormap**, right click on the heatmap and select "Adjust colormap range" and enter a new min or max value.
* **For vertical zoom**, right click on the heatmap and select "Zoom in (vertical)" or "Zoom out (vertical)". Zooming is centered in the point where you clicked. We do not provide a direct way to scroll along the vertical axis, so if you are zoomed in the top rows of the heatmap and want to see the bottom rows, you will need to zoom out from the top rows and then zoom back in to the bottom rows.
Expand Down
2 changes: 1 addition & 1 deletion snub/gui/help/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The SNUB layout is organized hierarchically: each project is a tab, and each tab

* **To add a new tab**, [load a project](loading_data.md) using the "File" menu.
* **To remove a tab**, click the "x" in the top right corner of the tab.
* **To remove a data-view**, either minimize it using the minus sign in the top right corner or click the "x" in the top right corner. Minizing is temporary, whereas clicking the "x" is permanent. Removing/minimizing data-views can help improve performance, especially during playback.
* **To remove a data-view**, either minimize it using the minus sign in the top right corner or click the "x" in the top right corner. Minimizing is temporary, whereas clicking the "x" is permanent. Removing/minimizing data-views can help improve performance, especially during playback.
* **To change data-view sizes**, drag the corresponding dividers (all dividers are draggable).

### Track and panel stacks
Expand Down
2 changes: 1 addition & 1 deletion snub/gui/help/scatter_plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Scatter plots display two-dimensional data using points. In SNUB, each point cor

### Visualizing dynamics

The whenever the current time (as indicated by the vertical line in the [timeline](timeline.md)) falls within the interval of a point in the scatter plot, the point is highlighted with a big red dot. In some cases, it may also be useful to visulize temporal trajectories in the scatter plot. This can be done using a "marker trail", which uses red dots of decreasing radius to highlight markers that consecutively precede the current time.
The whenever the current time (as indicated by the vertical line in the [timeline](timeline.md)) falls within the interval of a point in the scatter plot, the point is highlighted with a big red dot. In some cases, it may also be useful to visualize temporal trajectories in the scatter plot. This can be done using a "marker trail", which uses red dots of decreasing radius to highlight markers that consecutively precede the current time.

* **To show/hide the marker trail**, right click on the scatter plot and select "Show/hide marker trail". Note that you may need to play/scrub the timeline to see the trail initially.

Expand Down
2 changes: 1 addition & 1 deletion snub/gui/help/timeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SNUB always shows a timeline on the bottom of the window. All data-views that ha
* Click on the timeline to set the current time.
* Use the play button and speed slider at the bottom of the window to animate the current time.
* Turn on "center playhead" to make the currently visible time interval be centered on the current time.
* Toggle the timeline unit between minutes:seconds and "timestemps". Timesteps are multiples of the "min_step" parameter that went into the construction of the current SNUB project. These discrete timesteps can be useful for accessing specific timepoinmts (e.g. video frames) outside of SNUB.
* Toggle the timeline unit between minutes:seconds and "timestamps". Timesteps are multiples of the "min_step" parameter that went into the construction of the current SNUB project. These discrete timesteps can be useful for accessing specific timepoinmts (e.g. video frames) outside of SNUB.


**Note: If playback is not smooth, try minimizing some of the visible panels (using the minus sign in the top right of each panel). Panels can be permanently removed by clicking the "x" in the top right of the panel.**
2 changes: 1 addition & 1 deletion snub/io/manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def umap_embedding(

Returns
-------
coodinates: ndarray
coordinates: ndarray
(N,2) array containing UMAP coordinates
"""
from sklearn.decomposition import PCA
Expand Down
4 changes: 2 additions & 2 deletions snub/io/nwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def create_project_from_nwb(
used. If these names are not unique, an error will be raised.

project_options, dict
Additonal key word arguments for snub.io.create_project
Additional key word arguments for snub.io.create_project

subplot_options, dict
Additonal key word arguments to be passed to the specific subplot-adding functions
Additional key word arguments to be passed to the specific subplot-adding functions
as a dict mapping dataset names to dicts of options. The names should be full paths
if use_full_path is True, or just the names of the leaf nodes otherwise.
"""
Expand Down
4 changes: 2 additions & 2 deletions snub/io/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def add_traceplot(
config = load_config(project_directory)
_confirm_no_existing_dataview(config, "traceplot", name)

# choose random colors for traces that werent assigned a color
# choose random colors for traces that weren't assigned a color
trace_colors = dict(trace_colors)
unassigned_traces = [k for k in traces.keys() if not k in trace_colors]
print("Assigning random colors to traces", unassigned_traces)
Expand Down Expand Up @@ -1446,7 +1446,7 @@ def add_roiplot(
contour_colors[l] = c
heatmap_props["bound_rois"] = name

# choose random colors for ROIs that werent assigned a color
# choose random colors for ROIs that weren't assigned a color
contour_colors = dict(contour_colors)
unassigned_rois = [k for k in labels if not k in contour_colors]
print("Assigning random colors to rois", unassigned_rois)
Expand Down
2 changes: 1 addition & 1 deletion snub/io/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def detrend_video(
Clipping bounds for normalizing detrended video. The interval defined
by `clip` is rescaled to [0,255] in the final video.

quality: int, defaut=6
quality: int, default=6
Quality of output video (passed to imageio writer).

"""
Expand Down