Skip to content

Commit 81a3a4a

Browse files
feature: ✨ fix syntax by adding missing commas in function signatures (#1656)
* chore: 🚨 remove unused hooks for black, isort, flake8, pylint, and pyupgrade * build: 🧑‍💻 add `RUFF` and remove unused packages from poetry.lock and pyproject.toml * chore: ✨ add Ruff linter and formatter to pre-commit configuration * chore: ✨ configure Ruff linter to fix all issues and extend ignore rules * chore: ✨ fix syntax by adding missing commas in function signatures * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore: ✨ include 'spectrafit/' directory in Ruff and Ruff-format hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 03f6a32 commit 81a3a4a

8 files changed

+61
-194
lines changed

.pre-commit-config.yaml

+6-29
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,13 @@ repos:
1818
- id: check-added-large-files
1919
args: ["--maxkb=1000"]
2020
exclude: \.ipynb
21-
- repo: https://github.com/psf/black.git
22-
rev: 24.10.0
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
rev: v0.7.0
2323
hooks:
24-
- id: black
25-
- repo: https://github.com/asottile/blacken-docs
26-
rev: 1.19.0
27-
hooks:
28-
- id: blacken-docs
29-
additional_dependencies: [black>=24.1.1]
30-
- repo: https://github.com/PyCQA/isort.git
31-
rev: 5.13.2
32-
hooks:
33-
- id: isort
34-
additional_dependencies: [toml>=0.10.2]
35-
- repo: https://github.com/PyCQA/flake8.git
36-
rev: 7.1.1
37-
hooks:
38-
- id: flake8
39-
exclude: ^spectrafit/test/, ^examples/
40-
entry: flake8 --max-doc-length 100 --max-line-length 88 --ignore E203,W503,W605
24+
- id: ruff
25+
files: spectrafit/
26+
- id: ruff-format
27+
files: spectrafit/
4128
- repo: https://github.com/pre-commit/mirrors-mypy
4229
rev: v1.11.2
4330
hooks:
@@ -58,19 +45,9 @@ repos:
5845
hooks:
5946
- id: pydocstyle
6047
additional_dependencies: [toml>=0.10.2]
61-
- repo: https://github.com/PyCQA/pylint
62-
rev: "v3.3.1"
63-
hooks:
64-
- id: pylint
65-
additional_dependencies: [toml>=0.10.2, numpy>=1.23.4, pydantic>=2.1]
6648
- repo: https://github.com/pre-commit/mirrors-prettier
6749
rev: "v4.0.0-alpha.8"
6850
hooks:
6951
- id: prettier
7052
files: '\.(md|js|css)$'
7153
args: [--prose-wrap=always]
72-
- repo: https://github.com/asottile/pyupgrade
73-
rev: v3.18.0
74-
hooks:
75-
- id: pyupgrade
76-
args: [--py38-plus]

docs/examples/example9_2.ipynb

+7-6
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
"# Loading packages and default data\n",
2020
"from spectrafit.plugins import notebook as nb\n",
2121
"import pandas as pd\n",
22+
"\n",
2223
"df = pd.read_csv(\n",
2324
" \"https://raw.githubusercontent.com/Anselmoo/spectrafit/main/Examples/data.csv\"\n",
24-
")\n"
25+
")"
2526
]
2627
},
2728
{
@@ -135,7 +136,7 @@
135136
"metadata": {},
136137
"outputs": [],
137138
"source": [
138-
"spn.solver_model(initial_model=initial_model)\n"
139+
"spn.solver_model(initial_model=initial_model)"
139140
]
140141
},
141142
{
@@ -174,7 +175,7 @@
174175
" color=cs.MoonAkiColor(),\n",
175176
" font=cs.MoonAkiFont(),\n",
176177
")\n",
177-
"spn.solver_model(initial_model=initial_model)\n"
178+
"spn.solver_model(initial_model=initial_model)"
178179
]
179180
},
180181
{
@@ -216,7 +217,7 @@
216217
" color=cs.DevOpsDarkColor(),\n",
217218
" font=cs.DevOpsDarkFont(),\n",
218219
")\n",
219-
"spn.solver_model(initial_model=initial_model)\n"
220+
"spn.solver_model(initial_model=initial_model)"
220221
]
221222
},
222223
{
@@ -262,7 +263,7 @@
262263
" color=cs.ColorBlindColor(),\n",
263264
" font=cs.ColorBlindFont(),\n",
264265
")\n",
265-
"spn.solver_model(initial_model=initial_model)\n"
266+
"spn.solver_model(initial_model=initial_model)"
266267
]
267268
},
268269
{
@@ -301,7 +302,7 @@
301302
" color=cs.DevOpsLightColor(),\n",
302303
" font=cs.DevOpsLightFont(),\n",
303304
")\n",
304-
"spn.solver_model(initial_model=initial_model)\n"
305+
"spn.solver_model(initial_model=initial_model)"
305306
]
306307
},
307308
{

docs/examples/example9_3.ipynb

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"# Loading packages and default data\n",
2222
"from spectrafit.plugins import notebook as nb\n",
2323
"import pandas as pd\n",
24+
"\n",
2425
"df = pd.read_csv(\n",
2526
" \"https://raw.githubusercontent.com/Anselmoo/spectrafit/main/Examples/data.csv\"\n",
2627
")"
@@ -41,7 +42,9 @@
4142
"metadata": {},
4243
"outputs": [],
4344
"source": [
44-
"spn = nb.SpectraFitNotebook(df=df, x_column=\"Energy\", y_column=\"Noisy\", fname=\"example9_3\")"
45+
"spn = nb.SpectraFitNotebook(\n",
46+
" df=df, x_column=\"Energy\", y_column=\"Noisy\", fname=\"example9_3\"\n",
47+
")"
4548
]
4649
},
4750
{
@@ -69,11 +72,11 @@
6972
" {\n",
7073
" \"gaussian\": {\n",
7174
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
72-
" \"center\": {\"max\": 2., \"min\": 0, \"vary\": True, \"value\": 2},\n",
75+
" \"center\": {\"max\": 2.0, \"min\": 0, \"vary\": True, \"value\": 2},\n",
7376
" \"fwhmg\": {\"max\": 0.3, \"min\": 0.02, \"vary\": True, \"value\": 0.1},\n",
7477
" }\n",
7578
" },\n",
76-
" {\n",
79+
" {\n",
7780
" \"gaussian\": {\n",
7881
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
7982
" \"center\": {\"max\": 3.5, \"min\": 1.5, \"vary\": True, \"value\": 2.5},\n",
@@ -168,7 +171,7 @@
168171
"metadata": {},
169172
"outputs": [],
170173
"source": [
171-
"spn.solver_model(initial_model=initial_model, show_plot=False, show_peaks=True)\n"
174+
"spn.solver_model(initial_model=initial_model, show_plot=False, show_peaks=True)"
172175
]
173176
},
174177
{

docs/examples/example9_6.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@
8080
" {\n",
8181
" \"gaussian\": {\n",
8282
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
83-
" \"center\": {\"max\": 2., \"min\": 0, \"vary\": True, \"value\": 2},\n",
83+
" \"center\": {\"max\": 2.0, \"min\": 0, \"vary\": True, \"value\": 2},\n",
8484
" \"fwhmg\": {\"max\": 0.3, \"min\": 0.02, \"vary\": True, \"value\": 0.1},\n",
8585
" }\n",
8686
" },\n",
87-
" {\n",
87+
" {\n",
8888
" \"gaussian\": {\n",
8989
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
9090
" \"center\": {\"max\": 3.5, \"min\": 1.5, \"vary\": True, \"value\": 2.5},\n",

poetry.lock

+30-102
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)