Skip to content

Add codespell support with configuration and fixes#4

Open
yarikoptic wants to merge 5 commits into
anoushkajain:mainfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#4
yarikoptic wants to merge 5 commits into
anoushkajain:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic

Copy link
Copy Markdown

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-dashboard example).

The CI workflow has permissions set to read only, so it's safe.

Changes

Configuration & infrastructure

  • Added [tool.codespell] section to pyproject.toml with skip list, hidden-file scanning, and a regex to skip base64-encoded images embedded in Jupyter notebooks.
  • Added .github/workflows/codespell.yml to run codespell on push and PRs targeting main.

Domain-specific whitelist

Added legitimate terms flagged by codespell to ignore-words-list:

  • fpr — False Positive Rate variable from sklearn.metrics.roc_curve (e.g. fpr, tpr, thresholds = roc_curve(...))
  • abou — part of contributor name "Sacha Abou Rachid" in the README acknowledgements
  • sortings — SpikeInterface domain term (plural of "sorting" = a spike sort result; also used as the variable both_sortings)

Ambiguous typos fixed manually (context-aware)

  • AccurayAccuracy (not Actuary) in src/unitrefine/train.py:307 and src/unitrefine/README.md:78 — printed "Balanced Accuray:" stat label in training output.
  • labeldlabeled (not labelled) in src/unitrefine/README.md:91 — surrounding doc uses US English ("labeling", "labels").

Non-ambiguous typos fixed via codespell -w

  • calcualtedcalculated (×2: UnitRefine/models/sua_mua_classifier/train_manual_curation.py, UnitRefine/scripts/train_manual_curation.py)
  • minutsminutes (UnitRefine/plots/SHAP_plots.ipynb)
  • parmetersparameters (×3 in UnitRefine/scripts/model_based_curation.py)
  • defualtdefault (×2 in UnitRefine/scripts/model_based_curation.py — in default: parameter documentation)
  • atleastat least (×2 in UnitRefine/tutorial/train_model/train_model_using_csv_metrics_files.ipynb and ..._using_sorting_analyzer.ipynb)
  • classiferclassifier (src/unitrefine/README.md)
  • efficencyefficiency (src/unitrefine/README.md)

Historical context

The repository already has a fixed typos in tutorials commit (7db121f) — manual typo fixes have been needed before, so adding automated checking should help going forward.

Testing

codespell passes with zero errors on a fresh checkout after these changes.


🤖 Generated with Claude Code and love to typos free code

yarikoptic and others added 5 commits May 15, 2026 09:58
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant