Skip to content

Commit

Permalink
Line plot: replace scipy.sparse .A with .toarray()
Browse files Browse the repository at this point in the history
.A shortcut was removed in scipy 1.14
  • Loading branch information
markotoplak committed Jun 28, 2024
1 parent 6f4c3a7 commit fcefef7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Orange/widgets/visualize/owlineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ def update_sel_range(self, y_data):
def __get_disconnected_curve_data(y_data):
m, n = y_data.shape
x = np.arange(m * n) % n + 1
y = y_data.A.flatten() if sp.issparse(y_data) else y_data.flatten()
connect = ~np.isnan(y_data.A if sp.issparse(y_data) else y_data)
y = y_data.toarray().flatten() if sp.issparse(y_data) else y_data.flatten()
connect = ~np.isnan(y_data.toarray() if sp.issparse(y_data) else y_data)
connect[:, -1] = False
connect = connect.flatten()
return x, y, connect
Expand All @@ -687,8 +687,8 @@ def __get_disconnected_curve_data(y_data):
def __get_disconnected_curve_missing_data(y_data):
m, n = y_data.shape
x = np.arange(m * n) % n + 1
y = y_data.A.flatten() if sp.issparse(y_data) else y_data.flatten()
connect = np.isnan(y_data.A if sp.issparse(y_data) else y_data)
y = y_data.toarray().flatten() if sp.issparse(y_data) else y_data.flatten()
connect = np.isnan(y_data.toarray() if sp.issparse(y_data) else y_data)
# disconnect until the first non nan
first_non_nan = np.argmin(connect, axis=1)
for row in np.flatnonzero(first_non_nan):
Expand Down

0 comments on commit fcefef7

Please sign in to comment.