Skip to content

Commit 8881bf4

Browse files
committed
Clean up comments and remove conftest.txt -- PR ready to remove Draft status
1 parent 760c6e4 commit 8881bf4

File tree

4 files changed

+6
-158
lines changed

4 files changed

+6
-158
lines changed

libpysal/conftest.txt

Lines changed: 0 additions & 153 deletions
This file was deleted.

libpysal/weights/raster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def da2WSP(
270270
# then eliminate zeros from the data. This changes the
271271
# sparsity of the csr_matrix !!
272272
if k > 1 and not include_nodata:
273-
#### Could be as follows after scipy >=1.12 is required
273+
#### Can be this one-liner after scipy >=1.12 is assured
274274
# sw = sum(sparse.linalg.matrix_power(sw, x) for x in range(1, k + 1))
275275
tmp = sw.copy()
276276
for _ in range(k - 1):

libpysal/weights/tests/test_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ def test_lat2_sw(self, row_st):
3434
pct_nonzero = w9.nnz / float(n)
3535
assert pct_nonzero == 0.29629629629629628
3636
if row_st:
37-
# these 3 lines can be replaced when scipy >=1.15 is assured.
37+
#### Can be this one-liner after scipy >=1.15 is assured
3838
# w9 = (w9.T.multiply(w9.tocsr().count_nonzero(axis=1))).T
3939
w9csr = w9.tocsr()
4040
nnz_by_axis1 = np.diff(w9csr.indptr)
4141
w9 = (w9csr.T.multiply(nnz_by_axis1)).T
42+
####
4243
data = w9.todense().tolist()
4344
assert data[0] == [0, 1, 0, 1, 0, 0, 0, 0, 0]
4445
assert data[1] == [1, 0, 1, 0, 1, 0, 0, 0, 0]

libpysal/weights/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,14 +524,14 @@ def higher_order_sp(
524524

525525
if lower_order:
526526
shortest_path = False
527-
#### Could be as follows after scipy >=1.12 is required
527+
#### Can be this one-liner after scipy >=1.12 is assured
528528
# wk = sum(sparse.linalg.matrix_power(w, k) for k in range(1, k+1))
529529
wk = w.copy()
530530
for _ in range(k - 1):
531531
wk = wk @ w + w
532532
####
533533
else:
534-
#### Could be as follows after scipy >=1.12 is required
534+
#### Can be this one-liner after scipy >=1.12 is assured
535535
# wk = sparse.linalg.matrix_power(w, k)
536536
wk = w.copy()
537537
x = 1
@@ -548,7 +548,7 @@ def higher_order_sp(
548548

549549
if shortest_path:
550550
for j in range(1, k):
551-
#### Could be as follows after scipy >=1.12 is required
551+
#### Can be this one-liner after scipy >=1.12 is assured
552552
# wj = sparse.linalg.matrix_power(w, j)
553553
wj = w.copy()
554554
x = 1

0 commit comments

Comments
 (0)