Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/hpsmc/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,15 @@ def parse_args(self):
if not os.path.isabs(out_file):
out_file = os.path.abspath(out_file)
logger.info('Job output will be written to: %s' % out_file)
self.out = open(out_file, 'w')
self.component_out = open(out_file, 'w')

# Set file for stderr from components
if cl.err:
err_file = cl.err
if not os.path.isabs(err_file):
err_file = os.path.abspath(err_file)
logger.info('Job error will be written to: %s' % err_file)
self.err = open(err_file, 'w')
self.component_err = open(err_file, 'w')

if cl.run_dir:
self.rundir = os.path.abspath(cl.run_dir)
Expand Down Expand Up @@ -335,6 +335,8 @@ def parse_args(self):
# Load data from a JSON file with a single job definition.
logger.info('Loading job parameters from file: %s' % self.param_file)
params = json.loads(open(self.param_file, 'r').read())
if isinstance(params, list):
params = params[0]
if not isinstance(params, dict):
raise Exception('Job ID must be provided when running from a job store.')

Expand Down
15 changes: 8 additions & 7 deletions python/hpsmc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def __init__(self, **kwargs):
self.input_file = None
self.minidst_args = None
# Ensure to call the parent constructor properly
Component.__init__(self, name='makeminidst',
Component.__init__(self, name='make_mini_dst',
command='make_mini_dst',
description='Create the MiniDST ROOT file',
output_ext='.root',
Expand Down Expand Up @@ -504,7 +504,8 @@ def output_files(self):
"""! Adjust names of output files."""
if self.outputs is None:
f, ext = os.path.splitext(self.input_files()[0])
self.outputs = f"{f}.root"
self.outputs = f"{f}_minidst.root"
print(f"Set outputs to: {self.outputs}")

return self.outputs

Expand All @@ -515,16 +516,16 @@ def cmd_args(self):
"""
args = []

print("===== Make MiniDST with input files: ", end="")
print("===== Make MiniDST with input files: ", end=" ")
for i in range(len(self.input_files())):
print(f"{self.input_files()[i]}", end=", ")
print(f" -> {self.output_files()}")
print(f" ==> {self.output_files()}")

args.extend(self.minidst_args)
if self.minidst_args is not None:
args.extend(self.minidst_args)

args.extend(['-o', self.output_files()[0]])
args.extend(['-o', self.output_files()])
args.extend(self.input_files())

return args


Expand Down