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

Test the fmm engine guards, string weights, and config key completions; combine repeated indices in csr, csc and GCXS imports - #609

Open
eriknw wants to merge 3 commits into
20-networkx-ingestionfrom
29-io-config-coverage
Open

eriknw wants to merge 3 commits into
20-networkx-ingestionfrom
29-io-config-coverage

Conversation

@eriknw

@eriknw eriknw commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Three behaviors had no test at all in the fast tier. Asking for the
deprecated "fmm"/"fast_matrix_market" Matrix Market engine when
fast_matrix_market is not installed must warn about the deprecation
before it fails, and then fail with an ImportError naming the engine;
neither read nor write had coverage for that, since the existing engine
tests skip themselves when the package is missing. String edge weights
in from_networkx infer a 1-D <U array, so only the dtype-kind half of
the guard sends them down the scipy fallback; the neighboring
array-weight test exercises only the shape half. And the config
mapping's ipython_key_completions hook, which drives config[<tab>]
in IPython, was never called.

Each test was checked by perturbing the line it covers and confirming
it goes red.

Added in the 2026-10-20 coverage round

Behavior fix: repeated indices in an imported csr, csc or GCXS array
(main too). A scipy csr or csc array outside canonical format, and a
pydata GCXS array, may repeat an index within a row (or column), and
from_scipy_sparse imported the arrays unchecked. The Matrix was invalid
(GxB_Matrix_fprint: GrB_INVALID_OBJECT), with nvals counting both entries.

Before: from_pydata_sparse of a 2x3 GCXS with indices [1, 1, 0] in row 0
(values 1, 2, 3) and [2] in row 1 gave nvals 4 with two (0, 1) entries,
and to_dense 2.0 at (0, 1), where pydata's todense gives 3.0.
from_scipy_sparse of the same csr array did the same.

After:

  • from_scipy_sparse builds such an array through coo, so repeats need
    dup_op, as they already did in coo input. Without it, a csr or csc with
    a repeated index now raises ValueError "Duplicate indices found" instead
    of building the invalid Matrix.
  • from_pydata_sparse sums a GCXS's repeats by default, as pydata's todense
    does (and its COO does when built), with scipy's sum_duplicates on a
    copy, so the caller's arrays are unchanged and any dtype works. dup_op
    combines them otherwise. A 1-d GCXS already summed them (through
    asformat("coo")).
  • Unsorted but distinct indices give the same Matrix as before.

New tests: test_from_scipy_sparse_compressed_duplicates (csr, csc) and
test_from_pydata_sparse_gcxs_duplicates (axis 0 and 1; int64, float64,
bool), which fail without the fix.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@eriknw
eriknw marked this pull request as ready for review August 4, 2026 16:07
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from fd8075e to b3592de Compare August 4, 2026 16:12
@eriknw
eriknw force-pushed the 29-io-config-coverage branch 2 times, most recently from 1a9ea9e to 4f77daf Compare August 5, 2026 03:18
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 4f77daf to b496504 Compare August 5, 2026 17:44
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from b496504 to 035b553 Compare August 5, 2026 18:03
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 035b553 to 91d6d15 Compare August 5, 2026 18:05
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 91d6d15 to 7ae8528 Compare August 6, 2026 07:59
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 7ae8528 to 6d95911 Compare August 6, 2026 15:39
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 6d95911 to 5698b2f Compare August 6, 2026 15:41
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 5698b2f to 28e3c0e Compare August 6, 2026 20:36
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 28e3c0e to 236b2a3 Compare August 6, 2026 20:42
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 236b2a3 to 88b96ee Compare August 7, 2026 02:48
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 88b96ee to 7da2c6f Compare August 7, 2026 05:09
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 7da2c6f to 59d6c14 Compare August 26, 2026 17:30
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 59d6c14 to 41b31e4 Compare September 18, 2026 03:09
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 7eb2e5d to 1cf3c44 Compare September 25, 2026 03:33
@eriknw
eriknw force-pushed the 29-io-config-coverage branch 3 times, most recently from dcd1088 to 9fdabf2 Compare September 26, 2026 05:25
@eriknw
eriknw force-pushed the 29-io-config-coverage branch 5 times, most recently from f023745 to 58a339b Compare October 3, 2026 04:57
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 58a339b to 2417560 Compare October 3, 2026 04:57
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from 2417560 to bea7d2a Compare October 4, 2026 06:21
@eriknw
eriknw removed this pull request from stack #634 October 8, 2026 21:02
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from bea7d2a to 6d8ad80 Compare October 8, 2026 21:40
@eriknw
eriknw added this pull request to stack #635 October 8, 2026 21:46
@eriknw
eriknw force-pushed the 29-io-config-coverage branch 2 times, most recently from a19d2f9 to f7ca59d Compare October 9, 2026 05:25
@eriknw
eriknw force-pushed the 29-io-config-coverage branch from f7ca59d to 8fff3a4 Compare October 14, 2026 18:45
@eriknw
eriknw removed this pull request from stack #635 October 19, 2026 07:45
@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.78%. Comparing base (7536047) to head (556052b).

Additional details and impacted files
@@                    Coverage Diff                    @@
##           20-networkx-ingestion     #609      +/-   ##
=========================================================
- Coverage                  98.79%   98.78%   -0.01%     
=========================================================
  Files                        105      105              
  Lines                      30278    30373      +95     
  Branches                    3528     3534       +6     
=========================================================
+ Hits                       29912    30004      +92     
  Misses                       244      244              
- Partials                     122      125       +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Three behaviors had no test at all in the fast tier. Asking for the
deprecated "fmm"/"fast_matrix_market" Matrix Market engine when
fast_matrix_market is not installed must warn about the deprecation
before it fails, and then fail with an ImportError naming the engine;
neither read nor write had coverage for that, since the existing engine
tests skip themselves when the package is missing. String edge weights
in from_networkx infer a 1-D <U array, so only the dtype-kind half of
the guard sends them down the scipy fallback; the neighboring
array-weight test exercises only the shape half. And the config
mapping's _ipython_key_completions_ hook, which drives `config[<tab>]`
in IPython, was never called.

Each test was checked by perturbing the line it covers and confirming
it goes red.
Behavior fix. A scipy csr or csc array outside canonical format, and a
pydata GCXS array, may repeat an index within a row (column), and
from_scipy_sparse imported the arrays unchecked. The Matrix was invalid
(GxB_Matrix_fprint: GrB_INVALID_OBJECT), with nvals counting both entries.

Before: from_pydata_sparse of a 2x3 GCXS with indices [1, 1, 0] in row 0
(values 1, 2, 3) and [2] in row 1 gave nvals 4 with two (0, 1) entries
and to_dense 2.0 at (0, 1), where pydata's todense gives 3.0.
from_scipy_sparse of the same csr array did the same.

After: from_scipy_sparse builds such an array through coo, so repeats
need dup_op as they do in coo input (ValueError "Duplicate indices
found" without it). from_pydata_sparse sums them by default (with
scipy's sum_duplicates, on a copy, so any dtype works), as pydata's
todense does and its COO does when built; dup_op combines them
otherwise. Unsorted but distinct indices give the same Matrix as before,
now built from coo. A 1-d GCXS already summed its repeats (through
asformat("coo")).
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