Skip to content

Commit

Permalink
Use keyword arguments for calls to cli.set_env_vars
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed May 27, 2020
1 parent e13b91c commit a0b32cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 6 additions & 4 deletions payu/subcommands/collate_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
def runcmd(model_type, config_path, init_run, lab_path, dir_path):

pbs_config = fsops.read_config(config_path)
pbs_vars = cli.set_env_vars(init_run, lab_path, dir_path)
pbs_vars = cli.set_env_vars(init_run=init_run,
lab_path=lab_path,
dir_path=dir_path)

collate_config = pbs_config.get('collate', {})

Expand Down Expand Up @@ -95,9 +97,9 @@ def runscript():

run_args = parser.parse_args()

pbs_vars = cli.set_env_vars(run_args.init_run,
run_args.lab_path,
run_args.dir_path)
pbs_vars = cli.set_env_vars(init_run=run_args.init_run,
lab_path=run_args.lab_path,
dir_path=run_args.dir_path)

for var in pbs_vars:
os.environ[var] = str(pbs_vars[var])
Expand Down
7 changes: 5 additions & 2 deletions payu/subcommands/profile_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
def runcmd(model_type, config_path, init_run, n_runs, lab_path):

pbs_config = fsops.read_config(config_path)
pbs_vars = cli.set_env_vars(init_run, n_runs, lab_path)
pbs_vars = cli.set_env_vars(init_run=init_run,
n_runs=n_runs,
lab_path=lab_path)

pbs_config['queue'] = pbs_config.get('profile_queue', 'normal')

Expand Down Expand Up @@ -71,7 +73,8 @@ def runscript():

run_args = parser.parse_args()

pbs_vars = cli.set_env_vars(run_args.init_run, run_args.n_runs)
pbs_vars = cli.set_env_vars(init_run=run_args.init_run,
n_runs=run_args.n_runs)
for var in pbs_vars:
os.environ[var] = str(pbs_vars[var])

Expand Down
7 changes: 5 additions & 2 deletions payu/subcommands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def runcmd(model_type, config_path, init_run, n_runs, lab_path,

# Get job submission configuration
pbs_config = fsops.read_config(config_path)
pbs_vars = cli.set_env_vars(init_run, n_runs, lab_path,
reproduce=reproduce, force=force)
pbs_vars = cli.set_env_vars(init_run=init_run,
n_runs=n_runs,
lab_path=lab_path,
reproduce=reproduce,
force=force)

# Set the queue
# NOTE: Maybe force all jobs on the normal queue
Expand Down

0 comments on commit a0b32cd

Please sign in to comment.