Skip to content

New design for handling unstored values #65

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Jul 18, 2025

This PR introduces a new design for how unstored values are stored. Instead of a function that generates the unstored values, it is now based around a function unstored(a::AbstractArray) that returns an array that is the same shape as a that when indexed returns the unstored value at that index. By default, that array will be a FillArrays.Zeros, but it can be customized, for example in the case of an array of arrays representing a block array.

Note this is an idea brought up in QuantumKitHub/SparseArrayKit.jl#13.

The motivation is BlockSparseArrays.jl, this design makes it easier to preserve how the zero/unstored values get generated when new sparse arrays are constructed with similar and copy.

Copy link

codecov bot commented Jul 18, 2025

Codecov Report

Attention: Patch coverage is 70.76023% with 50 lines in your changes missing coverage. Please review.

Project coverage is 74.78%. Comparing base (1dd8127) to head (01db9ba).

Files with missing lines Patch % Lines
src/oneelementarray.jl 63.20% 39 Missing ⚠️
src/sparsearraydok.jl 72.72% 6 Missing ⚠️
src/abstractsparsearrayinterface.jl 70.00% 3 Missing ⚠️
src/abstractsparsearray.jl 93.93% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
+ Coverage   74.38%   74.78%   +0.39%     
==========================================
  Files           9        9              
  Lines         648      682      +34     
==========================================
+ Hits          482      510      +28     
- Misses        166      172       +6     
Flag Coverage Δ
docs 36.02% <21.63%> (+1.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant