Skip to content

Commit

Permalink
feature: ✨ fix syntax by adding missing commas in function signatures (
Browse files Browse the repository at this point in the history
…#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>
  • Loading branch information
Anselmoo and pre-commit-ci[bot] authored Oct 18, 2024
1 parent 03f6a32 commit 81a3a4a
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 194 deletions.
35 changes: 6 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,13 @@ repos:
- id: check-added-large-files
args: ["--maxkb=1000"]
exclude: \.ipynb
- repo: https://github.com/psf/black.git
rev: 24.10.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.19.0
hooks:
- id: blacken-docs
additional_dependencies: [black>=24.1.1]
- repo: https://github.com/PyCQA/isort.git
rev: 5.13.2
hooks:
- id: isort
additional_dependencies: [toml>=0.10.2]
- repo: https://github.com/PyCQA/flake8.git
rev: 7.1.1
hooks:
- id: flake8
exclude: ^spectrafit/test/, ^examples/
entry: flake8 --max-doc-length 100 --max-line-length 88 --ignore E203,W503,W605
- id: ruff
files: spectrafit/
- id: ruff-format
files: spectrafit/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
Expand All @@ -58,19 +45,9 @@ repos:
hooks:
- id: pydocstyle
additional_dependencies: [toml>=0.10.2]
- repo: https://github.com/PyCQA/pylint
rev: "v3.3.1"
hooks:
- id: pylint
additional_dependencies: [toml>=0.10.2, numpy>=1.23.4, pydantic>=2.1]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
files: '\.(md|js|css)$'
args: [--prose-wrap=always]
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
hooks:
- id: pyupgrade
args: [--py38-plus]
13 changes: 7 additions & 6 deletions docs/examples/example9_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
"# Loading packages and default data\n",
"from spectrafit.plugins import notebook as nb\n",
"import pandas as pd\n",
"\n",
"df = pd.read_csv(\n",
" \"https://raw.githubusercontent.com/Anselmoo/spectrafit/main/Examples/data.csv\"\n",
")\n"
")"
]
},
{
Expand Down Expand Up @@ -135,7 +136,7 @@
"metadata": {},
"outputs": [],
"source": [
"spn.solver_model(initial_model=initial_model)\n"
"spn.solver_model(initial_model=initial_model)"
]
},
{
Expand Down Expand Up @@ -174,7 +175,7 @@
" color=cs.MoonAkiColor(),\n",
" font=cs.MoonAkiFont(),\n",
")\n",
"spn.solver_model(initial_model=initial_model)\n"
"spn.solver_model(initial_model=initial_model)"
]
},
{
Expand Down Expand Up @@ -216,7 +217,7 @@
" color=cs.DevOpsDarkColor(),\n",
" font=cs.DevOpsDarkFont(),\n",
")\n",
"spn.solver_model(initial_model=initial_model)\n"
"spn.solver_model(initial_model=initial_model)"
]
},
{
Expand Down Expand Up @@ -262,7 +263,7 @@
" color=cs.ColorBlindColor(),\n",
" font=cs.ColorBlindFont(),\n",
")\n",
"spn.solver_model(initial_model=initial_model)\n"
"spn.solver_model(initial_model=initial_model)"
]
},
{
Expand Down Expand Up @@ -301,7 +302,7 @@
" color=cs.DevOpsLightColor(),\n",
" font=cs.DevOpsLightFont(),\n",
")\n",
"spn.solver_model(initial_model=initial_model)\n"
"spn.solver_model(initial_model=initial_model)"
]
},
{
Expand Down
11 changes: 7 additions & 4 deletions docs/examples/example9_3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"# Loading packages and default data\n",
"from spectrafit.plugins import notebook as nb\n",
"import pandas as pd\n",
"\n",
"df = pd.read_csv(\n",
" \"https://raw.githubusercontent.com/Anselmoo/spectrafit/main/Examples/data.csv\"\n",
")"
Expand All @@ -41,7 +42,9 @@
"metadata": {},
"outputs": [],
"source": [
"spn = nb.SpectraFitNotebook(df=df, x_column=\"Energy\", y_column=\"Noisy\", fname=\"example9_3\")"
"spn = nb.SpectraFitNotebook(\n",
" df=df, x_column=\"Energy\", y_column=\"Noisy\", fname=\"example9_3\"\n",
")"
]
},
{
Expand Down Expand Up @@ -69,11 +72,11 @@
" {\n",
" \"gaussian\": {\n",
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
" \"center\": {\"max\": 2., \"min\": 0, \"vary\": True, \"value\": 2},\n",
" \"center\": {\"max\": 2.0, \"min\": 0, \"vary\": True, \"value\": 2},\n",
" \"fwhmg\": {\"max\": 0.3, \"min\": 0.02, \"vary\": True, \"value\": 0.1},\n",
" }\n",
" },\n",
" {\n",
" {\n",
" \"gaussian\": {\n",
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
" \"center\": {\"max\": 3.5, \"min\": 1.5, \"vary\": True, \"value\": 2.5},\n",
Expand Down Expand Up @@ -168,7 +171,7 @@
"metadata": {},
"outputs": [],
"source": [
"spn.solver_model(initial_model=initial_model, show_plot=False, show_peaks=True)\n"
"spn.solver_model(initial_model=initial_model, show_plot=False, show_peaks=True)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/example9_6.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
" {\n",
" \"gaussian\": {\n",
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
" \"center\": {\"max\": 2., \"min\": 0, \"vary\": True, \"value\": 2},\n",
" \"center\": {\"max\": 2.0, \"min\": 0, \"vary\": True, \"value\": 2},\n",
" \"fwhmg\": {\"max\": 0.3, \"min\": 0.02, \"vary\": True, \"value\": 0.1},\n",
" }\n",
" },\n",
" {\n",
" {\n",
" \"gaussian\": {\n",
" \"amplitude\": {\"max\": 2, \"min\": 0, \"vary\": True, \"value\": 0.3},\n",
" \"center\": {\"max\": 3.5, \"min\": 1.5, \"vary\": True, \"value\": 2.5},\n",
Expand Down
132 changes: 30 additions & 102 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 81a3a4a

Please sign in to comment.