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

MAINT: autoupdate pre-commit hooks #22

Merged
merged 12 commits into from
Oct 9, 2023
6 changes: 4 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ root = true
[*]
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{ipynb,md}]
[*.{c,cc,h,hh,ipynb,md}]
indent_size = unset

[*.{py,toml}]
indent_size = 4

[.gitmodules]
indent_size = unset
73 changes: 63 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_schedule: quarterly
skip:
- taplo

repos:
- repo: meta
Expand All @@ -9,7 +11,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-json
Expand All @@ -25,10 +27,36 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.1.0
hooks:
- id: colab-toc-visible
- id: check-dev-files
args:
- --ignore-author
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-pypi
- --no-ruff
- --no-version-branches
- --repo-name=gluex-amplitude

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-isort
- id: nbqa-pyupgrade
args:
- --py37-plus

- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black
- id: black-jupyter
args: [--line-length=85]
types_or: [jupyter]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
Expand All @@ -39,24 +67,29 @@ repos:
- c
- cuda

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.2
hooks:
- id: editorconfig-checker
name: editorconfig
alias: ec
exclude: >-
(?x)^(
.*\.py
)$

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.22.2
rev: V3.23.2
hooks:
- id: latexindent
args:
- "-y=defaultIndent: ' '"

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-black
- id: nbqa-isort

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
Expand All @@ -67,6 +100,7 @@ repos:
cell.attachments
cell.metadata.code_folding
cell.metadata.id
cell.metadata.pycharm
cell.metadata.user_expressions
metadata.celltoolbar
metadata.colab.name
Expand All @@ -82,6 +116,25 @@ repos:
metadata.vscode

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
rev: v3.0.3
hooks:
- id: prettier

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py37-plus

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.1
hooks:
- id: taplo

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.ipynb
LICENSE
3 changes: 3 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[formatting]
align_comments = false
align_entries = false
allowed_blank_lines = 1
array_auto_collapse = false
array_auto_expand = true
array_trailing_comma = true
column_width = 88
compact_inline_tables = true
indent_string = " "
reorder_arrays = true
reorder_keys = true
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"executablebookproject.myst-highlight",
"garaioag.garaio-vscode-unwanted-recommendations",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"james-yu.latex-workshop",
Expand All @@ -19,7 +20,14 @@
"ms-vscode.makefile-tools",
"ms-vsliveshare.vsliveshare",
"redhat.vscode-yaml",
"stkb.rewrap",
"tamasfe.even-better-toml",
"yzhang.markdown-all-in-one"
],
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"ms-python.mypy-type-checker",
"travisillig.vscode-json-stable-stringify"
]
}
30 changes: 18 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"[git-commit]": {
"editor.rulers": [72],
"rewrap.wrappingColumn": 72
},
"[json]": {
Expand All @@ -14,11 +15,14 @@
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [88]
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"black-formatter.importStrategy": "fromEnvironment",
"editor.formatOnSave": true,
"git.autofetch": true,
"git.autoRepositoryDetection": false,
Expand All @@ -45,6 +49,16 @@
}
],
"latex-workshop.latex.tools": [
{
"args": ["--no-fonts", "%DOC%"],
"command": "dvisvgm",
"name": "svg"
},
{
"args": ["--output-format=dvi", "%DOC%"],
"command": "lualatex",
"name": "dvi"
},
{
"args": [
"-synctex=1",
Expand All @@ -54,17 +68,9 @@
],
"command": "lualatex",
"name": "pdf"
},
{
"args": ["--output-format=dvi", "%DOC%"],
"command": "lualatex",
"name": "dvi"
},
{
"args": ["--no-fonts", "%DOC%"],
"command": "dvisvgm",
"name": "svg"
}
],
"livePreview.defaultPreviewPath": "docs/_build/html"
"livePreview.defaultPreviewPath": "docs/_build/html",
"notebook.gotoSymbols.showAllSymbols": true,
"rewrap.wrappingColumn": 88
}
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2021, Common Partial Wave Analysis
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Comparison repository for GlueX amplitude models

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

This repository was created during PWA working group meetings for GlueX at Jefferson Lab, July 31st to August 4th, 2023. Live notes for these discussions can be found [here](https://hackmd.io/@QHYjhejHTIWXL2MltV3WNQ/r17prtBo3) on HackMD. Each meeting was organised like a 'hackathon' and the results of these programming sessions can be found on [compwa.github.io/gluex-amplitude](https://compwa.github.io/gluex-amplitude).

The main target for the week was to implement a simple intensity function for two-pseudoscalar system with photo-production:
Expand Down
12 changes: 6 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# GlueX amplitude model

```{include} ../README.md
:start-line: 2
:end-line: 6
:start-line: 4
:end-line: 8
```

```{math}
Expand All @@ -16,16 +16,16 @@ I(\Omega,\Phi) = 2\kappa\sum_{k}\left(
```

```{include} ../README.md
:start-line: 8
:end-line: 10
:start-line: 10
:end-line: 12
```

:::{figure} fig/feynman-gluex-two-pseudoscalar.svg
:::

```{include} ../README.md
:start-line: 12
:end-line: 13
:start-line: 14
:end-line: 15
```

:::{figure} fig/feynman-gluex-vector-meson.svg
Expand Down
3 changes: 3 additions & 0 deletions docs/widget.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@
}
],
"metadata": {
"colab": {
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
Expand Down
49 changes: 47 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]

[project]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering",
]
dependencies = [
"ampform",
"ipympl",
Expand All @@ -14,6 +29,8 @@ dependencies = [
"sympy",
"uproot",
]
description = "Investigation of symbolic amplitude models for the GlueX experiment"
license = {text = "BSD 3-Clause License"}
name = "gluex-amplitude"
requires-python = ">=3.7"
version = "0.0.0"
Expand All @@ -36,9 +53,37 @@ sty = [
"pre-commit",
]

[project.readme]
content-type = "text/markdown"
file = "README.md"

[tool.black]
preview = true
target-version = [
"py310",
"py311",
"py37",
"py38",
"py39",
]

[tool.isort]
known_third_party = "THIRDPARTY,sympy"
profile = "black"

[tool.nbqa.addopts]
black = ["--line-length=85"]
isort = ["--line-length=85"]

[tool.tomlsort]
all = false
ignore_case = true
in_place = true
sort_first = [
"build-system",
"project",
"tool.setuptools",
"tool.setuptools_scm",
]
sort_table_keys = true
spaces_indent_inline_array = 4
trailing_comma_inline_array = true
Loading