Skip to content

Commit

Permalink
Merge pull request #2372 from quant12345/scipy_matrix
Browse files Browse the repository at this point in the history
replacement for deprecated namespaces scipy.sparse.csc and scipy.sparse.csr
  • Loading branch information
vogt31337 committed Aug 29, 2024
2 parents 641134d + 41db0f5 commit a044a46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Change Log

[upcoming release] - 2024-..-..
-------------------------------
- [FIXED] replacement for deprecated namespaces scipy.sparse.csc and scipy.sparse.csr
- [FIXED] copy array element to standard python scalar
- [REMOVED] python 3.8 support
- [CHANGED] geopandas version to >= 1.0
Expand Down
6 changes: 3 additions & 3 deletions pandapower/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,15 +1395,15 @@ def phase_to_sequence(Xabc):

def I0_from_V012(V012, Y):
V0 = X012_to_X0(V012)
if type(Y) in [sp.sparse.csr.csr_matrix, sp.sparse.csc.csc_matrix]:
if type(Y) in [sp.sparse.csr_matrix, sp.sparse.csc_matrix]:
return np.asarray(np.matmul(Y.todense(), V0))
else:
return np.asarray(np.matmul(Y, V0))


def I1_from_V012(V012, Y):
V1 = X012_to_X1(V012)[:, np.newaxis]
if type(Y) in [sp.sparse.csr.csr_matrix, sp.sparse.csc.csc_matrix]:
if type(Y) in [sp.sparse.csr_matrix, sp.sparse.csc_matrix]:
i1 = np.asarray(np.matmul(Y.todense(), V1))
return np.transpose(i1)
else:
Expand All @@ -1413,7 +1413,7 @@ def I1_from_V012(V012, Y):

def I2_from_V012(V012, Y):
V2 = X012_to_X2(V012)
if type(Y) in [sp.sparse.csr.csr_matrix, sp.sparse.csc.csc_matrix]:
if type(Y) in [sp.sparse.csr_matrix, sp.sparse.csc_matrix]:
return np.asarray(np.matmul(Y.todense(), V2))
else:
return np.asarray(np.matmul(Y, V2))
Expand Down

0 comments on commit a044a46

Please sign in to comment.