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

Fixed issues with scipy sparse storage in scipy 1.11 #943

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

robfalck
Copy link
Contributor

@robfalck robfalck commented Jun 28, 2023

Summary

Some scipy sparse functions, particularly the data attribute, appear to behave somewhat differently in 1.11.
Previously we relied on the data attribute with the assumption that data was given in row major order.
While this is true for csr, matrix operations can result in translations to other format where that assumption does not hold.

To resolve the issue, eliminate the use of the data attribute.

Related Issues

Backwards incompatibilities

None

New Dependencies

None

@coveralls
Copy link

coveralls commented Jun 28, 2023

Coverage Status

coverage: 92.818% (+0.003%) from 92.815% when pulling 44d9d2a on robfalck:scipy1_11_update into 90e95d3 on OpenMDAO:master.

@@ -242,7 +241,8 @@ def _compute_partials_radau(self, inputs, partials):

dstau_dt_x_size = np.repeat(dstau_dt, size)[:, np.newaxis]

partials[xdotc_name, xd_name] = self.jacs['Ad'][name].multiply(dstau_dt_x_size).data
dxdotc_dxd = self.jacs['Ad'][name].multiply(dstau_dt_x_size)
partials[xdotc_name, xd_name] = dxdotc_dxd.data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok to still use data here? Will it work the same way in old and new scipy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work fine, ultimately the issue was a change in formats to the matrices involved that I've resolved

@robfalck robfalck merged commit 6ae47d1 into OpenMDAO:master Jun 28, 2023
@robfalck robfalck deleted the scipy1_11_update branch February 1, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scipy 1.11 sparse change
4 participants