From 4f1042610a8f2ea2e7eaf10f30c6bb0b2b77db85 Mon Sep 17 00:00:00 2001 From: Juraj Smiesko Date: Fri, 16 Jun 2023 12:12:22 +0200 Subject: [PATCH 1/2] Fixed hadling of empty outputDir --- man/man7/fccanalysis-file.7 | 7 +++++++ python/FCCAnalysisRun.py | 13 +++++++++---- python/Parsers.py | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/man/man7/fccanalysis-file.7 b/man/man7/fccanalysis-file.7 index ff3d681d0e..8fdd23038a 100644 --- a/man/man7/fccanalysis-file.7 +++ b/man/man7/fccanalysis-file.7 @@ -78,6 +78,13 @@ The analysis RDataFrame can be split into several chunks\&. .br Default value: 1 .RE +.RE +.PP +\fBoutputDir\fR +.RS 4 +User can specify the directory for the output files. The output directory can be +overwriten by specifiing absolute path with `\-\-output` commandline argument\&. +.RE .PP This section is under construction. You are invited to help :) .SH SEE ALSO diff --git a/python/FCCAnalysisRun.py b/python/FCCAnalysisRun.py index 65bcfe898f..2bc8b9cf72 100644 --- a/python/FCCAnalysisRun.py +++ b/python/FCCAnalysisRun.py @@ -371,15 +371,20 @@ def runLocal(rdfModule, infile_list, args): else: print(f'----> Info: Number of local events: {nevents_local}') - outfilepath = getElement(rdfModule, "outputDir") + output_dir = getElement(rdfModule, "outputDir") if not args.batch: - outfilepath += '/' + args.output + print(os.path.isabs(args.output)) + if os.path.isabs(args.output): + print('----> Warning: Provided output path is absolute, "outputDir" from analysis script will be ignored!') + outfile_path = os.path.join(output_dir, args.output) else: - outfilepath = args.output + outfile_path = args.output + print('----> Info: Output file path:') + print(' ' + outfile_path) #Run RDF start_time = time.time() - outn = runRDF(rdfModule, file_list, outfilepath, nevents_local, args) + outn = runRDF(rdfModule, file_list, outfile_path, nevents_local, args) outn = outn.GetValue() outfile = ROOT.TFile(outfilepath, 'update') diff --git a/python/Parsers.py b/python/Parsers.py index d2fc12d8cd..697866df66 100644 --- a/python/Parsers.py +++ b/python/Parsers.py @@ -18,7 +18,7 @@ def setup_build_parser(parser): publicOptions.add_argument('-j','--build-threads', type=int, default=1, - help='bumber of threads when building (equivalent to `make -j`)') + help='number of threads when building (equivalent to `make -j`)') def setup_pin_parser(parser): publicOptions = parser.add_argument_group('User pin options') From a46cc285c83cf13451529e2ed80b69e7e1c8c770 Mon Sep 17 00:00:00 2001 From: Juraj Smiesko Date: Fri, 16 Jun 2023 12:48:13 +0200 Subject: [PATCH 2/2] Forgotten rename --- python/FCCAnalysisRun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/FCCAnalysisRun.py b/python/FCCAnalysisRun.py index 2bc8b9cf72..c3bebc06de 100644 --- a/python/FCCAnalysisRun.py +++ b/python/FCCAnalysisRun.py @@ -387,7 +387,7 @@ def runLocal(rdfModule, infile_list, args): outn = runRDF(rdfModule, file_list, outfile_path, nevents_local, args) outn = outn.GetValue() - outfile = ROOT.TFile(outfilepath, 'update') + outfile = ROOT.TFile(outfile_path, 'update') param = ROOT.TParameter(int)('eventsProcessed', nevents_orig if nevents_orig != 0 else nevents_local) param.Write()