Skip to content

Commit 1d113e3

Browse files
committed
feat: default mesh dynamic dir; chebyshev query param
1 parent c1b7740 commit 1d113e3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pychunkedgraph/app/segmentation/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ def handle_merge(table_id, allow_same_segment_merge=False):
258258

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

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

279-
if np.any(np.abs(chunk_coord_delta) > 3):
280+
if np.any(np.abs(chunk_coord_delta) > chebyshev_distance):
280281
raise cg_exceptions.BadRequest(
281282
"Chebyshev distance between merge points exceeded allowed maximum "
282283
"(3 chunks)."

workers/mesh_worker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def callback(payload):
3838

3939
try:
4040
mesh_dir = cg.meta.dataset_info["mesh"]
41-
cv_unsharded_mesh_dir = cg.meta.dataset_info["mesh_metadata"]["unsharded_mesh_dir"]
41+
mesh_meta = cg.meta.dataset_info["mesh_metadata"]
42+
cv_unsharded_mesh_dir = mesh_meta.get("unsharded_mesh_dir", "dynamic")
4243
except KeyError:
4344
logging.warning(f"No metadata found for {cg.graph_id}; ignoring...")
4445
return

0 commit comments

Comments
 (0)