Skip to content

Commit

Permalink
MAINT: support SymPy v1.11 (#325)
Browse files Browse the repository at this point in the history
* DX: show MyST-NB execution traceback
* MAINT: improve type hint consistency with SymPy v1.11
* MAINT: update pip constraints and pre-commit config

Co-authored-by: GitHub <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 3, 2022
1 parent 36c335e commit acc7afa
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 93 deletions.
18 changes: 9 additions & 9 deletions .constraints/py3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ipykernel==6.15.2
ipympl==0.9.2
ipython==8.4.0
ipython-genutils==0.2.0
ipywidgets==8.0.1
ipywidgets==8.0.2
isort==5.10.1
jedi==0.18.1
jinja2==3.1.2
Expand All @@ -79,7 +79,7 @@ jupyterlab-markup==1.1.0
jupyterlab-myst==0.1.6 ; python_version >= "3.7.0"
jupyterlab-pygments==0.2.2
jupyterlab-server==2.15.1
jupyterlab-widgets==3.0.2
jupyterlab-widgets==3.0.3
kiwisolver==1.4.4
latexcodec==2.0.1
lazy-object-proxy==1.7.1
Expand Down Expand Up @@ -114,7 +114,7 @@ packaging==21.3
pandocfilters==1.5.0
parso==0.8.3
particle==0.20.1
pathspec==0.10.0
pathspec==0.10.1
pep8-naming==0.13.2
pexpect==4.8.0
pickleshare==0.7.5
Expand All @@ -123,7 +123,7 @@ platformdirs==2.5.2
pluggy==1.0.0
pre-commit==2.20.0
prometheus-client==0.14.1
prompt-toolkit==3.0.30
prompt-toolkit==3.0.31
psutil==5.9.1
ptyprocess==0.7.0
pure-eval==0.2.2
Expand All @@ -140,7 +140,7 @@ pygments==2.13.0
pylint==2.15.0
pyparsing==3.0.9
pyrsistent==0.18.1
pytest==7.1.2
pytest==7.1.3
pytest-cov==3.0.0
pytest-forked==1.4.0
pytest-profiling==1.7.0
Expand All @@ -157,7 +157,7 @@ restructuredtext-lint==1.4.0
rich==12.5.1
send2trash==1.8.0
six==1.16.0
sniffio==1.2.0
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
sphinx==4.5.0
Expand All @@ -179,7 +179,7 @@ sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sqlalchemy==1.4.40
stack-data==0.5.0
sympy==1.10.1
sympy==1.11.1
tabulate==0.8.10
terminado==0.15.0
tinycss2==1.1.1
Expand All @@ -188,7 +188,7 @@ tomli==2.0.1
tomlkit==0.11.4
tornado==6.2
tox==3.25.1
tqdm==4.64.0
tqdm==4.64.1
traitlets==5.3.0
types-docutils==0.19.0
types-pkg-resources==0.1.3
Expand All @@ -202,7 +202,7 @@ wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.4.0
wheel==0.37.1
widgetsnbextension==4.0.2
widgetsnbextension==4.0.3
wrapt==1.14.1
zipp==3.8.1

Expand Down
16 changes: 8 additions & 8 deletions .constraints/py3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ipykernel==6.15.2
ipympl==0.9.2
ipython==7.34.0
ipython-genutils==0.2.0
ipywidgets==8.0.1
ipywidgets==8.0.2
isort==5.10.1
jedi==0.18.1
jinja2==3.1.2
Expand All @@ -77,7 +77,7 @@ jupyterlab-markup==1.1.0
jupyterlab-myst==0.1.6 ; python_version >= "3.7.0"
jupyterlab-pygments==0.2.2
jupyterlab-server==2.15.1
jupyterlab-widgets==3.0.2
jupyterlab-widgets==3.0.3
kiwisolver==1.4.4
latexcodec==2.0.1
lazy-object-proxy==1.7.1
Expand Down Expand Up @@ -112,7 +112,7 @@ packaging==21.3
pandocfilters==1.5.0
parso==0.8.3
particle==0.20.1
pathspec==0.10.0
pathspec==0.10.1
pep8-naming==0.13.2
pexpect==4.8.0
pickleshare==0.7.5
Expand All @@ -122,7 +122,7 @@ platformdirs==2.5.2
pluggy==1.0.0
pre-commit==2.20.0
prometheus-client==0.14.1
prompt-toolkit==3.0.30
prompt-toolkit==3.0.31
psutil==5.9.1
ptyprocess==0.7.0
py==1.11.0
Expand All @@ -138,7 +138,7 @@ pygments==2.13.0
pylint==2.15.0
pyparsing==3.0.9
pyrsistent==0.18.1
pytest==7.1.2
pytest==7.1.3
pytest-cov==3.0.0
pytest-forked==1.4.0
pytest-profiling==1.7.0
Expand All @@ -156,7 +156,7 @@ rich==12.5.1
send2trash==1.8.0
singledispatchmethod==1.0 ; python_version < "3.8.0"
six==1.16.0
sniffio==1.2.0
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
sphinx==4.3.2 ; python_version < "3.8.0"
Expand Down Expand Up @@ -186,7 +186,7 @@ tomli==2.0.1
tomlkit==0.11.4
tornado==6.2
tox==3.25.1
tqdm==4.64.0
tqdm==4.64.1
traitlets==5.3.0
typed-ast==1.5.4
types-docutils==0.19.0
Expand All @@ -201,7 +201,7 @@ wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.4.0
wheel==0.37.1
widgetsnbextension==4.0.2
widgetsnbextension==4.0.3
wrapt==1.14.1
zipp==3.8.1

Expand Down
18 changes: 9 additions & 9 deletions .constraints/py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ipykernel==6.15.2
ipympl==0.9.2
ipython==8.4.0
ipython-genutils==0.2.0
ipywidgets==8.0.1
ipywidgets==8.0.2
isort==5.10.1
jedi==0.18.1
jinja2==3.1.2
Expand All @@ -80,7 +80,7 @@ jupyterlab-markup==1.1.0
jupyterlab-myst==0.1.6 ; python_version >= "3.7.0"
jupyterlab-pygments==0.2.2
jupyterlab-server==2.15.1
jupyterlab-widgets==3.0.2
jupyterlab-widgets==3.0.3
kiwisolver==1.4.4
latexcodec==2.0.1
lazy-object-proxy==1.7.1
Expand Down Expand Up @@ -115,7 +115,7 @@ packaging==21.3
pandocfilters==1.5.0
parso==0.8.3
particle==0.20.1
pathspec==0.10.0
pathspec==0.10.1
pep8-naming==0.13.2
pexpect==4.8.0
pickleshare==0.7.5
Expand All @@ -125,7 +125,7 @@ platformdirs==2.5.2
pluggy==1.0.0
pre-commit==2.20.0
prometheus-client==0.14.1
prompt-toolkit==3.0.30
prompt-toolkit==3.0.31
psutil==5.9.1
ptyprocess==0.7.0
pure-eval==0.2.2
Expand All @@ -142,7 +142,7 @@ pygments==2.13.0
pylint==2.15.0
pyparsing==3.0.9
pyrsistent==0.18.1
pytest==7.1.2
pytest==7.1.3
pytest-cov==3.0.0
pytest-forked==1.4.0
pytest-profiling==1.7.0
Expand All @@ -159,7 +159,7 @@ restructuredtext-lint==1.4.0
rich==12.5.1
send2trash==1.8.0
six==1.16.0
sniffio==1.2.0
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
sphinx==4.5.0
Expand All @@ -181,7 +181,7 @@ sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sqlalchemy==1.4.40
stack-data==0.5.0
sympy==1.10.1
sympy==1.11.1
tabulate==0.8.10
terminado==0.15.0
tinycss2==1.1.1
Expand All @@ -190,7 +190,7 @@ tomli==2.0.1
tomlkit==0.11.4
tornado==6.2
tox==3.25.1
tqdm==4.64.0
tqdm==4.64.1
traitlets==5.3.0
types-docutils==0.19.0
types-pkg-resources==0.1.3
Expand All @@ -204,7 +204,7 @@ wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.4.0
wheel==0.37.1
widgetsnbextension==4.0.2
widgetsnbextension==4.0.3
wrapt==1.14.1
zipp==3.8.1

Expand Down
18 changes: 9 additions & 9 deletions .constraints/py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ipykernel==6.15.2
ipympl==0.9.2
ipython==8.4.0
ipython-genutils==0.2.0
ipywidgets==8.0.1
ipywidgets==8.0.2
isort==5.10.1
jedi==0.18.1
jinja2==3.1.2
Expand All @@ -79,7 +79,7 @@ jupyterlab-markup==1.1.0
jupyterlab-myst==0.1.6 ; python_version >= "3.7.0"
jupyterlab-pygments==0.2.2
jupyterlab-server==2.15.1
jupyterlab-widgets==3.0.2
jupyterlab-widgets==3.0.3
kiwisolver==1.4.4
latexcodec==2.0.1
lazy-object-proxy==1.7.1
Expand Down Expand Up @@ -114,7 +114,7 @@ packaging==21.3
pandocfilters==1.5.0
parso==0.8.3
particle==0.20.1
pathspec==0.10.0
pathspec==0.10.1
pep8-naming==0.13.2
pexpect==4.8.0
pickleshare==0.7.5
Expand All @@ -123,7 +123,7 @@ platformdirs==2.5.2
pluggy==1.0.0
pre-commit==2.20.0
prometheus-client==0.14.1
prompt-toolkit==3.0.30
prompt-toolkit==3.0.31
psutil==5.9.1
ptyprocess==0.7.0
pure-eval==0.2.2
Expand All @@ -140,7 +140,7 @@ pygments==2.13.0
pylint==2.15.0
pyparsing==3.0.9
pyrsistent==0.18.1
pytest==7.1.2
pytest==7.1.3
pytest-cov==3.0.0
pytest-forked==1.4.0
pytest-profiling==1.7.0
Expand All @@ -157,7 +157,7 @@ restructuredtext-lint==1.4.0
rich==12.5.1
send2trash==1.8.0
six==1.16.0
sniffio==1.2.0
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
sphinx==4.5.0
Expand All @@ -179,7 +179,7 @@ sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sqlalchemy==1.4.40
stack-data==0.5.0
sympy==1.10.1
sympy==1.11.1
tabulate==0.8.10
terminado==0.15.0
tinycss2==1.1.1
Expand All @@ -188,7 +188,7 @@ tomli==2.0.1
tomlkit==0.11.4
tornado==6.2
tox==3.25.1
tqdm==4.64.0
tqdm==4.64.1
traitlets==5.3.0
types-docutils==0.19.0
types-pkg-resources==0.1.3
Expand All @@ -202,7 +202,7 @@ wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.4.0
wheel==0.37.1
widgetsnbextension==4.0.2
widgetsnbextension==4.0.3
wrapt==1.14.1
zipp==3.8.1

Expand Down
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"coolwarm",
"displaystyle",
"dlink",
"docnb",
"doctest",
"doctests",
"dotprint",
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,6 @@ jobs:
GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: tox -e docnb
# cspell:ignore docnb
- name: Print error logs with color
if: ${{ failure() }}
# cspell:ignore printf
run: |
for log_file in $(ls docs/_build/html/reports/*); do
for i in $(seq 6); do echo; done
printf '%45s\n' | tr ' ' =
echo "$log_file"
printf '%45s\n' | tr ' ' =
echo
cat "$log_file"
done
for log_file in $(ls /tmp/sphinx-*.log); do
for i in $(seq 6); do echo; done
printf '%45s\n' | tr ' ' =
echo "$log_file"
printf '%45s\n' | tr ' ' =
echo
cat "$log_file"
done
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.0.143
rev: 0.0.144
hooks:
- id: check-dev-files
args:
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ def get_execution_mode() -> str:


nb_execution_mode = get_execution_mode()
nb_execution_show_tb = True
nb_execution_timeout = -1
nb_output_stderr = "remove"
EXECUTE_NB = nb_execution_mode != "off"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ install_requires =
attrs >=20.1.0 # on_setattr and https://www.attrs.org/en/stable/api.html#next-gen
qrules ==0.9.*, >=0.9.6 # https://github.com/ComPWA/qrules/pull/145
singledispatchmethod; python_version <"3.8.0"
sympy >=1.10, <1.11 # module sympy.printing.numpy and array expressions with shape kwarg
sympy >=1.10, <1.12 # module sympy.printing.numpy and array expressions with shape kwarg
typing-extensions; python_version <"3.8.0"
packages = find:
package_dir =
Expand Down
4 changes: 2 additions & 2 deletions src/ampform/dynamics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def evaluate(self) -> sp.Expr:

def _latex(self, printer: LatexPrinter, *args) -> str:
s = printer._print(self.args[0])
width = printer._print(self.args[2])
subscript = _indices_to_subscript(_determine_indices(width))
gamma0 = self.args[2]
subscript = _indices_to_subscript(_determine_indices(gamma0))
name = Rf"\Gamma{subscript}" if self._name is None else self._name
return Rf"{name}\left({s}\right)"

Expand Down
Loading

0 comments on commit acc7afa

Please sign in to comment.