Commit 9827d53a authored by Lewis Lakerink's avatar Lewis Lakerink
Browse files

Introduce condor accounting group user argument

parent f7c06da5
Pipeline #307764 failed with stages
in 3 minutes and 30 seconds
......@@ -131,9 +131,12 @@ class Node(object):
logger.debug(f"Adding job: {job_name}")
def add_accounting(self):
""" Add the accounting-group extra lines """
""" Add the accounting-group and accounting-group-user extra lines """
if self.inputs.accounting:
self.extra_lines.append(f"accounting_group = {self.inputs.accounting}")
# Check for accounting user
if self.inputs.accounting_user:
self.extra_lines.append(f"accounting_group_user = {self.inputs.accounting_user}")
else:
raise BilbyPipeError(
"No accounting tag provided - this is required for condor submission"
......
......@@ -56,6 +56,7 @@ class MainInput(Input):
self.label = args.label
self.log_directory = args.log_directory
self.accounting = args.accounting
self.accounting_user = args.accounting_user
self.sampler = args.sampler
self.detectors = args.detectors
self.coherence_test = args.coherence_test
......
......@@ -430,6 +430,11 @@ def create_parser(top_level=True):
type=nonestr,
help="Accounting group to use (see, https://accounting.ligo.org/user)",
)
submission_parser.add(
"--accounting-user",
type=nonestr,
help="Accounting group user to use (see, https://accounting.ligo.org/user)",
)
submission_parser.add("--label", type=str, default="label", help="Output label")
submission_parser.add(
"--local",
......
......@@ -95,6 +95,12 @@ class TestBilbyConfigFileParser(unittest.TestCase):
args, unknown_args = parse_args([self.test_ini_filename], self.parser)
self.assertEqual(args.accounting, "test")
def test_accounting_user(self):
lines = ["accounting_user: albert.einstein"]
self.write_tempory_ini_file(lines)
args, unknown_args = parse_args([self.test_ini_filename], self.parser)
self.assertEqual(args.accounting_user, "albert.einstein")
def test_sampler_kwargs_flat(self):
kwargs_expected = dict(walks=1000)
lines = ["sampler-kwargs: {walks:1000}"]
......
......@@ -20,6 +20,7 @@ class TestDagCommandLine(unittest.TestCase):
args, unknown_args = bilby_pipe.main.parse_args(self.default_args, self.parser)
self.assertEqual(args.ini, self.default_args[0])
self.assertEqual(args.accounting, "test.test")
self.assertEqual(args.accounting_user, "albert.einstein")
def test_empty_unknown_args(self):
_, unknown_args = bilby_pipe.main.parse_args(self.default_args, self.parser)
......
accounting = test.test
accounting_user = albert.einstein
trigger-time = 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment