File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -78,24 +78,26 @@ def from_list_if_single(obj: ty.Any) -> ty.Any:
7878 return obj
7979
8080
81- def print_help (obj ) :
81+ def print_help (defn : "TaskDef[DefType]" ) -> list [ str ] :
8282 """Visit a task object and print its input/output interface."""
83- lines = [f"Help for { obj .__class__ .__name__ } " ]
84- if attrs .fields (obj .interface ):
83+ from pydra .design .base import EMPTY
84+
85+ lines = [f"Help for { defn .__class__ .__name__ } " ]
86+ if list_fields (defn ):
8587 lines += ["Input Parameters:" ]
86- for f in attrs . fields ( obj . interface ):
88+ for f in list_fields ( defn ):
8789 default = ""
88- if f .default != attrs . NOTHING and not f .name .startswith ("_" ):
90+ if f .default is not EMPTY and not f .name .startswith ("_" ):
8991 default = f" (default: { f .default } )"
9092 try :
9193 name = f .type .__name__
9294 except AttributeError :
9395 name = str (f .type )
9496 lines += [f"- { f .name } : { name } { default } " ]
95- output_klass = obj . interface .Outputs
96- if attrs . fields (output_klass ):
97+ output_klass = defn .Outputs
98+ if list_fields (output_klass ):
9799 lines += ["Output Parameters:" ]
98- for f in attrs . fields (output_klass ):
100+ for f in list_fields (output_klass ):
99101 try :
100102 name = f .type .__name__
101103 except AttributeError :
You can’t perform that action at this time.
0 commit comments