Skip to content

Commit 2d0ce43

Browse files
committed
Add volume_size parameter to ComputeCurvatures
1 parent f93852f commit 2d0ce43

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

examples/run_workflow.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Helper script to dispatch workflows."""
22
from argparse import ArgumentParser, FileType
33
from metafold import MetafoldClient
4+
from pathlib import Path
5+
from pprint import pprint
46
import json
57
import os
68
import sys
@@ -17,7 +19,7 @@ def main():
1719

1820
parser.add_argument(
1921
"--asset-uploads", nargs="*",
20-
type=FileType("rb"), help="assets to upload before dispatch")
22+
type=Path, help="assets to upload before dispatch")
2123

2224
project_id = os.environ.get("METAFOLD_PROJECT_ID")
2325
parser.add_argument("-p", "--project-id", default=project_id)
@@ -60,19 +62,24 @@ def main():
6062

6163
if args.asset_uploads:
6264
print("Uploading assets…")
63-
for f in args.asset_uploads:
64-
m.assets.create(f)
65+
for p in args.asset_uploads:
66+
m.assets.create(p.resolve())
6567

6668
print("Running workflow…")
6769
definition = args.workflow.read()
6870
w = m.workflows.run(definition, assets=assets, parameters=params)
6971

7072
print(f"Workflow completed: {w.state}")
7173

72-
if w.state == "failure":
73-
for job_id in w.jobs:
74-
j = m.jobs.get(job_id)
75-
if j.state == "failure":
74+
for job_id in w.jobs:
75+
j = m.jobs.get(job_id)
76+
match j.state:
77+
case "success":
78+
if j.outputs and j.outputs.assets:
79+
pprint(j.outputs.assets)
80+
if j.outputs and j.outputs.params:
81+
pprint(j.outputs.params)
82+
case "failure":
7683
print(f"Job {j.id} failed: {j.error}")
7784

7885
return 0

metafold/func.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def __call__(self, eval_: Evaluator) -> TypedResult[Literal[FuncType.FLOAT]]:
106106
class ComputeCurvatures_Parameters(TypedDict, total=False):
107107
spacing_type: ComputeCurvatures_Enum_spacing_type
108108
step_size: float
109+
volume_size: Vec3f
109110

110111

111112
class ComputeCurvatures(TypedFunc[Literal[FuncType.VEC3F]]):

0 commit comments

Comments
 (0)