Skip to content

Commit

Permalink
Merge pull request #83 from seung-lab/contact_surface
Browse files Browse the repository at this point in the history
Fix standalone contact surface run
  • Loading branch information
ranlu authored Mar 24, 2024
2 parents 925af5b + a2e2d57 commit 6232767
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
18 changes: 8 additions & 10 deletions dags/sanitycheck_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def check_cv_data():
slack_message("""*Use semantic labels in* `{}`""".format(param["SEM_PATH"]))

if param.get("SKIP_AGG", False):
if not all((param.get("SKIP_DOWNSAMPLE", False), param.get("SKIP_MESHING", False), param.get("SKIP_SKELETON", False))):
if param.get("SKIP_WS", False) or not (param.get("SKIP_DOWNSAMPLE", False) and param.get("SKIP_MESHING", False) and param.get("SKIP_SKELETON", False)):
if "SEG_PATH" not in param:
slack_message(":u7981:*ERROR: Must specify path for a existing segmentation when SKIP_AGG is used*")
raise ValueError('Must specify path for a existing segmentation when SKIP_AGG is used')
Expand All @@ -166,9 +166,6 @@ def check_cv_data():
slack_message(":u7981:*ERROR: Cannot access the segmentation layer* `{}`".format(param["SEG_PATH"]))
raise

if param.get("SKIP_WS", False):
param["AFF_PATH"] = "N/A" if "AFF_PATH" not in param else param["AFF_PATH"]
param["WS_PATH"] = "N/A" if "WS_PATH" not in param else param["WS_PATH"]
param["AFF_MIP"] = 0
param["AFF_RESOLUTION"] = vol_seg.resolution.tolist()
if "BBOX" not in param:
Expand Down Expand Up @@ -295,12 +292,13 @@ def print_summary():
for p in ["SCRATCH", "WS", "SEG"]:
path = "{}_PATH".format(p)
if path not in param:
paths[path] = param["{}_PREFIX".format(p)]+param["NAME"]
if f"{p}_PREFIX" in param:
paths[path] = param["{}_PREFIX".format(p)]+param["NAME"]
else:
paths[path] = param["{}_PATH".format(p)]

gcs_buckets = set()
for path in list(paths.values()) + [param['AFF_PATH'], param.get("SEM_PATH", None), param.get("GT_PATH", None)]:
for path in list(paths.values()) + [param.get('AFF_PATH', None), param.get("SEM_PATH", None), param.get("GT_PATH", None)]:
if path:
components = extract(path)
if components.protocol == "gs":
Expand All @@ -318,13 +316,13 @@ def print_summary():
Segmentation: `{seg}`
Region graph and friends: `{scratch}`
'''.format(
aff = param["AFF_PATH"],
aff = param.get("AFF_PATH", "N/A"),
resolution = ", ".join(str(x) for x in param["AFF_RESOLUTION"]),
bbox = ", ".join(str(x) for x in data_bbox),
size = ", ".join(str(data_bbox[i+3] - data_bbox[i]) for i in range(3)),
ws = paths["WS_PATH"],
seg = paths["SEG_PATH"],
scratch = paths["SCRATCH_PATH"],
ws = paths.get("WS_PATH", "N/A"),
seg = paths.get("SEG_PATH", "N/A"),
scratch = paths.get("SCRATCH_PATH", "N/A"),
)

if param.get("SEM_PATH", None):
Expand Down
6 changes: 3 additions & 3 deletions dags/segmentation_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def process_infos(param):
Affinity mip level: {mip}
Bounding box: [{bbox}]'''.format(
name = param["NAME"],
aff = param["AFF_PATH"],
aff = param.get("AFF_PATH", "N/A"),
bbox = ", ".join(str(x) for x in param["BBOX"]),
mip = param.get("AFF_MIP",0)
)
Expand All @@ -482,8 +482,8 @@ def process_infos(param):
Watershed layer: `{ws}`
Segmentation Layer: `{seg}`'''.format(
name = param["NAME"],
ws = param["WS_PATH"],
seg = param["SEG_PATH"]
ws = param.get("WS_PATH", "N/A"),
seg = param.get("SEG_PATH", "N/A")
)

no_rescale_msg = ":exclamation: Cannot rescale cluster"
Expand Down

0 comments on commit 6232767

Please sign in to comment.