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

codespell: add config and action to codespell the code to avoid known typos #1006

Closed
wants to merge 4 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = .git,*.pdf,*.svg
ignore-regex = ("image/png": *".*|hSI)
ignore-words-list = iterm,bloaded
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
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@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def download_cached_inputs(data_path):
extract_zip(data_path.joinpath('test_inputs.zip'), cached_inputs_url, data_path)

def initialize_ops(tmpdir, data_dir):
"""Initializes ops. Used for both the test_ops function above and for generate_test_data script. This function was made to accomodate creation of ops for both pytest and non-pytest settings."""
"""Initializes ops. Used for both the test_ops function above and for generate_test_data script. This function was made to accommodate creation of ops for both pytest and non-pytest settings."""
ops = suite2p.default_ops()
ops.update(
{
Expand Down
2 changes: 1 addition & 1 deletion docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ These are the essential settings that are dataset-specific.
File input/output settings
~~~~~~~~~~~~~~~~~~~~~~~~~~

Suite2p can accomodate many different file formats. Refer to this
Suite2p can accommodate many different file formats. Refer to this
:ref:`page <inputs-diff-file-types>` for a detailed list of formats suite2p can work with.

- **fast_disk**: (*list[str], default: empty list*) specifies location where temporary binary file will be stored. Defaults to ``save_path0`` if no directory is provided by user.
Expand Down
2 changes: 1 addition & 1 deletion helpers/loadFramesBuff.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%loadFrames Loads the frames of a Tiff file into an array (Y,X,T)
% MOVIE = loadFrames(TIFF, [FIRST], [LAST], [STRIDE], []) loads
% frames from the Tiff file specified by TIFF, which should be a filename
% or an already open Tiff object. Optionallly FIRST, LAST and STRIDE
% or an already open Tiff object. Optionally FIRST, LAST and STRIDE
% specify the range of frame indices to load.

if nargin>4 && ~isempty(temp_file)
Expand Down
2 changes: 1 addition & 1 deletion helpers/make_json_config.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function make_json_config(root)
% fs = hSI.hRoiManager.scanVolumeRate;
% fs = 5;

% get relevant infomation for TIFF header
% get relevant information for TIFF header
artist_info = header(1).Artist;

% retrieve ScanImage ROIs information from json-encoded string
Expand Down
2 changes: 1 addition & 1 deletion helpers/mesoscope_json_from_scanimage.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
fs = 4;
end

% get relevant infomation for TIFF header
% get relevant information for TIFF header
artist_info = header(1).Artist;

% retrieve ScanImage ROIs information from json-encoded string
Expand Down
2 changes: 1 addition & 1 deletion suite2p/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from .version import version
from .default_ops import default_ops
Expand Down
2 changes: 1 addition & 1 deletion suite2p/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import argparse
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion suite2p/classification/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from .classifier import Classifier
from .classify import classify, builtin_classfile, user_classfile
2 changes: 1 addition & 1 deletion suite2p/classification/classifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from scipy.ndimage import gaussian_filter
Expand Down
2 changes: 1 addition & 1 deletion suite2p/classification/classify.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from pathlib import Path
Expand Down
2 changes: 1 addition & 1 deletion suite2p/default_ops.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from .version import version

Expand Down
2 changes: 1 addition & 1 deletion suite2p/detection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from .detect import detect, detection_wrapper, bin_movie
from .stats import roi_stats, ROI
2 changes: 1 addition & 1 deletion suite2p/detection/anatomical.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from typing import Any, Dict
Expand Down
2 changes: 1 addition & 1 deletion suite2p/detection/chan2detect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from scipy.ndimage import gaussian_filter
Expand Down
2 changes: 1 addition & 1 deletion suite2p/detection/denoise.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from typing import List
Expand Down
2 changes: 1 addition & 1 deletion suite2p/detection/detect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import time
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion suite2p/detection/metrics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import time
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion suite2p/detection/sourcery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import math
import time
Expand Down
4 changes: 2 additions & 2 deletions suite2p/detection/sparsedetect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from typing import Tuple, Dict, List, Any
from copy import deepcopy
Expand Down Expand Up @@ -241,7 +241,7 @@ def two_comps(mpix0, lam, Th2):


def extend_mask(ypix, xpix, lam, Ly, Lx):
""" extend mask into 8 surrrounding pixels """
""" extend mask into 8 surrounding pixels """
nel = len(xpix)
yx = ((ypix, ypix, ypix, ypix - 1, ypix - 1, ypix - 1, ypix + 1, ypix + 1,
ypix + 1), (xpix, xpix + 1, xpix - 1, xpix, xpix + 1, xpix - 1, xpix,
Expand Down
4 changes: 2 additions & 2 deletions suite2p/detection/stats.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from __future__ import annotations

Expand Down Expand Up @@ -87,7 +87,7 @@ def stats_dicts_to_3d_array(cls, stats: Sequence[Dict[str, Any]], Ly: int, Lx: i
stats : List of dictionary "ypix", "xpix", "lam"
Ly : y size of frame
Lx : x size of frame
label_id : whether array should be an integer value indicating ROI id or just 1 (indicating precence of ROI).
label_id : whether array should be an integer value indicating ROI id or just 1 (indicating presence of ROI).
"""
arrays = []
for i, stat in enumerate(stats):
Expand Down
2 changes: 1 addition & 1 deletion suite2p/detection/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from numba import jit
Expand Down
2 changes: 1 addition & 1 deletion suite2p/extraction/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from .dcnv import preprocess, oasis
from .extract import create_masks_and_extract, enhanced_mean_image, extract_traces_from_masks, extraction_wrapper
Expand Down
2 changes: 1 addition & 1 deletion suite2p/extraction/dcnv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from numba import njit, prange
Expand Down
2 changes: 1 addition & 1 deletion suite2p/extraction/extract.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion suite2p/extraction/masks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from typing import List, Tuple, Dict, Any
from itertools import count
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from .gui2p import run
2 changes: 1 addition & 1 deletion suite2p/gui/buttons.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from PyQt5 import QtGui, QtCore
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/classgui.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os
import shutil
Expand Down
4 changes: 2 additions & 2 deletions suite2p/gui/drawroi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os
import time
Expand Down Expand Up @@ -233,7 +233,7 @@ def closeEvent(self, event):
def check_proc(self, event):
cproc = QMessageBox.question(
self, "PROC",
"Would you like to save traces before closing? (if you havent extracted the traces, click Cancel and extract!)",
"Would you like to save traces before closing? (if you haven't extracted the traces, click Cancel and extract!)",
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel)
if cproc == QMessageBox.Yes:
self.close_GUI()
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/graphics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
import pyqtgraph as pg
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/gui2p.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os, pathlib, shutil, sys, warnings

Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/io.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os, time
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/masks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from pathlib import Path
import matplotlib.cm
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/menus.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from PyQt5 import QtGui
from PyQt5.QtWidgets import QAction, QMenu
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/merge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/reggui.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
# heavily modified script from a pyqt4 release
import os
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/rungui.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import glob, json, os, shutil, pathlib
from datetime import datetime
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/traces.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from PyQt5 import QtGui, QtCore
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from scipy.ndimage.morphology import binary_dilation, binary_fill_holes
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import numpy as np
from PyQt5 import QtGui, QtCore
Expand Down
2 changes: 1 addition & 1 deletion suite2p/gui/visualize.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import sys
import time
Expand Down
2 changes: 1 addition & 1 deletion suite2p/io/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from .h5 import h5py_to_binary
from .nwb import save_nwb, read_nwb, nwb_to_binary
Expand Down
2 changes: 1 addition & 1 deletion suite2p/io/binary.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
from typing import Optional, Tuple, Sequence
from contextlib import contextmanager
Expand Down
2 changes: 1 addition & 1 deletion suite2p/io/h5.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import math

Expand Down
2 changes: 1 addition & 1 deletion suite2p/io/nd2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os
import gc
Expand Down
2 changes: 1 addition & 1 deletion suite2p/io/nwb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import datetime
import gc
Expand Down
2 changes: 1 addition & 1 deletion suite2p/io/save.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
Copyright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os
from natsort import natsorted
Expand Down
Loading
Loading