Skip to content

Commit 9d87785

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 7065ab8 + b65d08c commit 9d87785

File tree

249 files changed

+11260
-8838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+11260
-8838
lines changed

.github/workflows/pypi.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ jobs:
3030
- name: Build SDist
3131
run: pipx run build --sdist
3232

33-
- uses: actions/upload-artifact@v3
33+
- uses: actions/upload-artifact@v4
3434
with:
35+
name: sdist
3536
path: dist/*.tar.gz
3637

3738
build_wheels:
38-
name: Build ${{ matrix.python-version }} wheels on ${{ matrix.platform }}
39+
name: Build wheels for ${{ matrix.platform }}
3940
runs-on: ${{ matrix.platform }}
4041
strategy:
4142
matrix:
@@ -49,21 +50,29 @@ jobs:
4950
fetch-depth: 0
5051

5152
- name: Build wheels
52-
uses: pypa/cibuildwheel@v2.18.1
53+
uses: pypa/cibuildwheel@v2.19.2
5354

54-
- uses: actions/upload-artifact@v3
55+
- uses: actions/upload-artifact@v4
5556
with:
57+
name: wheels-${{ matrix.platform }}
5658
path: ./wheelhouse/*.whl
5759

5860
check_dist:
5961
name: Check dist
6062
needs: [make_sdist,build_wheels]
6163
runs-on: ubuntu-22.04
6264
steps:
63-
- uses: actions/download-artifact@v3
65+
- uses: actions/download-artifact@v4
6466
with:
65-
name: artifact
67+
name: sdist
6668
path: dist
69+
70+
- uses: actions/download-artifact@v4
71+
with:
72+
pattern: wheels-*
73+
path: dist
74+
merge-multiple: true
75+
6776
- name: Check SDist
6877
run: |
6978
mkdir -p test-sdist
@@ -83,12 +92,18 @@ jobs:
8392
runs-on: ubuntu-latest
8493
if: github.event_name == 'release' && github.event.action == 'published'
8594
steps:
86-
- uses: actions/download-artifact@v3
87-
with:
88-
name: artifact
89-
path: dist
95+
- uses: actions/download-artifact@v4
96+
with:
97+
name: sdist
98+
path: dist
9099

91-
- uses: pypa/[email protected]
92-
with:
93-
user: __token__
94-
password: ${{ secrets.pypi_password }}
100+
- uses: actions/download-artifact@v4
101+
with:
102+
pattern: wheels-*
103+
path: dist
104+
merge-multiple: true
105+
106+
- uses: pypa/[email protected]
107+
with:
108+
user: __token__
109+
password: ${{ secrets.pypi_password }}

.github/workflows/test.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ jobs:
7676
float32: [0, 1]
7777
install-numba: [0]
7878
install-jax: [0]
79+
install-torch: [0]
7980
part:
81+
- "--doctest-modules --ignore=pytensor/misc/check_duplicate_key.py pytensor --ignore=pytensor/link"
8082
- "tests --ignore=tests/tensor --ignore=tests/scan --ignore=tests/sparse"
8183
- "tests/scan"
8284
- "tests/sparse"
@@ -95,6 +97,10 @@ jobs:
9597
part: "tests/tensor/test_math.py"
9698
- fast-compile: 1
9799
float32: 1
100+
- part: "--doctest-modules --ignore=pytensor/misc/check_duplicate_key.py pytensor --ignore=pytensor/link"
101+
float32: 1
102+
- part: "--doctest-modules --ignore=pytensor/misc/check_duplicate_key.py pytensor --ignore=pytensor/link"
103+
fast-compile: 1
98104
include:
99105
- install-numba: 1
100106
python-version: "3.10"
@@ -116,6 +122,11 @@ jobs:
116122
fast-compile: 0
117123
float32: 0
118124
part: "tests/link/jax"
125+
- install-torch: 1
126+
python-version: "3.10"
127+
fast-compile: 0
128+
float32: 0
129+
part: "tests/link/pytorch"
119130
steps:
120131
- uses: actions/checkout@v4
121132
with:
@@ -142,9 +153,13 @@ jobs:
142153
- name: Install dependencies
143154
shell: micromamba-shell {0}
144155
run: |
145-
micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock sympy
156+
157+
micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock
146158
if [[ $INSTALL_NUMBA == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numba>=0.57"; fi
147159
if [[ $INSTALL_JAX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" jax jaxlib numpyro && pip install tensorflow-probability; fi
160+
if [[ $INSTALL_TORCH == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" pytorch pytorch-cuda=12.1 -c pytorch -c nvidia; fi
161+
pip install pytest-sphinx
162+
148163
pip install -e ./
149164
micromamba list && pip freeze
150165
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))'
@@ -153,6 +168,7 @@ jobs:
153168
PYTHON_VERSION: ${{ matrix.python-version }}
154169
INSTALL_NUMBA: ${{ matrix.install-numba }}
155170
INSTALL_JAX: ${{ matrix.install-jax }}
171+
INSTALL_TORCH: ${{ matrix.install-torch}}
156172

157173
- name: Run tests
158174
shell: micromamba-shell {0}
@@ -171,9 +187,9 @@ jobs:
171187
FLOAT32: ${{ matrix.float32 }}
172188

173189
- name: Upload coverage file
174-
uses: actions/upload-artifact@v3
190+
uses: actions/upload-artifact@v4
175191
with:
176-
name: coverage
192+
name: coverage-${{ steps.matrix-id.outputs.id }}
177193
path: coverage/coverage-${{ steps.matrix-id.outputs.id }}.xml
178194

179195
benchmarks:
@@ -199,7 +215,7 @@ jobs:
199215
- name: Install dependencies
200216
shell: micromamba-shell {0}
201217
run: |
202-
micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark
218+
micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark pytorch pytorch-cuda=12.1 -c pytorch -c nvidia
203219
pip install -e ./
204220
micromamba list && pip freeze
205221
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))'
@@ -257,14 +273,16 @@ jobs:
257273
python -m pip install -U coverage>=5.1 coveralls
258274
259275
- name: Download coverage file
260-
uses: actions/download-artifact@v3
276+
uses: actions/download-artifact@v4
261277
with:
262-
name: coverage
278+
pattern: coverage-*
263279
path: coverage
280+
merge-multiple: true
264281

265282
- name: Upload coverage to Codecov
266283
uses: codecov/codecov-action@v4
267284
with:
268285
directory: ./coverage/
269286
fail_ci_if_error: true
270287
token: ${{ secrets.CODECOV_TOKEN }}
288+

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
)$
2323
- id: check-merge-conflict
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.4.8
25+
rev: v0.5.5
2626
hooks:
2727
- id: ruff
2828
args: ["--fix", "--output-format=full"]

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ global-include *.h
88
global-include *.hh
99
global-include *.sh
1010
recursive-include doc *
11-
include versioneer.py
1211
include pytensor/_version.py

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ A good place to start contributing is by looking through the issues
133133

134134

135135
.. |Project Name| replace:: PyTensor
136-
.. |Tests Status| image:: https://github.com/pymc-devs/pytensor/workflows/Tests/badge.svg
137-
:target: https://github.com/pymc-devs/pytensor/actions?query=workflow%3ATests
136+
.. |Tests Status| image:: https://github.com/pymc-devs/pytensor/workflows/Tests/badge.svg?branch=main
137+
:target: https://github.com/pymc-devs/pytensor/actions?query=workflow%3ATests+branch%3Amain
138138
.. |Coverage| image:: https://codecov.io/gh/pymc-devs/pytensor/branch/main/graph/badge.svg?token=WVwr8nZYmc
139139
:target: https://codecov.io/gh/pymc-devs/pytensor

doc/conf.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
# serve to show the default value.
1313

1414
# If your extensions are in another directory, add it here. If the directory
15-
# is relative to the documentation root, use os.path.abspath to make it
15+
# is relative to the documentation root, use Path.absolute to make it
1616
# absolute, like shown here.
17-
# sys.path.append(os.path.abspath('some/directory'))
17+
# sys.path.append(str(Path("some/directory").absolute()))
1818

1919
import os
20+
import inspect
2021
import sys
2122
import pytensor
2223

@@ -32,8 +33,16 @@
3233
"sphinx.ext.napoleon",
3334
"sphinx.ext.linkcode",
3435
"sphinx.ext.mathjax",
36+
"sphinx_design",
37+
"sphinx.ext.intersphinx"
3538
]
3639

40+
intersphinx_mapping = {
41+
"jax": ("https://jax.readthedocs.io/en/latest", None),
42+
"numpy": ("https://numpy.org/doc/stable", None),
43+
"torch": ("https://pytorch.org/docs/stable", None),
44+
}
45+
3746
needs_sphinx = "3"
3847

3948
todo_include_todos = True
@@ -228,11 +237,9 @@ def find_source():
228237
obj = sys.modules[info["module"]]
229238
for part in info["fullname"].split("."):
230239
obj = getattr(obj, part)
231-
import inspect
232-
import os
233240

234-
fn = inspect.getsourcefile(obj)
235-
fn = os.path.relpath(fn, start=os.path.dirname(pytensor.__file__))
241+
fn = Path(inspect.getsourcefile(obj))
242+
fn = fn.relative_to(Path(__file__).parent)
236243
source, lineno = inspect.getsourcelines(obj)
237244
return fn, lineno, lineno + len(source) - 1
238245

doc/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313
- mock
1414
- pillow
1515
- pymc-sphinx-theme
16+
- sphinx-design
1617
- pip
1718
- pip:
1819
- -e ..

0 commit comments

Comments
 (0)