Skip to content

Commit

Permalink
Merge pull request biolab#6845 from markotoplak/replace.A
Browse files Browse the repository at this point in the history
[FIX] Line plot: compatibility with scipy 1.14
  • Loading branch information
lanzagar authored Jun 28, 2024
2 parents 6f4c3a7 + fcefef7 commit 910d625
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 910d625

Please sign in to comment.