You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to automatically remove intermediate files after they are not needed anymore?
I thought to use the is_tmp argument from TargetInfo, but then I get an Unfulfilled dependency error.
For example, if I add is_tmp=True to the example from the tutorial:
importsciluigiasslclassMyFooWriter(sl.Task):
# We have no inputs here# Define outputs:defout_foo(self):
returnsl.TargetInfo(self, 'foo.txt', is_tmp=True)
defrun(self):
withself.out_foo().open('w') asfoofile:
foofile.write('foo\n')
classMyFooReplacer(sl.Task):
replacement=sl.Parameter() # Here, we take as a parameter# what to replace foo with.# Here we have one input, a "foo file":in_foo=None# ... and an output, a "bar file":defout_replaced(self):
# As the path to the returned target(info), we# use the path of the foo file:returnsl.TargetInfo(self, self.in_foo().path+'.bar.txt')
defrun(self):
withself.in_foo().open() asin_f:
withself.out_replaced().open('w') asout_f:
# Here we see that we use the parameter self.replacement:out_f.write(in_f.read().replace('foo', self.replacement))
classMyWorkflow(sl.WorkflowTask):
defworkflow(self):
foowriter=self.new_task('foowriter', MyFooWriter)
fooreplacer=self.new_task('fooreplacer', MyFooReplacer,
replacement='bar')
# Here we do the *magic*: Connecting outputs to inputs:fooreplacer.in_foo=foowriter.out_foo# Return the last task(s) in the workflow chain.returnfooreplacerif__name__=='__main__':
sl.run_local(main_task_cls=MyWorkflow)
I get:
raise RuntimeError('Unfulfilled %s at run time: %s' % (deps, ', '.join(missing)))
RuntimeError: Unfulfilled dependency at run time: MyFooWriter_foowriter_MyWorkflow_insta_1c49888331
The text was updated successfully, but these errors were encountered:
Is there a way to automatically remove intermediate files after they are not needed anymore?
I thought to use the
is_tmp
argument fromTargetInfo
, but then I get an Unfulfilled dependency error.For example, if I add
is_tmp=True
to the example from the tutorial:I get:
The text was updated successfully, but these errors were encountered: