GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Reject unholdable weights in from_networkx without asking scipy by eriknw · Pull Request #644 · python-graphblas/python-graphblas Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## 20-networkx-ingestion #644 +/- ## ======================================================== Coverage ? 99.06% ======================================================== Files ? 106 Lines ? 32921 Branches ? 3829 ======================================================== Hits ? 32614 Misses ? 221 Partials ? 86 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6113fd6 to
bbd4362
Compare
bbd4362 to
d507287
Compare
1d20b11 to
5f883b9
Compare
00d0249 to
75fcc19
Compare
75fcc19 to
25b9b65
Compare
a5e4b11 to
aa83f70
Compare
6941029 to
97d7af8
Compare
f64d00c to
1d01e55
Compare
1d01e55 to
4643139
Compare
4643139 to
ecfe7b3
Compare
from_networkx builds its coo arrays directly, but for weights a matrix cannot hold (strings, objects, ints beyond 64 bits, uniform-length sequences) it still called nx.to_scipy_sparse_array, only so that scipy would raise. That made the error depend on scipy: ValueError since 1.15, a TypeError or a NetworkXError blaming the sparse format before (which abf6f62 restated as ValueError), and, with scipy not installed, a ModuleNotFoundError from inside networkx. The fallback never returned a matrix, so from_networkx otherwise had no use for scipy at all. Raise the ValueError directly, naming the attribute and what it gave: edge weights must be bool, int (at most 64 bits), float or complex scalars; attribute 'weight' gives dtype <U1 and drop _from_networkx_via_scipy. The docstring gains a Raises section for this and for the NetworkXError cases it shares with nx.to_scipy_sparse_array. Only the message changes for callers with scipy; callers without it get the ValueError instead of an ImportError. The rejection tests are folded into one that covers each kind of weight on all four graph classes, with scipy importable and with it blocked through sys.modules, so they no longer skip without scipy. The multigraph scipy-free test blocks scipy the same way instead of monkeypatching the removed fallback.
ecfe7b3 to
467f9d4
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.