Closed josephcoombe closed 4 years ago
Temporary workaround:
class SaveImageArtifacts(Component):
def __init__(self):
super(SaveImageArtifacts, self).__init__()
self.add_param('In', val=0.0)
self.add_param('Save_Image_Artifacts', val=True)
self.add_output("images_zip", val=FileRef("images.zip"), pass_by_obj=True, binary=True)
# FIXME: Hack for https://github.com/metamorph-inc/run_mdao/issues/5
with ZipFile('images.zip', 'w') as zout:
pass
See #6
Raising AnalysisError will crash PET with FileRef Objectives in Driver
https://github.com/metamorph-inc/run_mdao/blob/1d515cc4135566cb6c3bb2d7e43c5072accb5d86/run_mdao/csv_recorder.py#L124
We should have some logic to catch "IOError: [Errno 2] No such file or directory:" - at the very least in the case of an AnalysisError.
I would go further and suggest that we always catch IOErrors (perhaps print a warning instead) since that would allow much more flexibility with PET Analysis blocks that don't always produce an image.