JobResourceFile
- class hailtop.batch.resource.JobResourceFile(value, source)
Bases:
ResourceFileClass representing an intermediate file from a job.
Examples
j.ofile is a
JobResourceFileon the job`j`:>>> b = Batch() >>> j = b.new_job(name='hello-tmp') >>> j.command(f'echo "hello world" > {j.ofile}') >>> b.run()
Notes
All
JobResourceFileare temporary files and must be written to a permanent location usingBatch.write_output()if the output needs to be saved.Methods
Specify the file extension to use.
- rtype:
- add_extension(extension)
Specify the file extension to use.
Examples
>>> b = Batch() >>> j = b.new_job() >>> j.command(f'echo "hello" > {j.ofile}') >>> j.ofile.add_extension('.txt') >>> b.run()
Notes
The default file name for a
JobResourceFileis the name of the identifier.- Parameters:
extension (
str) – File extension to use.- Return type:
- Returns:
JobResourceFile– Same resource file with the extension specified