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

Configure automatic spelling check via codespell within pre-commit #121

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 .codespell/ignore_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;; Please include filenames and explanations for each ignored line.
;; See https://docs.openverse.org/meta/codespell.html for docs.


13 changes: 13 additions & 0 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
;; Please include explanations for each ignored word (lowercase).
;; See https://docs.openverse.org/meta/codespell.html for docs.

;; abbreviation for "materials" often used in a journal title
mater

;; alternative use of socioeconomic
socio-economic

;; Frobenius norm used in np.linalg.norm
fro


6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ repos:
name: Prevent Commit to Main Branch
args: ["--branch", "main"]
stages: [pre-commit]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Release Notes

**Fixed:**

* Updated REAMDE instructions for pip and conda-forge install
* Updated REAMDE instructions to check for successful installation
* Updated README instructions for pip and conda-forge install
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo found by codespell

* Updated README instructions to check for successful installation


0.1.2
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ trying to commit again.

Improvements and fixes are always appreciated.

Before contribuing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.snmf/blob/main/CODE_OF_CONDUCT.rst>`_.
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.snmf/blob/main/CODE_OF_CONDUCT.rst>`_.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo found by codespell


Contact
-------
Expand Down
4 changes: 2 additions & 2 deletions doc/source/quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _quick_start:

Tutorial (To be addded)
Tutorial (To be added)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo found by codespell

#################

Welcome! This will be a quick tutorial to accquaint users with `snmf`.
Expand All @@ -18,5 +18,5 @@ Add extra tutorials here
Bug Reports
===========

Please enjoy using our software! If you come accross any bugs in the
Please enjoy using our software! If you come across any bugs in the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo found by codespell

application, please report them to [email protected].
23 changes: 23 additions & 0 deletions news/codespell.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Add spelling check pre-commit via Codespell

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default)
[tool.setuptools.dynamic]
dependencies = {file = ["requirements/pip.txt"]}

[tool.codespell]
exclude-file = ".codespell/ignore_lines.txt"
ignore-words = ".codespell/ignore_words.txt"
skip = "*.cif"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip files


[tool.black]
line-length = 115
include = '\.pyi?$'
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/snmf/polynomials.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def rooth(linear_coefficient, constant_term):

Parameters
----------
linear_coefficient: nd array like of floats
linear_coefficient: ndarray like of floats
The matrix coefficient of the linear term
constant_term: 0d array like, 1d array like of floats or scalar
The constant scalar term of the problem
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/snmf/subroutines.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def update_weights_matrix(
The matrx containing the stretching factors of the calculated component signals. Has dimensions K x M
where K is the number of component signals and M is the number of XRD/PDF patterns.

component_matrix: 2d array lik
component_matrix: 2d array like
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo found by codespell

The matrix containing the unstretched calculated component signals. Has dimensions N x K where N is the
length of the signals and K is the number of component signals.

Expand Down
Loading