-
Notifications
You must be signed in to change notification settings - Fork 370
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: workflow, config and fix typos it finds #1226
Conversation
🚀 |
This looks very helpful -- maybe should be created from dev not main though. Nice to meet you at the booth will be great to collaborate on dandi and nwb! 💯 |
Hello, For now if you don't mind cutting the tool component and config out and making this a pure typo-fixing diff, and redoing it against dev, that would be a welcome fix and we can haggle our the mistakes it made (and areas where the typo isn't the main problem). Up to you whether you want to close this PR and open a new one, or force push a new diff to your branch and retarget then. I appreciate the attention to the topic. |
to run manually you would need a config. Can I keep it? I can remove github workflow if you insist. NB I personally dislike "manual" things, it "never works" and just piles up problems. Hence we use LOTS of automations and I recommend to adopt some of them. Have a look at our pre-commit configuration for one of the components. I will now redo/rebase on |
94e7c85
to
d5cc9f9
Compare
d5cc9f9
to
69a6e6a
Compare
ok, rebased on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good; happy to see a lot of typos removed from the codebase. The tool got a few things wrong; left some notes.
It's fine to leave the config stuff in pyproject.
@@ -94,7 +94,7 @@ Check console output at $BUILD_URL to view full results. | |||
Building $BRANCH_NAME for $CAUSE | |||
$JOB_DESCRIPTION | |||
|
|||
Chages: | |||
Changes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting we never caught this before
@@ -1095,7 +1095,7 @@ def extract_binary_masks_blob(A, | |||
|
|||
Args: | |||
A: scipy.sparse matrix | |||
contains the components as outputed from the CNMF algorithm | |||
contains the components as outputted from the CNMF algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to circle back to this later; the phrasing is weird.
caiman/motion_correction.py
Outdated
@@ -1642,7 +1642,7 @@ def register_translation(src_image, target_image, upsample_factor=1, | |||
"and \"fourier\" values for the ``space`` argument." | |||
|
|||
References: | |||
.. [1] Manuel Guizar-Sicairos, Samuel T. Thurman, and James R. Fienup, | |||
.. [1] Manual Guizar-Sicairos, Samuel T. Thurman, and James R. Fienup, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will force push rewrite, thanks for catching
@@ -1154,9 +1154,9 @@ def fast_graph_Laplacian(mmap_file, dims, max_radius=10, kernel='heat', | |||
else: | |||
res = dview.map(fast_graph_Laplacian_pixel, pars, chunksize=128) | |||
indptr = np.cumsum(np.array([0] + [len(r[0]) for r in res])) | |||
indeces = [item for sublist in res for item in sublist[0]] | |||
indices = [item for sublist in res for item in sublist[0]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel a little weird that it's correcting code rather than just comments, although this is a change I'd make myself so let's leave it in
@@ -280,7 +280,7 @@ def denoise_spikes(trace, sampleRate, windowLength, superfactor, threshs=(.4, .6 | |||
|
|||
tlimit = len(trace) | |||
|
|||
thre = threshold_sets[th] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's revert this set of changes though; not its job to weigh in on something that's not a misspelling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, thre
is a frequent typo of three, there, their, the
hence was detected. I will make it skip all "thre" but then you would miss the typos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dropping 6642c7f
@@ -89,7 +89,7 @@ | |||
"source": [ | |||
"max_shifts = (6, 6) # maximum allowed rigid shift in pixels (view the movie to get a sense of motion)\n", | |||
"strides = (48, 48) # create a new patch every x pixels for pw-rigid correction\n", | |||
"overlaps = (24, 24) # overlap between pathes (size of patch strides+overlaps)\n", | |||
"overlaps = (24, 24) # overlap between paths (size of patch strides+overlaps)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patches
demos/notebooks/demo_pipeline.ipynb
Outdated
@@ -131,7 +131,7 @@ | |||
"\n", | |||
"# motion correction parameters\n", | |||
"strides = (48, 48) # start a new patch for pw-rigid motion correction every x pixels\n", | |||
"overlaps = (24, 24) # overlap between pathes (size of patch strides+overlaps)\n", | |||
"overlaps = (24, 24) # overlap between paths (size of patch strides+overlaps)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patches
@@ -120,7 +120,7 @@ | |||
"gSig_filt = (3, 3) # size of high pass spatial filtering, used in 1p data\n", | |||
"max_shifts = (5, 5) # maximum allowed rigid shift\n", | |||
"strides = (48, 48) # start a new patch for pw-rigid motion correction every x pixels\n", | |||
"overlaps = (24, 24) # overlap between pathes (size of patch strides+overlaps)\n", | |||
"overlaps = (24, 24) # overlap between paths (size of patch strides+overlaps)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patches
@@ -104,7 +104,7 @@ | |||
" # change this one if algorithm does not work\n", | |||
"max_shifts = (5, 5) # maximum allowed rigid shift\n", | |||
"strides = (48, 48) # start a new patch for pw-rigid motion correction every x pixels\n", | |||
"overlaps = (24, 24) # overlap between pathes (size of patch strides+overlaps)\n", | |||
"overlaps = (24, 24) # overlap between paths (size of patch strides+overlaps)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patches
docs/CODE_OF_CONDUCT.md
Outdated
@@ -37,4 +37,4 @@ Second, some behavior is egregious enough that people should not see it in the c | |||
|
|||
## Process | |||
|
|||
People who feel that they have been ignored when trying to close a topic or otherwise uncomfortable interactions, or people who feel they have been targeted by egregious behavior that should not be permitted, should contact any of the project organizers. If the claim is not against any of the project organizers, available organizers should confer in the spirit of fairness and due process, investigate as they see fit (including discussing things with the accused), and apply any remedies that they choose. If an organizer is accused, other organizers should confer and apply the same process. Organizers should recuse if they think they cannot be fair. | |||
People who feel that they have been ignored when trying to close a topic or otherwise uncomfortable interactions, or people who feel they have been targeted by egregious behavior that should not be permitted, should contact any of the project organizers. If the claim is not against any of the project organizers, available organizers should confer in the spirit of fairness and due process, investigate as they see fit (including discussing things with the accused), and apply any remedies that they choose. If an organizer is accused, other organizers should confer and apply the same process. Organizers should recurse if they think they cannot be fair. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recuse was actually the word meant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! ignoring it too
Note I will probably get to this next week I'm recovering from workshop-sfn 😄 but it does look like it found a lot of useful things. |
=== Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ note: commit was rebased and adjusted manually for a conflict
=== Do not change lines below === { "chain": [], "cmd": "git-sedi 'between pathes' 'between patches'", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
=== Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
69a6e6a
to
7b09601
Compare
Thanks; this looks good now! Much appreciated! |
Description
codespell is great to pick up known typos. Unfortunately there were some custom variables used which I had to ignore to not introduce too many changes, but you might like to fix up code to stay aware from the names which are close to the typos.
Type of change
Please delete options that are not relevant.
Branching
I realized that too late -- please let me know if I should redo but first want to check if you are interested in such a "change" in general