Skip to content

Commit

Permalink
PEP8 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed May 8, 2020
1 parent ba0bc8d commit 59d8c9e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
9 changes: 5 additions & 4 deletions payu/subcommands/collate_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
title = 'collate'
parameters = {'description': 'Collate tiled output into single output files'}

arguments = [args.model, args.config, args.initial, args.laboratory, args.dir_path]
arguments = [args.model, args.config, args.initial, args.laboratory,
args.dir_path]


def runcmd(model_type, config_path, init_run, lab_path, dir_path):
Expand Down Expand Up @@ -94,14 +95,14 @@ def runscript():

run_args = parser.parse_args()

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

for var in pbs_vars:
os.environ[var] = str(pbs_vars[var])

lab = Laboratory(run_args.model_type,
lab = Laboratory(run_args.model_type,
run_args.config_path,
run_args.lab_path)
expt = Experiment(lab)
Expand Down
2 changes: 1 addition & 1 deletion payu/subcommands/setup_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
]


def runcmd(model_type, config_path, lab_path, force_archive,
def runcmd(model_type, config_path, lab_path, force_archive,
reproduce=False, force=False):

lab = Laboratory(model_type, config_path, lab_path)
Expand Down
6 changes: 3 additions & 3 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def payu_setup(model_type=None,
with cd(ctrldir):
if sweep:
payu_sweep(model_type=None,
config_path=None,
hard_sweep=False,
lab_path=str(labdir))
config_path=None,
hard_sweep=False,
lab_path=str(labdir))
payu_setup_orignal(model_type,
config_path,
lab_path,
Expand Down
2 changes: 2 additions & 0 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

parser = None


def test_generate_parser():

global parser

parser = payu.cli.generate_parser()


def test_parse():

arguments = shlex.split("payu -h")
Expand Down
4 changes: 3 additions & 1 deletion test/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

config = copy.deepcopy(config_orig)


def make_config_files():
"""
Create files required for test model
Expand Down Expand Up @@ -115,7 +116,8 @@ def test_setup():
assert((workdir/'input_00{i}.bin'.format(i=i)).stat().st_size
== 1000**2 + i)

with pytest.raises(SystemExit, match="work path already exists") as setup_error:
with pytest.raises(SystemExit,
match="work path already exists") as setup_error:
payu_setup(lab_path=str(labdir), sweep=False, force=False)
assert setup_error.type == SystemExit

Expand Down

0 comments on commit 59d8c9e

Please sign in to comment.