Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Return an empty Scalar from ss.iso_value of an empty iso object - #638

Open
eriknw wants to merge 2 commits into
45-ss-flatten-vector-sizefrom
44-ss-iso-value-empty
Open

eriknw wants to merge 2 commits into
45-ss-flatten-vector-sizefrom
44-ss-iso-value-empty

Conversation

@eriknw

@eriknw eriknw commented Oct 19, 2026

Copy link
Copy Markdown
Member

SuiteSparse marks some objects with no entries iso, for example
Matrix.from_coo([], [], 7, nrows=3, ncols=2) or some selects that keep no
entries. ss.iso_value read the value with next(self.itervalues()), so on
these 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 reduce with allow_empty=True and extracting a missing element
give. 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 can
answer differently. The alternative is an empty Scalar for every empty object.

@eriknw
eriknw added this pull request to stack #650 October 19, 2026 07:50
@eriknw
eriknw force-pushed the 44-ss-iso-value-empty branch from 4a99538 to ef48683 Compare October 19, 2026 07:55
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.10%. Comparing base (e6030c0) to head (cfff665).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eriknw

eriknw commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

LGTM. ss.iso_value should only be present when the object identifies itself as iso-valued, so non-iso-valued empty objects shouldn't return empty scalar.

@eriknw
eriknw force-pushed the 44-ss-iso-value-empty branch 2 times, most recently from c441921 to aeeb43b Compare October 21, 2026 04:14
@eriknw
eriknw force-pushed the 44-ss-iso-value-empty branch from aeeb43b to 0a2bc65 Compare October 21, 2026 08:38
@eriknw
eriknw removed this pull request from stack #650 October 28, 2026 04:29
@eriknw
eriknw force-pushed the 44-ss-iso-value-empty branch from 0a2bc65 to 68ace37 Compare October 28, 2026 04:29
@eriknw
eriknw added this pull request to stack #653 October 28, 2026 04:30
@eriknw
eriknw removed this pull request from stack #653 October 28, 2026 04:31
@eriknw
eriknw added this pull request to stack #655 October 28, 2026 04:32
@eriknw
eriknw removed this pull request from stack #655 October 28, 2026 04:33
@eriknw
eriknw added this pull request to stack #657 October 28, 2026 04:33
@eriknw
eriknw force-pushed the 44-ss-iso-value-empty branch from 68ace37 to 3e18216 Compare October 28, 2026 13:21
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
eriknw force-pushed the 44-ss-iso-value-empty branch from 3e18216 to cfff665 Compare October 29, 2026 02:01
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