Skip to content

Commit

Permalink
Remove suggested shortcuts that reuse tables or parts of tables due t…
Browse files Browse the repository at this point in the history
…o locking problems
  • Loading branch information
markotoplak committed Oct 7, 2021
1 parent 8c251ea commit d45703c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions Orange/data/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,6 @@ def _filter_has_class(self, negate=False):
retain = bn.anynan(self._Y, axis=1)
if not negate:
retain = np.logical_not(retain)
# TODO: Decide whether to keep this or not;
if np.all(retain):
return self
return self.from_table_rows(self, retain)

def _filter_same_value(self, column, value, negate=False):
Expand Down Expand Up @@ -2288,25 +2285,6 @@ def _subarray(arr, rows, cols):
return arr[_rxc_ix(rows, cols)]


# TODO: Pick that one or the one above
def _subarray2(arr, rows, cols):
rows = _optimize_indices(rows, arr.shape[0])
if arr.ndim == 1:
sub_arr = arr[rows]
else:
cols = _optimize_indices(cols, arr.shape[1])
sub_arr = arr[_rxc_ix(rows, cols)]
# Don't return a view when it is the same as the original
if isinstance(sub_arr, np.ndarray) \
and type(sub_arr) is type(arr) \
and sub_arr.base is arr \
and sub_arr.shape == arr.shape \
and sub_arr.strides == arr.strides:
return arr
else:
return sub_arr


def _optimize_indices(indices, maxlen):
"""
Convert integer indices to slice if possible. It only converts increasing
Expand Down

0 comments on commit d45703c

Please sign in to comment.