Skip to content

Commit 280f9fe

Browse files
committed
migration debug code
1 parent 79ae870 commit 280f9fe

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.0.3
2+
current_version = 3.0.1
33
commit = True
44
tag = True
55

pychunkedgraph/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.0.0"
1+
__version__ = "3.0.1"

pychunkedgraph/graph/edits.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def remove_edges(
313313
cg,
314314
*,
315315
atomic_edges: Iterable[np.ndarray],
316-
operation_id: basetypes.OPERATION_ID = None,
316+
operation_id: basetypes.OPERATION_ID = None, # type: ignore
317317
time_stamp: datetime.datetime = None,
318318
parent_ts: datetime.datetime = None,
319319
):
@@ -522,7 +522,7 @@ def __init__(
522522
cg,
523523
*,
524524
new_l2_ids: Iterable,
525-
operation_id: basetypes.OPERATION_ID,
525+
operation_id: basetypes.OPERATION_ID, # type: ignore
526526
time_stamp: datetime.datetime,
527527
new_old_id_d: Dict[np.uint64, Set[np.uint64]] = None,
528528
old_new_id_d: Dict[np.uint64, Set[np.uint64]] = None,
@@ -542,7 +542,7 @@ def __init__(
542542

543543
def _update_id_lineage(
544544
self,
545-
parent: basetypes.NODE_ID,
545+
parent: basetypes.NODE_ID, # type: ignore
546546
children: np.ndarray,
547547
layer: int,
548548
parent_layer: int,
@@ -658,7 +658,21 @@ def _create_new_parents(self, layer: int):
658658
self._update_id_lineage(parent, cc_ids, layer, parent_layer)
659659
self.cg.cache.children_cache[parent] = cc_ids
660660
cache_utils.update(self.cg.cache.parents_cache, cc_ids, parent)
661-
sanity_check_single(self.cg, parent, self._operation_id)
661+
662+
try:
663+
sanity_check_single(self.cg, parent, self._operation_id)
664+
except AssertionError:
665+
from pychunkedgraph.debug.utils import get_l2children
666+
667+
pairs = [
668+
(a, b) for idx, a in enumerate(cc_ids) for b in cc_ids[idx + 1 :]
669+
]
670+
for c1, c2 in pairs:
671+
l2c1 = get_l2children(self.cg, c1)
672+
l2c2 = get_l2children(self.cg, c2)
673+
if np.intersect1d(l2c1, l2c2).size:
674+
msg = f"{self._operation_id}:{c1} {c2} have common children."
675+
raise ValueError(msg)
662676

663677
def run(self) -> Iterable:
664678
"""

0 commit comments

Comments
 (0)