diff --git a/om3utils/cice_grid.py b/om3utils/cice_grid.py index 929e258..409045d 100644 --- a/om3utils/cice_grid.py +++ b/om3utils/cice_grid.py @@ -69,8 +69,8 @@ def build_from_mom(self, ocean_hgrid, ocean_mask): if __name__ == "__main__": - #command line arguments - from utils import md5sum # load from file + # command line arguments + from utils import md5sum # load from file parser = argparse.ArgumentParser() parser.add_argument("ocean_hgrid", help="ocean_hgrid.nc file") @@ -84,4 +84,4 @@ def build_from_mom(self, ocean_hgrid, ocean_mask): sys.exit(grid.build_from_mom(**args)) else: - from .utils import md5sum #load from package + from .utils import md5sum # load from package diff --git a/tests/test_cice_grid.py b/tests/test_cice_grid.py index 0b6069a..ba6da2d 100644 --- a/tests/test_cice_grid.py +++ b/tests/test_cice_grid.py @@ -18,13 +18,17 @@ def __init__(self, tmp_path): self.mask_path = str(tmp_path) + "/ocean_mask.nc" # generate an tripolar grid as test data - run([ - "ocean_grid_generator.py", - "-r", "0.25", #4 degree grid - "--no_south_cap", - "--ensure_nj_even", - "-f", self.path - ]) + run( + [ + "ocean_grid_generator.py", + "-r", + "0.25", # 4 degree grid + "--no_south_cap", + "--ensure_nj_even", + "-f", + self.path, + ] + ) # open ocean_hgrid.nc self.ds = xr.open_dataset(self.path) @@ -185,5 +189,9 @@ def test_inputs_logged(cice_grid, mom_grid): sys_md5 = sys_md5.stdout.split(" ")[0] assert ds.inputfile_md5 == sys_md5, f"inputfile md5sum attribute incorrect, {ds.inputfile_md5} != {sys_md5}" - assert cice_grid.ds.inputfile == mom_grid.path, "inputfile attribute incorrect ({cice_grid.ds.inputfile} != {mom_grid.path})" - assert cice_grid.kmt_ds.inputfile == mom_grid.mask_path, "mask inputfile attribute incorrect ({cice_grid.kmt_ds.inputfile} != {mom_grid.mask_path})" + assert ( + cice_grid.ds.inputfile == mom_grid.path + ), "inputfile attribute incorrect ({cice_grid.ds.inputfile} != {mom_grid.path})" + assert ( + cice_grid.kmt_ds.inputfile == mom_grid.mask_path + ), "mask inputfile attribute incorrect ({cice_grid.kmt_ds.inputfile} != {mom_grid.mask_path})"