Skip to content

Commit

Permalink
Configure automatic spelling check via codespell within pre-commit (#121
Browse files Browse the repository at this point in the history
)

* configure codespell at pyproject.toml and pre-commit

* Add news

* Fix ignore wording

* Do not use full sentences in ignore words

* [pre-commit.ci] auto fixes from pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
bobleesj and pre-commit-ci[bot] authored Oct 29, 2024
1 parent 8bc03e0 commit fb8db49
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .codespell/ignore_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
;; Please include filenames and explanations for each ignored line.
;; See https://docs.openverse.org/meta/codespell.html for docs.
11 changes: 11 additions & 0 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
;; 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
* 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>`_.

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)
#################

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
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"

[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
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

0 comments on commit fb8db49

Please sign in to comment.