-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Upgrade Aesara version pin and unpin SciPy upper limit #5474
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5474 +/- ##
==========================================
+ Coverage 81.46% 87.23% +5.77%
==========================================
Files 81 81
Lines 14213 14247 +34
==========================================
+ Hits 11579 12429 +850
+ Misses 2634 1818 -816
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran only the tests that were red, so maybe I broke something. (We'll see.)
But at least the following tests are still failing, because the RV implementations need to be fixed:
FAILED pymc/tests/test_distributions.py::TestMatchesScipy::test_dirichlet_vectorized[2-a2] - ValueError: input operand has more dimensions than allowed by the axis remapping
FAILED pymc/tests/test_distributions.py::TestMatchesScipy::test_dirichlet_vectorized[size1-a2] - ValueError: shape mismatch: objects cannot be broadcast to a single shape
FAILED pymc/tests/test_distributions.py::TestMatchesScipy::test_dirichlet_vectorized[size2-a1] - ValueError: shape mismatch: objects cannot be broadcast to a single shape
FAILED pymc/tests/test_distributions.py::TestMatchesScipy::test_dirichlet_vectorized[size2-a2] - ValueError: shape mismatch: objects cannot be broadcast to a single shape
FAILED pymc/tests/test_distributions_moments.py::test_dirichlet_moment[a2-7-expected2] - TypeError: Cannot convert Type TensorType(float64, (None, None, None)) (of Variable Elemwise{true_div,no_inplace}.0) ...
FAILED pymc/tests/test_distributions_moments.py::test_dirichlet_moment[a3-size3-expected3] - TypeError: Cannot convert Type TensorType(float64, (None, None, None, None)) (of Variable Elemwise{true_div,no_in...
FAILED pymc/tests/test_distributions_moments.py::test_mv_normal_moment[mu7-cov7-size7-expected7] - ValueError: could not broadcast input array from shape (2,2) into shape (4,5,2)
FAILED pymc/tests/test_distributions_moments.py::test_mvstudentt_moment[2-mu5-cov5-2-expected5] - assert (2, 3) == (2, 2, 3)
FAILED pymc/tests/test_distributions_moments.py::test_mvstudentt_moment[2-mu6-cov6-size6-expected6] - ValueError: operands could not be broadcast together with shapes (2,5,2,3) (2,5,2,1,1)
FAILED pymc/tests/test_distributions_moments.py::test_multinomial_moment[p6-n6-2-expected6] - TypeError: Cannot convert Type TensorType(int64, (None, None, None)) (of Variable Elemwise{Cast{int64}}.0) into ...
FAILED pymc/tests/test_distributions_random.py::TestDirichletMultinomial_1D_n_2D_a::test_distribution - assert (1, 2, 4) == (1, 4)
For MvNormal and MvStudentT I think this is just the rng_fn
(and get_moment
).
I gotta jump now, so anybody please feel free to take over.
pymc/distributions/shape_utils.py
Outdated
rv_out = change_rv_size_fn(rv_var=rv_out, new_size=shape[:-1]) | ||
# Into added dims 👇 plus implied dims 👇 but excluding support 👇 dims. | ||
new_size = (*shape[:-1], *tuple(rv_out.shape[:ndim_actual - ndim_supp])) | ||
rv_out = change_rv_size_fn(rv_var=rv_out, new_size=new_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else:
below may no longer be relevant, but we should first add type hints to the signature, because when I tried to un-indent the ShapeError
it turned out that some of the int
parameters are actually Optional[int]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ricardoV94 it looks like this whole block in shape_utils.py
is no longer covered by any tests. It is covered on main
(line 661).
Can we remove it, or is there an edge case that could still trigger these branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an edge case that could still trigger these branches?
None that I know of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I messed up the ShapeWarning. I'll take a look at it in the morning.
You should also check https://pymc--5474.org.readthedocs.build/en/5474/learn/examples/pymc_overview.html#model-specification to make sure not only the installation finishes but that it is actually working and pymc can be imported and used (same url will work as new commits come in) |
c50e0fa
to
4767081
Compare
mv_samples = multivariate_normal.rng_fn(rng=rng, mean=np.zeros_like(mu), cov=cov, size=size) | ||
|
||
size = tuple(size or ()) | ||
# Take chi2 draws and add an axis of length 1 to the right for correct broadcasting below | ||
chi2_samples = np.sqrt(rng.chisquare(nu, size=size) / nu)[..., None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sayam753 can you have a second look if the new Multivariate rng_fn looks correct?
5dd186e
to
211e547
Compare
These tests were introduced between pre-existing Dirichlet/Multinomial/DirichletMultionmial tests that belong to conceptually related distributions
211e547
to
3dd9e2f
Compare
Tests are passing, and I doubled check the following suspicious (initially) non-failing distributions:
|
dfaafb2
to
0d7f0c3
Compare
0d7f0c3
to
ef5653f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the last commit mypy -p pymc
has zero complaints about shape_utils.py
:)
4c2c095
to
2fde55e
Compare
2fde55e
to
bdc6e85
Compare
I'm opening the PR so the CI tells me which tests break.
Closes #5446
Closes #5448