def test_pseudo_level_filter_none(self): chosen_ppfs = [] for ppf in self.ppfs: if ppf.lbuser[4] == 30: chosen_ppfs.append(ppf) cubes = list(load_pairs_from_fields(chosen_ppfs)) self.assertEqual(len(cubes), 0)
def test_as_pairs(self): cube_ppf_pairs = load_pairs_from_fields(self.ppfs) cubes = [] for cube, ppf in cube_ppf_pairs: if ppf.lbuser[4] == 3: cube.attributes['pseudo level'] = ppf.lbuser[4] cubes.append(cube) for cube in cubes: self.assertEqual(cube.attributes['pseudo level'], 3)
def test_pseudo_level_filter_none(self): dpath = tests.get_data_path(["PP", "meanMaxMin", "200806081200__qwpb.T24.pp"]) ppfs = iris.fileformats.pp.load(dpath) chosen_ppfs = [] for ppf in ppfs: if ppf.lbuser[4] == 30: chosen_ppfs.append(ppf) cubes = list(load_pairs_from_fields(chosen_ppfs)) self.assertEqual(len(cubes), 0)
def test_as_pairs(self): dpath = tests.get_data_path(["PP", "meanMaxMin", "200806081200__qwpb.T24.pp"]) ppfs = iris.fileformats.pp.load(dpath) cube_ppf_pairs = load_pairs_from_fields(ppfs) cubes = [] for cube, ppf in cube_ppf_pairs: if ppf.lbuser[4] == 3: cube.attributes["pseudo level"] = ppf.lbuser[4] cubes.append(cube) for cube in cubes: self.assertEqual(cube.attributes["pseudo level"], 3)