Skip to content

Commit

Permalink
DX: switch to Python 3.10 in dev environment (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Jan 17, 2024
1 parent 4867431 commit 130512c
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 18 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
"pdg's",
"phasespace",
"phsp",
"pkpi",
"pmatrix",
"preorder",
"prereleased",
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ jobs:
pages: write
id-token: write
with:
apt-packages: graphviz
gh-pages: true
python-version: "3.10"
specific-pip-packages: ${{ inputs.specific-pip-packages }}
style:
if: inputs.specific-pip-packages == ''
secrets:
token: ${{ secrets.PAT }}
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v1
with:
python-version: "3.10"
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tasks:
- init: pyenv local 3.8
- init: pip install -c .constraints/py3.8.txt -e .[dev]
- init: pyenv local 3.10
- init: pip install -c .constraints/py3.10.txt -e .[dev]

github:
prebuilds:
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ repos:
hooks:
- id: check-dev-files
args:
- --doc-apt-packages=graphviz
- --dev-python-version=3.10
- --github-pages
- --no-prettierrc
- --pin-requirements=bimonthly
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ build:
apt_packages:
- graphviz
tools:
python: "3.8"
python: "3.10"
jobs:
post_install:
- pip install -c .constraints/py3.8.txt -e .[doc]
- pip install -c .constraints/py3.10.txt -e .[doc]
- |
wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.2-linux-x86_64.tar.gz
- tar xzf julia-1.9.2-linux-x86_64.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions docs/report/004.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
},
"outputs": [],
"source": [
"%pip install -q ampform==0.11.*"
"%pip install -q ampform==0.14.8 sympy==1.12"
]
},
{
Expand Down Expand Up @@ -572,7 +572,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.18"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/report/006.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
"outputs": [],
"source": [
"%pip install -q ipywidgets==8.1.1 matplotlib==3.4.3 numpy==1.19.5 plotly==5.17.0 sympy==1.8"
"%pip install -q ipywidgets==8.1.1 plotly==5.18.0 sympy==1.12"
]
},
{
Expand Down Expand Up @@ -563,7 +563,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.18"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/report/023.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
},
"outputs": [],
"source": [
"%pip install -q numpy==1.20.3 plotly==5.17.0"
"%pip install -q plotly==5.18.0"
]
},
{
Expand Down Expand Up @@ -158,7 +158,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.18"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions docs/report/024.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
"outputs": [],
"source": [
"%pip install -q graphviz==0.20.1 sympy==1.12 git+https://github.com/ComPWA/polarimetry@0.0.9 git+https://github.com/redeboer/[email protected]"
"%pip install -q ampform==0.14.8 graphviz==0.20.1 polarimetry-lc2pkpi==0.0.10 sympy==1.12"
]
},
{
Expand Down Expand Up @@ -115,7 +115,7 @@
"import polarimetry\n",
"import sympy as sp\n",
"from ampform.io import aslatex\n",
"from ampform.sympy import unevaluated_expression\n",
"from ampform.sympy import unevaluated\n",
"from IPython.display import Markdown, Math\n",
"from polarimetry.amplitude import simplify_latex_rendering\n",
"from polarimetry.io import perform_cached_doit\n",
Expand Down Expand Up @@ -349,7 +349,7 @@
"tags": []
},
"source": [
"The previous example is quite simple, but SymPy works just as well with huge expressions, as we will see in [Large expressions](#large-expressions). Before, though, let's have a look how to define these larger expressions in such a way that we can still read them. A nice solution is to define {class}`sp.Expr <sympy.core.expr.Expr>` classes with the `@unevaluated_expression` decorator (see [ComPWA/ampform#364](https://github.com/ComPWA/ampform/issues/364)). Here, we define a Chew-Mandelstam function $\\rho^\\text{CM}$ for $S$-waves. This function requires the definition of a break-up momentum $q$."
"The previous example is quite simple, but SymPy works just as well with huge expressions, as we will see in [Large expressions](#large-expressions). Before, though, let's have a look how to define these larger expressions in such a way that we can still read them. A nice solution is to define {class}`sp.Expr <sympy.core.expr.Expr>` classes with the `@unevaluated` decorator (see [ComPWA/ampform#364](https://github.com/ComPWA/ampform/issues/364)). Here, we define a Chew-Mandelstam function $\\rho^\\text{CM}$ for $S$-waves. This function requires the definition of a break-up momentum $q$."
]
},
{
Expand All @@ -364,7 +364,7 @@
},
"outputs": [],
"source": [
"@unevaluated_expression(real=False)\n",
"@unevaluated(real=False)\n",
"class PhspFactorSWave(sp.Expr):\n",
" s: sp.Symbol\n",
" m1: sp.Symbol\n",
Expand All @@ -382,7 +382,7 @@
" return 16 * sp.pi * sp.I * cm\n",
"\n",
"\n",
"@unevaluated_expression(real=False)\n",
"@unevaluated(real=False)\n",
"class BreakupMomentum(sp.Expr):\n",
" s: sp.Symbol\n",
" m1: sp.Symbol\n",
Expand Down Expand Up @@ -1185,7 +1185,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.18"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ dependencies:
- graphviz # for binder
- juliaup
- pip
- python==3.8.*
- python==3.10.*
- pip:
- -c .constraints/py3.8.txt -e .[dev]
- -c .constraints/py3.10.txt -e .[dev]
variables:
PRETTIER_LEGACY_CLI: "1"
PYTHONHASHSEED: 0

0 comments on commit 130512c

Please sign in to comment.