Repository navigation
Conversation
eriknw
force-pushed
the
44-ss-iso-value-empty
branch
from
October 19, 2026 07:55
4a99538 to
ef48683
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 45-ss-flatten-vector-size #638 +/- ##
=============================================================
- Coverage 98.65% 98.10% -0.55%
=============================================================
Files 105 105
Lines 29217 29253 +36
Branches 3439 3445 +6
=============================================================
- Hits 28823 28700 -123
- Misses 258 329 +71
- Partials 136 224 +88 🚀 New features to boost your workflow:
|
Member
Author
|
LGTM. |
eriknw
force-pushed
the
44-ss-iso-value-empty
branch
2 times, most recently
from
October 21, 2026 04:14
c441921 to
aeeb43b
Compare
eriknw
force-pushed
the
44-ss-iso-value-empty
branch
from
October 21, 2026 08:38
aeeb43b to
0a2bc65
Compare
eriknw
force-pushed
the
44-ss-iso-value-empty
branch
from
October 28, 2026 04:29
0a2bc65 to
68ace37
Compare
eriknw
force-pushed
the
44-ss-iso-value-empty
branch
from
October 28, 2026 13:21
68ace37 to
3e18216
Compare
SuiteSparse marks a Matrix or Vector with no entries iso in ordinary use: Matrix.from_coo([], [], 7, nrows=3, ncols=2) is one, and so can be the result of a select that keeps no entries. ss.iso_value read the value with next(self.itervalues()), so on such an object it leaked StopIteration, which turns into "RuntimeError: generator raised StopIteration" inside a generator. graphblas-algorithms reached it through every edgeless graph its operators build (difference(G, G), for one): pagerank, katz_centrality and the Bellman-Ford names raised StopIteration. An object with no entries holds no value, so return an empty Scalar of its dtype. That is how python-graphblas reports a missing value elsewhere: an empty reduction (reduce with the default allow_empty=True) and the extraction of a missing element both give an empty Scalar. ValueError stays for an object that is not iso, which is a different answer from "iso, with nothing in it". Both properties gain a docstring saying so.
The empty-iso tests loop over objects and check iso_value only when SuiteSparse marks one iso. Whether an empty select result is iso depends on the SuiteSparse version, so the not-iso arm ran on some CI draws only and asserted nothing when it did. A new empty Matrix or Vector, which is never iso, now goes through the loop too, and the not-iso arm checks that iso_value raises. The separate check that did this is folded in.
eriknw
force-pushed
the
44-ss-iso-value-empty
branch
from
October 29, 2026 02:01
3e18216 to
cfff665
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SuiteSparse marks some objects with no entries iso, for example
Matrix.from_coo([], [], 7, nrows=3, ncols=2)or some selects that keep noentries.
ss.iso_valueread the value withnext(self.itervalues()), so onthese it leaked StopIteration, which becomes RuntimeError inside a generator.
An empty object holds no value, so the result is now an empty Scalar of its
dtype, as
reducewithallow_empty=Trueand extracting a missing elementgive. ValueError stays for "not iso". Both properties get a docstring.
Note for review: an empty Matrix that SuiteSparse does not mark iso
(
Matrix(int, 3, 2)) still raises "not iso-valued", so two empty matrices cananswer differently. The alternative is an empty Scalar for every empty object.