Add codespell support with configuration and fixes#4
Open
yarikoptic wants to merge 5 commits into
Open
Conversation
Add ignore-words-list with domain-specific terms codespell flags as typos: - fpr: False Positive Rate variable from sklearn roc_curve output - abou: part of contributor name "Sacha Abou Rachid" in acknowledgements - sortings: SpikeInterface domain term (plural of "sorting" — a spike sort result; also used as variable name `both_sortings`) Also add comment above ignore-regex documenting that it skips base64-encoded images embedded in Jupyter notebooks. Co-Authored-By: Claude Code 2.1.142 / Claude Opus 4.7 <noreply@anthropic.com>
Codespell offered multiple suggestions for these typos; chose based on
surrounding text:
- "Accuray" -> "Accuracy" (not "Actuary") in printed training output
Locations: src/unitrefine/train.py:307, src/unitrefine/README.md:78
Context: "Balanced Accuray:" stat label in model training results.
- "labeld" -> "labeled" (not "labelled") in src/unitrefine/README.md:91
Context: "(labeld model_1_retrained_02, etc)" — surrounding doc uses
US English ("labeling", "labels"), so matched that spelling.
Co-Authored-By: Claude Code 2.1.142 / Claude Opus 4.7 <noreply@anthropic.com>
Applied codespell -w for typos with a single suggestion: - UnitRefine/models/sua_mua_classifier/train_manual_curation.py: calcualted -> calculated - UnitRefine/plots/SHAP_plots.ipynb: minuts -> minutes - UnitRefine/scripts/model_based_curation.py: parmeters -> parameters (x3), defualt -> default (x2) - UnitRefine/scripts/train_manual_curation.py: calcualted -> calculated - UnitRefine/tutorial/train_model/train_model_using_csv_metrics_files.ipynb: atleast -> at least - UnitRefine/tutorial/train_model/train_model_using_sorting_analyzer.ipynb: atleast -> at least - src/unitrefine/README.md: classifer -> classifier, efficency -> efficiency Co-Authored-By: Claude Code 2.1.142 / Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add codespell configuration, CI workflow, and fix existing typos.
More about codespell: https://github.com/codespell-project/codespell
I've introduced codespell to over a hundred projects already, mostly with positive feedback (see the
improveit-dashboardexample).The CI workflow has
permissionsset toreadonly, so it's safe.Changes
Configuration & infrastructure
[tool.codespell]section topyproject.tomlwith skip list, hidden-file scanning, and a regex to skip base64-encoded images embedded in Jupyter notebooks..github/workflows/codespell.ymlto run codespell on push and PRs targetingmain.Domain-specific whitelist
Added legitimate terms flagged by codespell to
ignore-words-list:fpr— False Positive Rate variable fromsklearn.metrics.roc_curve(e.g.fpr, tpr, thresholds = roc_curve(...))abou— part of contributor name "Sacha Abou Rachid" in the README acknowledgementssortings— SpikeInterface domain term (plural of "sorting" = a spike sort result; also used as the variableboth_sortings)Ambiguous typos fixed manually (context-aware)
Accuray→Accuracy(notActuary) insrc/unitrefine/train.py:307andsrc/unitrefine/README.md:78— printed"Balanced Accuray:"stat label in training output.labeld→labeled(notlabelled) insrc/unitrefine/README.md:91— surrounding doc uses US English ("labeling", "labels").Non-ambiguous typos fixed via
codespell -wcalcualted→calculated(×2:UnitRefine/models/sua_mua_classifier/train_manual_curation.py,UnitRefine/scripts/train_manual_curation.py)minuts→minutes(UnitRefine/plots/SHAP_plots.ipynb)parmeters→parameters(×3 inUnitRefine/scripts/model_based_curation.py)defualt→default(×2 inUnitRefine/scripts/model_based_curation.py— indefault:parameter documentation)atleast→at least(×2 inUnitRefine/tutorial/train_model/train_model_using_csv_metrics_files.ipynband..._using_sorting_analyzer.ipynb)classifer→classifier(src/unitrefine/README.md)efficency→efficiency(src/unitrefine/README.md)Historical context
The repository already has a
fixed typos in tutorialscommit (7db121f) — manual typo fixes have been needed before, so adding automated checking should help going forward.Testing
✅
codespellpasses with zero errors on a fresh checkout after these changes.🤖 Generated with Claude Code and love to typos free code