Skip to content

Commit

Permalink
fix: skeleton sharded merge not correctly passing spatial index arg
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Mar 30, 2022
1 parent ab3965d commit 2734768
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion igneous/task_creation/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ def create_sharded_skeleton_merge_tasks(
ShardedSkeletonMergeTask(
layer_path, shard_no,
dust_threshold, tick_threshold,
max_cable_length=max_cable_length
max_cable_length=max_cable_length,
spatial_index_db=spatial_index_db,
)
for shard_no in shard_labels.keys()
]
Expand Down
12 changes: 7 additions & 5 deletions igneous/tasks/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ class ShardedSkeletonMergeTask(RegisteredTask):
def __init__(
self, cloudpath, shard_no,
dust_threshold=4000, tick_threshold=6000,
sqlite_db=None, max_cable_length=None
spatial_index_db=None, max_cable_length=None
):
super(ShardedSkeletonMergeTask, self).__init__(
cloudpath, shard_no,
dust_threshold, tick_threshold, sqlite_db,
dust_threshold, tick_threshold, spatial_index_db,
max_cable_length
)
self.progress = False
Expand All @@ -326,7 +326,11 @@ def __init__(
def execute(self):
# cache is necessary for local computation, but on GCE download is very fast
# so cache isn't necessary.
cv = CloudVolume(self.cloudpath, cache=False, progress=self.progress)
cv = CloudVolume(
self.cloudpath,
progress=self.progress,
spatial_index_db=self.spatial_index_db
)

# This looks messy because we are trying to avoid retaining
# unnecessary memory. In the original iteration, this was
Expand Down Expand Up @@ -432,8 +436,6 @@ def get_unfused(self, labels, filenames, cv):

def locations_for_labels(self, labels, cv):
SPATIAL_EXT = re.compile(r'\.spatial$')
if self.sqlite_db:
cv.skeleton.spatial_index.sqlite_db = self.sqlite_db
index_filenames = cv.skeleton.spatial_index.file_locations_per_label(labels)
for label, locations in index_filenames.items():
for i, location in enumerate(locations):
Expand Down

0 comments on commit 2734768

Please sign in to comment.