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

feature: ✨ fix syntax by adding missing commas in function signatures #1656

Merged
merged 7 commits into from
Oct 18, 2024
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
Loading