From 46dfcaf36ec6a077d387152a71b2cf766ca5b7d0 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 2 Dec 2024 16:31:54 -0500 Subject: [PATCH 1/4] Add github action to codespell main 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 0000000..489bbcc --- /dev/null +++ b/.github/workflows/codespell.yml @@ -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 From 7f658229871ceb2e5861cd40574c19c999c40d86 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 2 Dec 2024 16:31:54 -0500 Subject: [PATCH 2/4] Add rudimentary codespell config --- setup.cfg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 0507a5b..2640554 100644 --- a/setup.cfg +++ b/setup.cfg @@ -63,4 +63,10 @@ style = pep440 versionfile_source = snub/_version.py versionfile_build = snub/_version.py tag_prefix = -parentdir_prefix = \ No newline at end of file +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 = From 9dbee7e795fec59e2683be2c6f05c1a8d8fa4915 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 2 Dec 2024 16:33:02 -0500 Subject: [PATCH 3/4] [DATALAD RUNCMD] Do interactive fixing of some ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2 ./docs/source/nwb.rst", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/source/nwb.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/nwb.rst b/docs/source/nwb.rst index 1021f6b..cb01dca 100644 --- a/docs/source/nwb.rst +++ b/docs/source/nwb.rst @@ -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. @@ -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. From 51a7c7c898a011fc70fa37c26609f47d859fed40 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 2 Dec 2024 16:33:05 -0500 Subject: [PATCH 4/4] [DATALAD RUNCMD] run codespell throughout fixing few left typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/source/gui.rst | 6 +++--- docs/source/tutorials.rst | 2 +- snub/gui/help/heatmaps.md | 2 +- snub/gui/help/layout.md | 2 +- snub/gui/help/scatter_plots.md | 2 +- snub/gui/help/timeline.md | 2 +- snub/io/manifold.py | 2 +- snub/io/nwb.py | 4 ++-- snub/io/project.py | 4 ++-- snub/io/video.py | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/source/gui.rst b/docs/source/gui.rst index 179a34b..d428cef 100644 --- a/docs/source/gui.rst +++ b/docs/source/gui.rst @@ -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 @@ -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. diff --git a/docs/source/tutorials.rst b/docs/source/tutorials.rst index 98874a3..152f60b 100644 --- a/docs/source/tutorials.rst +++ b/docs/source/tutorials.rst @@ -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 diff --git a/snub/gui/help/heatmaps.md b/snub/gui/help/heatmaps.md index 57fa60f..ebb542b 100644 --- a/snub/gui/help/heatmaps.md +++ b/snub/gui/help/heatmaps.md @@ -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. diff --git a/snub/gui/help/layout.md b/snub/gui/help/layout.md index c5366a9..c3af9c2 100644 --- a/snub/gui/help/layout.md +++ b/snub/gui/help/layout.md @@ -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 diff --git a/snub/gui/help/scatter_plots.md b/snub/gui/help/scatter_plots.md index d197d34..9adde9e 100644 --- a/snub/gui/help/scatter_plots.md +++ b/snub/gui/help/scatter_plots.md @@ -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. diff --git a/snub/gui/help/timeline.md b/snub/gui/help/timeline.md index b0418fe..d4915fa 100644 --- a/snub/gui/help/timeline.md +++ b/snub/gui/help/timeline.md @@ -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.** \ No newline at end of file diff --git a/snub/io/manifold.py b/snub/io/manifold.py index fb90df7..83f39db 100644 --- a/snub/io/manifold.py +++ b/snub/io/manifold.py @@ -164,7 +164,7 @@ def umap_embedding( Returns ------- - coodinates: ndarray + coordinates: ndarray (N,2) array containing UMAP coordinates """ from sklearn.decomposition import PCA diff --git a/snub/io/nwb.py b/snub/io/nwb.py index 4369168..24a9c2a 100644 --- a/snub/io/nwb.py +++ b/snub/io/nwb.py @@ -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. """ diff --git a/snub/io/project.py b/snub/io/project.py index 7f77478..adfac3d 100644 --- a/snub/io/project.py +++ b/snub/io/project.py @@ -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) @@ -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) diff --git a/snub/io/video.py b/snub/io/video.py index b25b606..a738ca3 100644 --- a/snub/io/video.py +++ b/snub/io/video.py @@ -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). """