|
31 | 31 | from .cutting import run_multicut |
32 | 32 | from .exceptions import PreconditionError |
33 | 33 | from .exceptions import PostconditionError |
34 | | -from .utils.generic import get_bounding_box as get_bbox |
| 34 | +from .utils.generic import get_bounding_box as get_bbox, get_valid_timestamp |
35 | 35 | from ..logging.log_db import TimeIt |
36 | 36 |
|
37 | 37 |
|
@@ -432,6 +432,8 @@ def execute( |
432 | 432 | lock.locked_root_ids, |
433 | 433 | np.array([lock.operation_id] * len(lock.locked_root_ids)), |
434 | 434 | ) |
| 435 | + if timestamp is None: |
| 436 | + timestamp = get_valid_timestamp(timestamp) |
435 | 437 |
|
436 | 438 | log_record_before_edit = self._create_log_record( |
437 | 439 | operation_id=lock.operation_id, |
@@ -865,7 +867,7 @@ def __init__( |
865 | 867 | self.path_augment = path_augment |
866 | 868 | self.disallow_isolating_cut = disallow_isolating_cut |
867 | 869 | self.do_sanity_check = do_sanity_check |
868 | | - if np.any(np.in1d(self.sink_ids, self.source_ids)): |
| 870 | + if np.any(np.isin(self.sink_ids, self.source_ids)): |
869 | 871 | raise PreconditionError( |
870 | 872 | "Supervoxels exist in both sink and source, " |
871 | 873 | "try placing the points further apart." |
@@ -914,8 +916,8 @@ def _apply( |
914 | 916 | supervoxels = np.concatenate( |
915 | 917 | [agg.supervoxels for agg in l2id_agglomeration_d.values()] |
916 | 918 | ) |
917 | | - mask0 = np.in1d(edges.node_ids1, supervoxels) |
918 | | - mask1 = np.in1d(edges.node_ids2, supervoxels) |
| 919 | + mask0 = np.isin(edges.node_ids1, supervoxels) |
| 920 | + mask1 = np.isin(edges.node_ids2, supervoxels) |
919 | 921 | edges = edges[mask0 & mask1] |
920 | 922 | if len(edges) == 0: |
921 | 923 | raise PreconditionError("No local edges found.") |
|
0 commit comments