Skip to content

Commit

Permalink
Merge 6e40f8f into b1b7d2c
Browse files Browse the repository at this point in the history
  • Loading branch information
celiafish committed Jul 7, 2015
2 parents b1b7d2c + 6e40f8f commit 0409055
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions vt_config/NSLS-II/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def get_modules():
'skxray.io.gsas_file_reader',
'skxray.api.diffraction',
'vttools.to_wrap.fitting',
'tomopy',
]

for mod_name in mod_targets:
Expand Down
9 changes: 8 additions & 1 deletion vttools/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def define_input_ports(docstring, func, short_description_word_count=4):
return input_ports


def define_output_ports(docstring, short_description_word_count=4):
def define_output_ports(docstring, short_description_word_count=4, ret=None):
"""
Turn the 'Returns' fields into VisTrails output ports
Expand All @@ -628,9 +628,16 @@ def define_output_ports(docstring, short_description_word_count=4):
"""

output_ports = []
idx = 0

# now look at the return Returns section
for (the_name, the_type, the_description) in docstring['Returns']:
# when the return parameter has no name but only type and description
if the_type == '':
the_type = the_name
the_name = 'def_output' + str(idx)
idx += 1

base_type, is_optional = _type_optional(the_type)
if is_optional:
continue
Expand Down
2 changes: 1 addition & 1 deletion vttools/wrap_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def compute(self):
ret = library_func(**params_dict)
if len(output_ports) == 1:
self.set_output(output_ports[0].name, ret)
else:
elif ret: # only when output_ports is not empty
for (out_port, ret_val) in zip(output_ports, ret):
self.set_output(out_port.name, ret_val)

Expand Down

0 comments on commit 0409055

Please sign in to comment.