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

Allow no-copy construction from SciPy COO arrays. #822

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

hameerabbasi
Copy link
Collaborator

@hameerabbasi hameerabbasi commented Dec 3, 2024

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • πŸͺ„ Feature
  • 🐞 Bug Fix
  • πŸ”§ Optimization
  • πŸ“š Documentation
  • πŸ§ͺ Test
  • πŸ› οΈ Other

Related issues

  • Related issue #
  • Closes #

Checklist

  • Code follows style guide
  • Tests added
  • Documented the changes

Please explain your changes below.

  • Hold reference to converted scipy.sparse.coo_*.
  • Allow comparison against NumPy dtypes.
  • Add a sentence explaining the sparse_vector failure.

@hameerabbasi hameerabbasi added the bug Indicates an unexpected problem or unintended behavior label Dec 3, 2024
@hameerabbasi hameerabbasi requested a review from mtsokol December 3, 2024 09:30
@hameerabbasi
Copy link
Collaborator Author

hameerabbasi commented Dec 3, 2024

@mtsokol This turned out to be a bug on the SciPy side -- SciPy deallocates the underlying data as soon as the coo_array is gone, instead of holding a reference to it in the constituent NumPy arrays. This is also why the tests succeeded before.

Copy link

codspeed-hq bot commented Dec 3, 2024

CodSpeed Performance Report

Merging #822 will degrade performances by 12.24%

Comparing hameerabbasi:allow-coo-copy (08a65b2) with main (13dda8e)

Summary

⚑ 1 improvements
❌ 1 regressions
βœ… 338 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main hameerabbasi:allow-coo-copy Change
❌ test_index_fancy[side=100-rank=1-format='coo'] 1.3 ms 1.5 ms -12.24%
⚑ test_index_slice[side=100-rank=2-format='gcxs'] 2.7 ms 2.3 ms +19.09%

@hameerabbasi hameerabbasi merged commit 128a567 into pydata:main Dec 3, 2024
20 of 23 checks passed
@hameerabbasi hameerabbasi deleted the allow-coo-copy branch December 3, 2024 10:57
hameerabbasi added a commit to hameerabbasi/sparse that referenced this pull request Dec 9, 2024
hameerabbasi added a commit that referenced this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants