Skip to content

Commit c3b8ff4

Browse files
Bump PyTensor to 2.9.1 (#6431)
* Bump PyTensor to 2.9.1 * Allow installation from `.conda` artifacts * Workaround type issues in `shape_utils` Caused by pymc-devs/pytensor#193
1 parent ecb3666 commit c3b8ff4

File tree

9 files changed

+22
-19
lines changed

9 files changed

+22
-19
lines changed

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
environment-file: conda-envs/environment-test.yml
5353
python-version: 3.9
5454
use-mamba: true
55-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
55+
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
5656
- name: Install-pymc and mypy dependencies
5757
run: |
5858
conda activate pymc-test

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
environment-file: conda-envs/environment-test.yml
141141
python-version: ${{matrix.python-version}}
142142
use-mamba: true
143-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
143+
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
144144
- name: Install-pymc
145145
run: |
146146
conda activate pymc-test
@@ -211,7 +211,7 @@ jobs:
211211
environment-file: conda-envs/windows-environment-test.yml
212212
python-version: ${{matrix.python-version}}
213213
use-mamba: true
214-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
214+
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
215215
- name: Install-pymc
216216
run: |
217217
conda activate pymc-test
@@ -290,7 +290,7 @@ jobs:
290290
environment-file: conda-envs/environment-test.yml
291291
python-version: ${{matrix.python-version}}
292292
use-mamba: true
293-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
293+
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
294294
- name: Install pymc
295295
run: |
296296
conda activate pymc-test
@@ -355,7 +355,7 @@ jobs:
355355
environment-file: conda-envs/environment-test.yml
356356
python-version: ${{matrix.python-version}}
357357
use-mamba: true
358-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
358+
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
359359
- name: Install pymc
360360
run: |
361361
conda activate pymc-test
@@ -425,7 +425,7 @@ jobs:
425425
environment-file: conda-envs/windows-environment-test.yml
426426
python-version: ${{matrix.python-version}}
427427
use-mamba: true
428-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
428+
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
429429
- name: Install-pymc
430430
run: |
431431
conda activate pymc-test

conda-envs/environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- numpy>=1.15.0
1515
- pandas>=0.24.0
1616
- pip
17-
- pytensor=2.8.11
17+
- pytensor=2.9.1
1818
- python-graphviz
1919
- networkx
2020
- scipy>=1.4.1

conda-envs/environment-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- numpy>=1.15.0
1818
- pandas>=0.24.0
1919
- pip
20-
- pytensor=2.8.11
20+
- pytensor=2.9.1
2121
- python-graphviz
2222
- networkx
2323
- scipy>=1.4.1

conda-envs/windows-environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- numpy>=1.15.0
1515
- pandas>=0.24.0
1616
- pip
17-
- pytensor=2.8.11
17+
- pytensor=2.9.1
1818
- python-graphviz
1919
- networkx
2020
- scipy>=1.4.1

conda-envs/windows-environment-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- numpy>=1.15.0
1818
- pandas>=0.24.0
1919
- pip
20-
- pytensor=2.8.11
20+
- pytensor=2.9.1
2121
- python-graphviz
2222
- networkx
2323
- scipy>=1.4.1

pymc/distributions/shape_utils.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -740,14 +740,15 @@ def get_support_shape(
740740
observed.shape[i] - support_shape_offset[i] for i in np.arange(-ndim_supp, 0)
741741
]
742742

743-
# We did not learn anything
744-
if inferred_support_shape is None and support_shape is None:
745-
return None
746-
# Only source of information was the originally provided support_shape
747-
elif inferred_support_shape is None:
748-
inferred_support_shape = support_shape
749-
# There were two sources of support_shape, make sure they are consistent
743+
if inferred_support_shape is None:
744+
if support_shape is not None:
745+
# Only source of information was the originally provided support_shape
746+
inferred_support_shape = support_shape
747+
else:
748+
# We did not learn anything
749+
return None
750750
elif support_shape is not None:
751+
# There were two sources of support_shape, make sure they are consistent
751752
inferred_support_shape = [
752753
cast(
753754
Variable,
@@ -758,6 +759,8 @@ def get_support_shape(
758759
for inferred, explicit in zip(inferred_support_shape, support_shape)
759760
]
760761

762+
# Workaround https://github.com/pymc-devs/pytensor/issues/193 typing bug in stack signature
763+
inferred_support_shape = cast(Sequence[TensorVariable], inferred_support_shape)
761764
return at.stack(inferred_support_shape)
762765

763766

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ numpydoc
1717
pandas>=0.24.0
1818
polyagamma
1919
pre-commit>=2.8.0
20-
pytensor==2.8.11
20+
pytensor==2.9.1
2121
pytest-cov>=2.5
2222
pytest>=3.0
2323
scipy>=1.4.1

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ cloudpickle
44
fastprogress>=0.2.0
55
numpy>=1.15.0
66
pandas>=0.24.0
7-
pytensor==2.8.11
7+
pytensor==2.9.1
88
scipy>=1.4.1
99
typing-extensions>=3.7.4

0 commit comments

Comments
 (0)