Skip to content

Commit

Permalink
feat: default mesh dynamic dir; chebyshev query param (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshh authored Aug 15, 2024
1 parent c1b7740 commit 8ae9409
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pychunkedgraph/app/segmentation/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def handle_merge(table_id, allow_same_segment_merge=False):

nodes = json.loads(request.data)
is_priority = request.args.get("priority", True, type=str2bool)
chebyshev_distance = request.args.get("chebyshev_distance", 3, type=int)

current_app.logger.debug(nodes)
assert len(nodes) == 2
Expand All @@ -276,7 +277,7 @@ def handle_merge(table_id, allow_same_segment_merge=False):
atomic_edge[0]
) - cg.get_chunk_coordinates(atomic_edge[1])

if np.any(np.abs(chunk_coord_delta) > 3):
if np.any(np.abs(chunk_coord_delta) > chebyshev_distance):
raise cg_exceptions.BadRequest(
"Chebyshev distance between merge points exceeded allowed maximum "
"(3 chunks)."
Expand Down
3 changes: 2 additions & 1 deletion workers/mesh_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def callback(payload):

try:
mesh_dir = cg.meta.dataset_info["mesh"]
cv_unsharded_mesh_dir = cg.meta.dataset_info["mesh_metadata"]["unsharded_mesh_dir"]
mesh_meta = cg.meta.dataset_info["mesh_metadata"]
cv_unsharded_mesh_dir = mesh_meta.get("unsharded_mesh_dir", "dynamic")
except KeyError:
logging.warning(f"No metadata found for {cg.graph_id}; ignoring...")
return
Expand Down

0 comments on commit 8ae9409

Please sign in to comment.