From 6bc18ccadef29a458bb180aa54fd8579a58460a8 Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Thu, 12 Oct 2017 12:37:32 +0100 Subject: [PATCH 1/6] Rename pp_rules to pp_load_rules --- lib/iris/fileformats/pp.py | 6 ++++-- .../fileformats/{pp_rules.py => pp_load_rules.py} | 0 lib/iris/fileformats/um/_fast_load.py | 11 ++++++----- lib/iris/tests/integration/test_pp.py | 2 +- .../integration/test_pp_constrained_load_cubes.py | 2 +- lib/iris/tests/test_coding_standards.py | 2 +- lib/iris/tests/test_pp_to_cube.py | 4 ++-- .../fileformats/pp_rules/test__all_other_rules.py | 2 +- .../test__collapse_degenerate_points_and_bounds.py | 3 ++- .../test__convert_scalar_pseudo_level_coords.py | 2 +- .../test__convert_scalar_realization_coords.py | 2 +- .../fileformats/pp_rules/test__convert_time_coords.py | 2 +- .../pp_rules/test__convert_vertical_coords.py | 2 +- .../unit/fileformats/pp_rules/test__dim_or_aux.py | 2 +- .../fileformats/pp_rules/test__model_level_number.py | 2 +- .../pp_rules/test__reduced_points_and_bounds.py | 2 +- .../fileformats/pp_rules/test__reshape_vector_args.py | 2 +- .../tests/unit/fileformats/pp_rules/test_convert.py | 2 +- 18 files changed, 27 insertions(+), 23 deletions(-) rename lib/iris/fileformats/{pp_rules.py => pp_load_rules.py} (100%) diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index a75bb0bba9..e68c72821e 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -41,6 +41,7 @@ from iris._lazy_data import as_concrete_data, as_lazy_data, is_lazy_data import iris.config import iris.fileformats.pp_rules +import iris.fileformats.pp_load_rules from iris.fileformats.pp_save_rules import verify # NOTE: this is for backwards-compatitibility *ONLY* @@ -1930,7 +1931,8 @@ def load_pairs_from_fields(pp_fields): """ load_pairs_from_fields = iris.fileformats.rules.load_pairs_from_fields - return load_pairs_from_fields(pp_fields, iris.fileformats.pp_rules.convert) + return load_pairs_from_fields(pp_fields, + iris.fileformats.pp_load_rules.convert) def _load_cubes_variable_loader(filenames, callback, loading_function, @@ -1957,7 +1959,7 @@ def _load_cubes_variable_loader(filenames, callback, loading_function, else: loader = iris.fileformats.rules.Loader( loading_function, loading_function_kwargs or {}, - iris.fileformats.pp_rules.convert) + iris.fileformats.pp_load_rules.convert) result = iris.fileformats.rules.load_cubes(filenames, callback, loader, pp_filter) diff --git a/lib/iris/fileformats/pp_rules.py b/lib/iris/fileformats/pp_load_rules.py similarity index 100% rename from lib/iris/fileformats/pp_rules.py rename to lib/iris/fileformats/pp_load_rules.py diff --git a/lib/iris/fileformats/um/_fast_load.py b/lib/iris/fileformats/um/_fast_load.py index 9f377af548..94255e8f18 100644 --- a/lib/iris/fileformats/um/_fast_load.py +++ b/lib/iris/fileformats/um/_fast_load.py @@ -129,11 +129,12 @@ def _convert_collation(collation): """ from iris.fileformats.rules import ConversionMetadata - from iris.fileformats.pp_rules import (_convert_time_coords, - _convert_vertical_coords, - _convert_scalar_realization_coords, - _convert_scalar_pseudo_level_coords, - _all_other_rules) + from iris.fileformats.pp_load_rules import \ + (_convert_time_coords, + _convert_vertical_coords, + _convert_scalar_realization_coords, + _convert_scalar_pseudo_level_coords, + _all_other_rules) # For all the scalar conversions, all fields in the collation will # give the same result, so the choice is arbitrary. diff --git a/lib/iris/tests/integration/test_pp.py b/lib/iris/tests/integration/test_pp.py index e3238fccd3..0cc0868b1d 100644 --- a/lib/iris/tests/integration/test_pp.py +++ b/lib/iris/tests/integration/test_pp.py @@ -31,7 +31,7 @@ from iris.coords import AuxCoord, CellMethod, DimCoord from iris.cube import Cube import iris.fileformats.pp -import iris.fileformats.pp_rules +import iris.fileformats.pp_load_rules from iris.fileformats.pp_save_rules import verify from iris.exceptions import IgnoreCubeException from iris.tests import mock diff --git a/lib/iris/tests/integration/test_pp_constrained_load_cubes.py b/lib/iris/tests/integration/test_pp_constrained_load_cubes.py index 995506d5a3..54bb9bdca6 100644 --- a/lib/iris/tests/integration/test_pp_constrained_load_cubes.py +++ b/lib/iris/tests/integration/test_pp_constrained_load_cubes.py @@ -25,7 +25,7 @@ import iris from iris.fileformats import pp -from iris.fileformats.pp_rules import convert +from iris.fileformats.pp_load_rules import convert from iris.fileformats.rules import load_cubes diff --git a/lib/iris/tests/test_coding_standards.py b/lib/iris/tests/test_coding_standards.py index f90d25e323..8e1f151721 100644 --- a/lib/iris/tests/test_coding_standards.py +++ b/lib/iris/tests/test_coding_standards.py @@ -87,7 +87,7 @@ class StandardReportWithExclusions(pep8.StandardReport): '*/iris/fileformats/dot.py', '*/iris/fileformats/grib/_grib_cf_map.py', '*/iris/fileformats/grib/_grib1_load_rules.py', - '*/iris/fileformats/pp_rules.py', + '*/iris/fileformats/pp_load_rules.py', '*/iris/fileformats/rules.py', '*/iris/fileformats/um_cf_map.py', '*/iris/fileformats/_pyke_rules/compiled_krb/compiled_pyke_files.py', diff --git a/lib/iris/tests/test_pp_to_cube.py b/lib/iris/tests/test_pp_to_cube.py index e4a74da282..518e689bbf 100644 --- a/lib/iris/tests/test_pp_to_cube.py +++ b/lib/iris/tests/test_pp_to_cube.py @@ -25,7 +25,7 @@ import iris import iris.fileformats.pp -import iris.fileformats.pp_rules +import iris.fileformats.pp_load_rules import iris.fileformats.rules import iris.io import iris.util @@ -41,7 +41,7 @@ def setUp(self): def _field_to_cube(self, field): cube, _, _ = iris.fileformats.rules._make_cube( - field, iris.fileformats.pp_rules.convert) + field, iris.fileformats.pp_load_rules.convert) return cube def test_lbtim_2(self): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py b/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py index 5737f2580c..9962b6011e 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py @@ -29,7 +29,7 @@ import cartopy.crs as ccrs import iris -from iris.fileformats.pp_rules import _all_other_rules +from iris.fileformats.pp_load_rules import _all_other_rules from iris.fileformats.pp import SplittableInt from iris.coords import CellMethod, DimCoord, AuxCoord from iris.tests import mock diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py index f032b2b8cf..955c234e39 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py @@ -29,7 +29,8 @@ import numpy as np -from iris.fileformats.pp_rules import _collapse_degenerate_points_and_bounds +from iris.fileformats.pp_load_rules import \ + _collapse_degenerate_points_and_bounds class Test(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py index b876574667..32fe04aa80 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py @@ -30,7 +30,7 @@ from iris.coords import DimCoord from iris.tests.unit.fileformats import TestField -from iris.fileformats.pp_rules import _convert_scalar_pseudo_level_coords +from iris.fileformats.pp_load_rules import _convert_scalar_pseudo_level_coords class Test(TestField): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py index acf8038b3c..c41e20ab52 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py @@ -30,7 +30,7 @@ from iris.coords import DimCoord from iris.tests.unit.fileformats import TestField -from iris.fileformats.pp_rules import _convert_scalar_realization_coords +from iris.fileformats.pp_load_rules import _convert_scalar_realization_coords class Test(TestField): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py index 0944064530..19905b981c 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py @@ -33,7 +33,7 @@ from iris.coords import DimCoord, AuxCoord from iris.fileformats.pp import SplittableInt -from iris.fileformats.pp_rules import _convert_time_coords +from iris.fileformats.pp_load_rules import _convert_time_coords from iris.tests import mock from iris.tests.unit.fileformats import TestField diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py index e1612c4bbc..c90638034e 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py @@ -32,7 +32,7 @@ from iris.coords import DimCoord, AuxCoord from iris.aux_factory import HybridPressureFactory, HybridHeightFactory from iris.fileformats.pp import SplittableInt, STASH -from iris.fileformats.pp_rules import Reference, _convert_vertical_coords +from iris.fileformats.pp_load_rules import Reference, _convert_vertical_coords from iris.tests.unit.fileformats import TestField diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py b/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py index 7cbe05d620..4bdbd3391b 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py @@ -24,7 +24,7 @@ import iris.tests as tests from iris.coords import DimCoord, AuxCoord -from iris.fileformats.pp_rules import _dim_or_aux +from iris.fileformats.pp_load_rules import _dim_or_aux class Test(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py b/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py index 37de979c94..567da5a03a 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py @@ -23,7 +23,7 @@ # importing anything else. import iris.tests as tests -from iris.fileformats.pp_rules import _model_level_number +from iris.fileformats.pp_load_rules import _model_level_number class Test_9999(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py index a2c598afce..32b154eb80 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py @@ -29,7 +29,7 @@ import numpy as np -from iris.fileformats.pp_rules import _reduce_points_and_bounds +from iris.fileformats.pp_load_rules import _reduce_points_and_bounds class Test(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py b/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py index 8f81135490..8068c582ec 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py @@ -29,7 +29,7 @@ import numpy as np -from iris.fileformats.pp_rules import _reshape_vector_args +from iris.fileformats.pp_load_rules import _reshape_vector_args class TestEmpty(tests.IrisTest): diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py b/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py index 8374d0be76..019af4b38b 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py @@ -30,7 +30,7 @@ import cf_units import numpy as np -from iris.fileformats.pp_rules import convert +from iris.fileformats.pp_load_rules import convert from iris.util import guess_coord_axis from iris.fileformats.pp import SplittableInt from iris.fileformats.pp import STASH From 43c0a1f50ed71409218274756fa279f9a34a99a3 Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Mon, 16 Oct 2017 16:08:25 +0100 Subject: [PATCH 2/6] License header updates --- .../tests/unit/fileformats/pp_rules/test__all_other_rules.py | 2 +- .../pp_rules/test__collapse_degenerate_points_and_bounds.py | 2 +- .../pp_rules/test__convert_scalar_pseudo_level_coords.py | 2 +- .../pp_rules/test__convert_scalar_realization_coords.py | 2 +- .../unit/fileformats/pp_rules/test__convert_time_coords.py | 2 +- .../unit/fileformats/pp_rules/test__convert_vertical_coords.py | 2 +- lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py | 2 +- .../tests/unit/fileformats/pp_rules/test__model_level_number.py | 2 +- .../fileformats/pp_rules/test__reduced_points_and_bounds.py | 2 +- .../unit/fileformats/pp_rules/test__reshape_vector_args.py | 2 +- lib/iris/tests/unit/fileformats/pp_rules/test_convert.py | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py b/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py index 9962b6011e..78fe6c5acd 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2016, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py index 955c234e39..7107904fd3 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py index 32fe04aa80..718475f00a 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py index c41e20ab52..bbbb64ac9f 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py index 19905b981c..a8c2afb46b 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2016, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py index c90638034e..f830c45b67 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py b/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py index 4bdbd3391b..536c1018b6 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py b/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py index 567da5a03a..3d3106efe1 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py index 32b154eb80..eb17d4ed42 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py b/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py index 8068c582ec..2042325f99 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. # diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py b/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py index 019af4b38b..472661104f 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py +++ b/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2013 - 2016, Met Office +# (C) British Crown Copyright 2013 - 2017, Met Office # # This file is part of Iris. # From 358ed4fc44ed75727547adbffa6506c76062373c Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Tue, 17 Oct 2017 13:32:44 +0100 Subject: [PATCH 3/6] Correct outstanding references to `pp_rules` --- lib/iris/fileformats/pp.py | 1 - .../fileformats/um/_fast_load_structured_fields.py | 2 +- .../results/{pp_rules => pp_load_rules}/global.cml | 0 .../lbproc_mean_max_min.cml | 0 .../results/{pp_rules => pp_load_rules}/lbtim_2.cml | 0 .../{pp_rules => pp_load_rules}/ocean_depth.cml | 0 .../ocean_depth_bounded.cml | 0 .../{pp_rules => pp_load_rules}/rotated_uk.cml | 0 lib/iris/tests/test_pp_to_cube.py | 12 ++++++------ .../{pp_rules => pp_load_rules}/__init__.py | 2 +- .../test__all_other_rules.py | 4 ++-- .../test__collapse_degenerate_points_and_bounds.py | 2 +- .../test__convert_scalar_pseudo_level_coords.py | 2 +- .../test__convert_scalar_realization_coords.py | 2 +- .../test__convert_time_coords.py | 2 +- .../test__convert_vertical_coords.py | 2 +- .../{pp_rules => pp_load_rules}/test__dim_or_aux.py | 2 +- .../test__model_level_number.py | 5 ++++- .../test__reduced_points_and_bounds.py | 2 +- .../test__reshape_vector_args.py | 2 +- .../{pp_rules => pp_load_rules}/test_convert.py | 2 +- 21 files changed, 23 insertions(+), 21 deletions(-) rename lib/iris/tests/results/{pp_rules => pp_load_rules}/global.cml (100%) rename lib/iris/tests/results/{pp_rules => pp_load_rules}/lbproc_mean_max_min.cml (100%) rename lib/iris/tests/results/{pp_rules => pp_load_rules}/lbtim_2.cml (100%) rename lib/iris/tests/results/{pp_rules => pp_load_rules}/ocean_depth.cml (100%) rename lib/iris/tests/results/{pp_rules => pp_load_rules}/ocean_depth_bounded.cml (100%) rename lib/iris/tests/results/{pp_rules => pp_load_rules}/rotated_uk.cml (100%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/__init__.py (92%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__all_other_rules.py (98%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__collapse_degenerate_points_and_bounds.py (98%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__convert_scalar_pseudo_level_coords.py (95%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__convert_scalar_realization_coords.py (95%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__convert_time_coords.py (99%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__convert_vertical_coords.py (99%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__dim_or_aux.py (96%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__model_level_number.py (94%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__reduced_points_and_bounds.py (98%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test__reshape_vector_args.py (98%) rename lib/iris/tests/unit/fileformats/{pp_rules => pp_load_rules}/test_convert.py (99%) diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index e68c72821e..19f328e42a 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -40,7 +40,6 @@ from iris._deprecation import warn_deprecated from iris._lazy_data import as_concrete_data, as_lazy_data, is_lazy_data import iris.config -import iris.fileformats.pp_rules import iris.fileformats.pp_load_rules from iris.fileformats.pp_save_rules import verify diff --git a/lib/iris/fileformats/um/_fast_load_structured_fields.py b/lib/iris/fileformats/um/_fast_load_structured_fields.py index 1192394134..b9f596fd0e 100644 --- a/lib/iris/fileformats/um/_fast_load_structured_fields.py +++ b/lib/iris/fileformats/um/_fast_load_structured_fields.py @@ -283,7 +283,7 @@ def group_structured_fields(field_iterator): * the same for all fields, * completely irrelevant, or * used by a vectorised rule function (such as - :func:`iris.fileformats.pp_rules._convert_vector_time_coords`). + :func:`iris.fileformats.pp_load_rules._convert_time_coords`). Returns: A generator of FieldCollation objects, each of which contains a single diff --git a/lib/iris/tests/results/pp_rules/global.cml b/lib/iris/tests/results/pp_load_rules/global.cml similarity index 100% rename from lib/iris/tests/results/pp_rules/global.cml rename to lib/iris/tests/results/pp_load_rules/global.cml diff --git a/lib/iris/tests/results/pp_rules/lbproc_mean_max_min.cml b/lib/iris/tests/results/pp_load_rules/lbproc_mean_max_min.cml similarity index 100% rename from lib/iris/tests/results/pp_rules/lbproc_mean_max_min.cml rename to lib/iris/tests/results/pp_load_rules/lbproc_mean_max_min.cml diff --git a/lib/iris/tests/results/pp_rules/lbtim_2.cml b/lib/iris/tests/results/pp_load_rules/lbtim_2.cml similarity index 100% rename from lib/iris/tests/results/pp_rules/lbtim_2.cml rename to lib/iris/tests/results/pp_load_rules/lbtim_2.cml diff --git a/lib/iris/tests/results/pp_rules/ocean_depth.cml b/lib/iris/tests/results/pp_load_rules/ocean_depth.cml similarity index 100% rename from lib/iris/tests/results/pp_rules/ocean_depth.cml rename to lib/iris/tests/results/pp_load_rules/ocean_depth.cml diff --git a/lib/iris/tests/results/pp_rules/ocean_depth_bounded.cml b/lib/iris/tests/results/pp_load_rules/ocean_depth_bounded.cml similarity index 100% rename from lib/iris/tests/results/pp_rules/ocean_depth_bounded.cml rename to lib/iris/tests/results/pp_load_rules/ocean_depth_bounded.cml diff --git a/lib/iris/tests/results/pp_rules/rotated_uk.cml b/lib/iris/tests/results/pp_load_rules/rotated_uk.cml similarity index 100% rename from lib/iris/tests/results/pp_rules/rotated_uk.cml rename to lib/iris/tests/results/pp_load_rules/rotated_uk.cml diff --git a/lib/iris/tests/test_pp_to_cube.py b/lib/iris/tests/test_pp_to_cube.py index 518e689bbf..e8f8bdc766 100644 --- a/lib/iris/tests/test_pp_to_cube.py +++ b/lib/iris/tests/test_pp_to_cube.py @@ -52,7 +52,7 @@ def test_lbtim_2(self): cube = self._field_to_cube(field) self.subcubes.append(cube) cube = self.subcubes.merge()[0] - self.assertCML(cube, ('pp_rules', 'lbtim_2.cml')) + self.assertCML(cube, ('pp_load_rules', 'lbtim_2.cml')) def _ocean_depth(self, bounded=False): lbuser = list(self.template.lbuser) @@ -76,12 +76,12 @@ def _ocean_depth(self, bounded=False): def test_ocean_depth(self): self._ocean_depth() cube = self.subcubes.merge()[0] - self.assertCML(cube, ('pp_rules', 'ocean_depth.cml')) + self.assertCML(cube, ('pp_load_rules', 'ocean_depth.cml')) def test_ocean_depth_bounded(self): self._ocean_depth(bounded=True) cube = self.subcubes.merge()[0] - self.assertCML(cube, ('pp_rules', 'ocean_depth_bounded.cml')) + self.assertCML(cube, ('pp_load_rules', 'ocean_depth_bounded.cml')) class TestReferences(tests.IrisTest): @@ -133,11 +133,11 @@ def test_pp_load_rules(self): # Test PP loading and rule evaluation. cube = iris.tests.stock.simple_pp() - self.assertCML(cube, ('pp_rules', 'global.cml')) + self.assertCML(cube, ('pp_load_rules', 'global.cml')) data_path = tests.get_data_path(('PP', 'rotated_uk', 'rotated_uk.pp')) cube = iris.load(data_path)[0] - self.assertCML(cube, ('pp_rules', 'rotated_uk.cml')) + self.assertCML(cube, ('pp_load_rules', 'rotated_uk.cml')) def test_lbproc(self): data_path = tests.get_data_path(('PP', 'meanMaxMin', '200806081200__qwpb.T24.pp')) @@ -145,7 +145,7 @@ def test_lbproc(self): constraint = iris.Constraint('air_temperature', forecast_period=24) cubes = iris.load(data_path, constraint) cubes = iris.cube.CubeList([cubes[0], cubes[3], cubes[1], cubes[2], cubes[4]]) - self.assertCML(cubes, ('pp_rules', 'lbproc_mean_max_min.cml')) + self.assertCML(cubes, ('pp_load_rules', 'lbproc_mean_max_min.cml')) def test_cell_methods(self): # Test cell methods are created for correct values of lbproc diff --git a/lib/iris/tests/unit/fileformats/pp_rules/__init__.py b/lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py similarity index 92% rename from lib/iris/tests/unit/fileformats/pp_rules/__init__.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py index 8a4714b9e6..b102ddcd0f 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/__init__.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU Lesser General Public License # along with Iris. If not, see . -"""Unit tests for the :mod:`iris.fileformats.pp_rules` module.""" +"""Unit tests for the :mod:`iris.fileformats.pp_load_rules` module.""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py similarity index 98% rename from lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py index 78fe6c5acd..2898cf4900 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__all_other_rules.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU Lesser General Public License # along with Iris. If not, see . -"""Unit tests for the `iris.fileformats.pp_rules._all_other_rules` function.""" +"""Unit tests for the `iris.fileformats.pp_load_rules._all_other_rules` function.""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa @@ -36,7 +36,7 @@ from iris.tests.unit.fileformats import TestField -# iris.fileformats.pp_rules._all_other_rules() returns a tuple of +# iris.fileformats.pp_load_rules._all_other_rules() returns a tuple of # of various metadata. This constant is the index into this # tuple to obtain the cell methods. CELL_METHODS_INDEX = 5 diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__collapse_degenerate_points_and_bounds.py similarity index 98% rename from lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__collapse_degenerate_points_and_bounds.py index 7107904fd3..4417182dec 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__collapse_degenerate_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__collapse_degenerate_points_and_bounds.py @@ -16,7 +16,7 @@ # along with Iris. If not, see . """ Unit tests for -:func:`iris.fileformats.pp_rules._collapse_degenerate_points_and_bounds`. +:func:`iris.fileformats.pp_load_rules._collapse_degenerate_points_and_bounds`. """ diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_pseudo_level_coords.py similarity index 95% rename from lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_pseudo_level_coords.py index 718475f00a..83140476a3 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_pseudo_level_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_pseudo_level_coords.py @@ -16,7 +16,7 @@ # along with Iris. If not, see . """ Unit tests for -:func:`iris.fileformats.pp_rules._convert_pseudo_level_coords`. +:func:`iris.fileformats.pp_load_rules._convert_pseudo_level_coords`. """ diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py similarity index 95% rename from lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py index bbbb64ac9f..5f6f4a4324 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_scalar_realization_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py @@ -16,7 +16,7 @@ # along with Iris. If not, see . """ Unit tests for -:func:`iris.fileformats.pp_rules._convert_scalar_realization_coords`. +:func:`iris.fileformats.pp_load_rules._convert_scalar_realization_coords`. """ diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py similarity index 99% rename from lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py index a8c2afb46b..f531a7a593 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_time_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py @@ -16,7 +16,7 @@ # along with Iris. If not, see . """ Unit tests for -:func:`iris.fileformats.pp_rules._convert_time_coords`. +:func:`iris.fileformats.pp_load_rules._convert_time_coords`. """ diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py similarity index 99% rename from lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py index f830c45b67..03fb30f8ba 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__convert_vertical_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py @@ -16,7 +16,7 @@ # along with Iris. If not, see . """ Unit tests for -:func:`iris.fileformats.pp_rules._convert_vertical_coords`. +:func:`iris.fileformats.pp_load_rules._convert_vertical_coords`. """ diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py similarity index 96% rename from lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py index 536c1018b6..3eaa77026e 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__dim_or_aux.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU Lesser General Public License # along with Iris. If not, see . -"""Unit tests for :func:`iris.fileformats.pp_rules._dim_or_aux`.""" +"""Unit tests for :func:`iris.fileformats.pp_load_rules._dim_or_aux`.""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py similarity index 94% rename from lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py index 3d3106efe1..3970eff1df 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__model_level_number.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py @@ -14,7 +14,10 @@ # # You should have received a copy of the GNU Lesser General Public License # along with Iris. If not, see . -"""Unit tests for :func:`iris.fileformats.pp_rules._model_level_number`.""" +""" +Unit tests for :func:`iris.fileformats.pp_load_rules._model_level_number`. + +""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reduced_points_and_bounds.py similarity index 98% rename from lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__reduced_points_and_bounds.py index eb17d4ed42..85ce2f7217 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__reduced_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reduced_points_and_bounds.py @@ -16,7 +16,7 @@ # along with Iris. If not, see . """ Unit tests for -:func:`iris.fileformats.pp_rules._reduce_points_and_bounds`. +:func:`iris.fileformats.pp_load_rules._reduce_points_and_bounds`. """ diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py similarity index 98% rename from lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py index 2042325f99..35bbce376b 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py @@ -16,7 +16,7 @@ # along with Iris. If not, see . """ Unit tests for -:func:`iris.fileformats.pp_rules._reshape_vector_args`. +:func:`iris.fileformats.pp_load_rules._reshape_vector_args`. """ diff --git a/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py similarity index 99% rename from lib/iris/tests/unit/fileformats/pp_rules/test_convert.py rename to lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py index 472661104f..aa406c8c4b 100644 --- a/lib/iris/tests/unit/fileformats/pp_rules/test_convert.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU Lesser General Public License # along with Iris. If not, see . -"""Unit tests for :func:`iris.fileformats.pp_rules.convert`.""" +"""Unit tests for :func:`iris.fileformats.pp_load_rules.convert`.""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa From 9ffac41a803e98eb93688f4e46603777481b1e6e Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Tue, 17 Oct 2017 13:48:38 +0100 Subject: [PATCH 4/6] Add whatsnew entry --- .../incompatiblechange_2017-Oct-17_rename-pp-rules.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/iris/src/whatsnew/contributions_v2.0.0/incompatiblechange_2017-Oct-17_rename-pp-rules.txt diff --git a/docs/iris/src/whatsnew/contributions_v2.0.0/incompatiblechange_2017-Oct-17_rename-pp-rules.txt b/docs/iris/src/whatsnew/contributions_v2.0.0/incompatiblechange_2017-Oct-17_rename-pp-rules.txt new file mode 100644 index 0000000000..b3ff33c7f6 --- /dev/null +++ b/docs/iris/src/whatsnew/contributions_v2.0.0/incompatiblechange_2017-Oct-17_rename-pp-rules.txt @@ -0,0 +1,2 @@ +`iris.fileformats.pp_rules` has been renamed to `iris.fileformats.pp_load_rules`. +This has been done for the sake of clarity following the introduction of `iris.fileformats.pp_save_rules`. \ No newline at end of file From 14a9a2646ea4c77dde0caebc458179103c1619d7 Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Tue, 17 Oct 2017 14:07:47 +0100 Subject: [PATCH 5/6] Correct pep8 failure --- .../unit/fileformats/pp_load_rules/test__all_other_rules.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py index 2898cf4900..78b9dfa816 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__all_other_rules.py @@ -14,7 +14,10 @@ # # You should have received a copy of the GNU Lesser General Public License # along with Iris. If not, see . -"""Unit tests for the `iris.fileformats.pp_load_rules._all_other_rules` function.""" +""" +Unit tests for the `iris.fileformats.pp_load_rules._all_other_rules` function. + +""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa From 62e41b80a34ad9253ff06514a684874f7827dbb5 Mon Sep 17 00:00:00 2001 From: Peter Killick Date: Tue, 17 Oct 2017 15:25:19 +0100 Subject: [PATCH 6/6] Update license header --- lib/iris/tests/integration/test_pp_constrained_load_cubes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/tests/integration/test_pp_constrained_load_cubes.py b/lib/iris/tests/integration/test_pp_constrained_load_cubes.py index 54bb9bdca6..ac3d02ea51 100644 --- a/lib/iris/tests/integration/test_pp_constrained_load_cubes.py +++ b/lib/iris/tests/integration/test_pp_constrained_load_cubes.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2014 - 2015, Met Office +# (C) British Crown Copyright 2014 - 2017, Met Office # # This file is part of Iris. #