-
Notifications
You must be signed in to change notification settings - Fork 1
Constructors #33
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
Constructors #33
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
==========================================
- Coverage 75.05% 72.46% -2.60%
==========================================
Files 7 7
Lines 421 454 +33
==========================================
+ Hits 316 329 +13
- Misses 105 125 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Seems reasonable, I was using constructors like |
A question I have about |
I added in Keep in mind that all of this is somewhat specific to non-stored entries being "zero", since otherwise these implementations become a bit ill-defined... |
I think I was using
Good point, we should start to keep track of which functions assume non-stored entries are zero and document that, and maybe check for it in functions that assume that. Maybe what we need is a trait function like |
I'm definitely okay with finishing this up and merging. I think my reservations where about this being breaking (removing the |
Yeah, if anything it can be nicer splitting up breaking changes into separate breaking releases so then downstream packages can upgrade things incrementally. |
The integration tests for BlockSparseArrays.jl are failing because of a compat issue: v0.1.0 of that package does not have compatibility bounds for the I'll open an issue in our registry to try and get that sorted, otherwise this should be good to go. |
Integration tests are now passing. This is okay to merge for me. |
@lkdvos sorry to keep dragging this out, but what do you think of changing the names
|
…d` and `sparserand!`
No worries, I much rather change names now than in two weeks when it's used in different places as well 😉 |
This and #31 are good to merge/register (though I guess that one needs to be updated to reflect this one). Thanks! Great to have this kind of thing cleaned up and in a more "future proof" state. |
This PR changes some of the constructors of
SparseArrayDOK
to more closely resemble theirAbstractArray
counterparts, by explicitly requiringundef
.Additionally, once #32 are in place, this also ensures that inputs are checked such that unless you provide a fully-qualified type, we will check if all indices are within the correct bounds.
Also additionally, this now automatically works for any
AbstractDictionary
orAbstractDict
, with eitherCartesian
orInt
key types.Finally, for convenience I also added
sprand
andsprand!
(interface up for debate!) to facilitate easily creating random arrays for testing purposes.