Skip to content

Commit fca6eff

Browse files
committed
fix(upgrade): include timestamps for partner supervoxel parents
1 parent dcbecd1 commit fca6eff

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

pychunkedgraph/__init__.py

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

pychunkedgraph/ingest/upgrade/atomic_layer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def update_cross_edges(
15-
cg: ChunkedGraph, node, cx_edges_d, node_ts, timestamps, earliest_ts
15+
cg: ChunkedGraph, node, cx_edges_d: dict, node_ts, timestamps: set, earliest_ts
1616
) -> list:
1717
"""
1818
Helper function to update a single L2 ID.
@@ -27,7 +27,11 @@ def update_cross_edges(
2727
assert not exists_as_parent(cg, node, edges[:, 0])
2828
return rows
2929

30-
for ts in timestamps:
30+
partner_parent_ts_d = get_parent_timestamps(cg, edges[:, 1])
31+
for v in partner_parent_ts_d.values():
32+
timestamps.update(v)
33+
34+
for ts in sorted(timestamps):
3135
if ts < earliest_ts:
3236
ts = earliest_ts
3337
val_dict = {}

pychunkedgraph/ingest/upgrade/parent_layer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ def update_chunk(
163163
tasks.append(args)
164164

165165
with mp.Pool(min(mp.cpu_count(), len(tasks))) as pool:
166-
tqdm(
167-
pool.imap_unordered(_update_cross_edges_helper, tasks),
168-
total=len(tasks),
166+
_ = list(
167+
tqdm(
168+
pool.imap_unordered(_update_cross_edges_helper, tasks),
169+
total=len(tasks),
170+
)
169171
)
170172
print(f"total elaspsed time: {time.time() - start}")

pychunkedgraph/ingest/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import logging
44
import functools
5+
import math
56
from os import environ
67
from time import sleep
78
from typing import Any, Generator, Tuple
@@ -163,7 +164,7 @@ def print_status(imanager: IngestionManager, redis, upgrade: bool = False):
163164
)
164165
print(header)
165166
for layer, done, count in zip(layers, completed, layer_counts):
166-
print(f"{layer}\t| {done:9} / {count} \t| {done/count:6.1%}")
167+
print(f"{layer}\t| {done:9} / {count} \t| {math.floor((done/count)*100):6}%")
167168

168169
print("\n\nqueue status:")
169170
for layer, q, f, wb in zip(layers, queued, failed, worker_busy):

0 commit comments

Comments
 (0)