mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nlp.git
synced 2024-12-26 08:04:17 +00:00
Add a switch for zip functionality
This commit is contained in:
parent
5f20f9be40
commit
e4ef4835e5
13
nlp
13
nlp
@ -35,6 +35,14 @@ def parse_arguments():
|
||||
help='total number of cores available',
|
||||
required=False,
|
||||
type=int)
|
||||
parser.add_argument(
|
||||
'--zip',
|
||||
action='store_true',
|
||||
default=False,
|
||||
dest='zip',
|
||||
help='package result files in zip bundles',
|
||||
required=False
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
@ -44,6 +52,7 @@ class NLPWorkflow(WorkflowRunner):
|
||||
self.lang = args.lang
|
||||
self.n_cores = args.n_cores
|
||||
self.output_dir = args.output_dir
|
||||
self.zip = args.zip
|
||||
|
||||
def workflow(self):
|
||||
if len(self.jobs) == 0:
|
||||
@ -93,14 +102,14 @@ class NLPWorkflow(WorkflowRunner):
|
||||
|
||||
vrt_zip_jobs = []
|
||||
vrt_zip_job_dependencies = nlp_jobs
|
||||
cmd = 'cd "%s" && zip vrt.zip */*.vrt -x "pyflow.data*" && cd -' % (
|
||||
cmd = 'cd "%s" && zip -m vrt.zip */*.vrt -x "pyflow.data*" && cd -' % (
|
||||
self.output_dir
|
||||
)
|
||||
vrt_zip_jobs.append(
|
||||
self.addTask(
|
||||
command=cmd,
|
||||
dependencies=vrt_zip_job_dependencies,
|
||||
label='vrt_zip_job_-_%i' % (index)
|
||||
label='vrt_zip_job'
|
||||
)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user