Skip to content
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

Fix bug in asrandvar introduced by breaking changes in ScIPy 1.10 #763

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/probnum/randvars/_scipy_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,16 @@ def wrap_scipy_rv(
# Multivariate distributions
if scipy_rv.__class__.__name__ == "multivariate_normal_frozen":
# Multivariate normal distribution
try:
cov_explicit = scipy_rv.cov
except AttributeError:
# As of SciPy 1.10.0 multivariate normal rvs have a Covariance object
# See https://scipy.github.io/devdocs/release.1.10.0.html\
# scipy-stats-improvements
cov_explicit = scipy_rv.cov_object.covariance
return _normal.Normal(
mean=scipy_rv.mean,
cov=scipy_rv.cov,
cov=cov_explicit,
)

# Generic random variables
Expand Down