From 9e54a9088ed02f6d15f99cd6f5396cd95287c3a9 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Thu, 31 Oct 2019 15:51:10 +0000 Subject: [PATCH 01/35] Removed unused six imports. --- docs/iris/example_tests/__init__.py | 2 -- docs/iris/example_tests/extest_util.py | 2 -- docs/iris/example_tests/test_COP_1d_plot.py | 2 -- docs/iris/example_tests/test_COP_maps.py | 2 -- docs/iris/example_tests/test_SOI_filtering.py | 2 -- docs/iris/example_tests/test_TEC.py | 2 -- docs/iris/example_tests/test_anomaly_log_colouring.py | 2 -- docs/iris/example_tests/test_atlantic_profiles.py | 2 -- docs/iris/example_tests/test_coriolis_plot.py | 2 -- docs/iris/example_tests/test_cross_section.py | 2 -- docs/iris/example_tests/test_custom_aggregation.py | 2 -- docs/iris/example_tests/test_custom_file_loading.py | 2 -- docs/iris/example_tests/test_deriving_phenomena.py | 2 -- docs/iris/example_tests/test_global_map.py | 2 -- docs/iris/example_tests/test_hovmoller.py | 2 -- docs/iris/example_tests/test_inset_plot.py | 2 -- docs/iris/example_tests/test_lagged_ensemble.py | 2 -- docs/iris/example_tests/test_lineplot_with_legend.py | 2 -- docs/iris/example_tests/test_load_nemo.py | 2 -- docs/iris/example_tests/test_orca_projection.py | 2 -- docs/iris/example_tests/test_polar_stereo.py | 2 -- docs/iris/example_tests/test_polynomial_fit.py | 2 -- docs/iris/example_tests/test_projections_and_annotations.py | 2 -- docs/iris/example_tests/test_rotated_pole_mapping.py | 2 -- docs/iris/example_tests/test_wind_speed.py | 2 -- docs/iris/src/conf.py | 2 -- docs/iris/src/developers_guide/gitwash_dumper.py | 2 -- docs/iris/src/sphinxext/auto_label_figures.py | 2 -- docs/iris/src/sphinxext/custom_class_autodoc.py | 2 -- docs/iris/src/sphinxext/custom_data_autodoc.py | 2 -- docs/iris/src/sphinxext/gen_example_directory.py | 2 -- docs/iris/src/sphinxext/gen_gallery.py | 2 -- .../src/userguide/plotting_examples/1d_quickplot_simple.py | 2 -- docs/iris/src/userguide/plotting_examples/1d_simple.py | 2 -- docs/iris/src/userguide/plotting_examples/1d_with_legend.py | 2 -- docs/iris/src/userguide/plotting_examples/brewer.py | 2 -- docs/iris/src/userguide/plotting_examples/cube_blockplot.py | 2 -- .../userguide/plotting_examples/cube_brewer_cite_contourf.py | 2 -- .../src/userguide/plotting_examples/cube_brewer_contourf.py | 2 -- docs/iris/src/userguide/plotting_examples/cube_contour.py | 2 -- docs/iris/src/userguide/plotting_examples/cube_contourf.py | 2 -- .../iris/src/userguide/regridding_plots/interpolate_column.py | 2 -- .../src/userguide/regridding_plots/regridded_to_global.py | 2 -- .../src/userguide/regridding_plots/regridded_to_rotated.py | 2 -- docs/iris/src/userguide/regridding_plots/regridding_plot.py | 2 -- docs/iris/src/whatsnew/aggregate_directory.py | 2 -- lib/iris/__init__.py | 2 -- lib/iris/_cube_coord_common.py | 2 -- lib/iris/_data_manager.py | 2 -- lib/iris/_deprecation.py | 2 -- lib/iris/analysis/_area_weighted.py | 2 -- lib/iris/analysis/_grid_angles.py | 2 -- lib/iris/config.py | 2 -- lib/iris/coord_systems.py | 2 -- lib/iris/exceptions.py | 2 -- lib/iris/experimental/__init__.py | 2 -- lib/iris/experimental/concatenate.py | 2 -- lib/iris/experimental/equalise_cubes.py | 2 -- lib/iris/experimental/raster.py | 2 -- lib/iris/experimental/regrid.py | 1 - lib/iris/experimental/ugrid.py | 2 -- lib/iris/fileformats/__init__.py | 2 -- lib/iris/fileformats/_pp_lbproc_pairs.py | 2 -- lib/iris/fileformats/abf.py | 2 -- lib/iris/fileformats/cf.py | 2 -- lib/iris/fileformats/dot.py | 2 -- lib/iris/fileformats/name.py | 2 -- lib/iris/fileformats/nimrod.py | 2 -- lib/iris/fileformats/nimrod_load_rules.py | 2 -- lib/iris/fileformats/pp_save_rules.py | 2 -- lib/iris/fileformats/um/__init__.py | 2 -- lib/iris/fileformats/um/_fast_load.py | 1 - lib/iris/fileformats/um/_ff_replacement.py | 2 -- lib/iris/fileformats/um/_optimal_array_structuring.py | 2 -- lib/iris/io/format_picker.py | 2 -- lib/iris/pandas.py | 2 -- lib/iris/quickplot.py | 2 -- lib/iris/symbols.py | 2 -- lib/iris/tests/experimental/__init__.py | 2 -- lib/iris/tests/experimental/regrid/__init__.py | 2 -- .../experimental/regrid/test_regrid_conservative_via_esmpy.py | 2 -- lib/iris/tests/experimental/test_raster.py | 2 -- lib/iris/tests/experimental/ugrid/__init__.py | 2 -- lib/iris/tests/experimental/ugrid/test_ugrid.py | 2 -- lib/iris/tests/idiff.py | 2 -- lib/iris/tests/integration/__init__.py | 2 -- lib/iris/tests/integration/aux_factory/__init__.py | 2 -- lib/iris/tests/integration/concatenate/__init__.py | 2 -- lib/iris/tests/integration/experimental/__init__.py | 2 -- .../tests/integration/experimental/test_CubeRepresentation.py | 2 -- .../experimental/test_regrid_ProjectedUnstructured.py | 2 -- lib/iris/tests/integration/fast_load/__init__.py | 2 -- lib/iris/tests/integration/format_interop/__init__.py | 2 -- lib/iris/tests/integration/format_interop/test_name_grib.py | 2 -- lib/iris/tests/integration/format_interop/test_pp_grib.py | 2 -- lib/iris/tests/integration/plot/__init__.py | 2 -- lib/iris/tests/integration/plot/test_colorbar.py | 2 -- lib/iris/tests/integration/plot/test_netcdftime.py | 2 -- lib/iris/tests/integration/plot/test_nzdateline.py | 2 -- lib/iris/tests/integration/plot/test_plot_2d_coords.py | 2 -- lib/iris/tests/integration/plot/test_vector_plots.py | 2 -- lib/iris/tests/integration/test_PartialDateTime.py | 2 -- lib/iris/tests/integration/test_climatology.py | 2 -- lib/iris/tests/integration/test_cube.py | 2 -- lib/iris/tests/integration/test_ff.py | 2 -- lib/iris/tests/integration/test_grib2.py | 2 -- lib/iris/tests/integration/test_grib_load.py | 2 -- lib/iris/tests/integration/test_new_axis.py | 2 -- lib/iris/tests/integration/test_pickle.py | 2 -- lib/iris/tests/integration/test_pp.py | 2 -- lib/iris/tests/integration/test_pp_constrained_load_cubes.py | 2 -- lib/iris/tests/integration/test_regrid_equivalence.py | 2 -- lib/iris/tests/integration/test_subset.py | 2 -- lib/iris/tests/integration/um/__init__.py | 2 -- lib/iris/tests/integration/um/test_fieldsfile.py | 2 -- lib/iris/tests/pp.py | 2 -- lib/iris/tests/runner/__init__.py | 2 -- lib/iris/tests/runner/__main__.py | 2 -- lib/iris/tests/runner/_runner.py | 2 -- lib/iris/tests/system_test.py | 2 -- lib/iris/tests/test_abf.py | 2 -- lib/iris/tests/test_aggregate_by.py | 2 -- lib/iris/tests/test_analysis.py | 2 -- lib/iris/tests/test_analysis_calculus.py | 2 -- lib/iris/tests/test_basic_maths.py | 2 -- lib/iris/tests/test_cartography.py | 2 -- lib/iris/tests/test_cdm.py | 2 -- lib/iris/tests/test_cell.py | 2 -- lib/iris/tests/test_cf.py | 2 -- lib/iris/tests/test_coding_standards.py | 2 -- lib/iris/tests/test_concatenate.py | 2 -- lib/iris/tests/test_coord_categorisation.py | 2 -- lib/iris/tests/test_coordsystem.py | 2 -- lib/iris/tests/test_cube.py | 2 -- lib/iris/tests/test_file_load.py | 2 -- lib/iris/tests/test_file_save.py | 2 -- lib/iris/tests/test_grib_load_translations.py | 2 -- lib/iris/tests/test_grib_save.py | 2 -- lib/iris/tests/test_grib_save_rules.py | 2 -- lib/iris/tests/test_hybrid.py | 2 -- lib/iris/tests/test_image_json.py | 2 -- lib/iris/tests/test_intersect.py | 2 -- lib/iris/tests/test_io_init.py | 2 -- lib/iris/tests/test_load.py | 2 -- lib/iris/tests/test_name.py | 2 -- lib/iris/tests/test_netcdf.py | 2 -- lib/iris/tests/test_nimrod.py | 2 -- lib/iris/tests/test_pandas.py | 2 -- lib/iris/tests/test_peak.py | 2 -- lib/iris/tests/test_pp_cf.py | 2 -- lib/iris/tests/test_pp_stash.py | 2 -- lib/iris/tests/test_quickplot.py | 2 -- lib/iris/tests/test_std_names.py | 2 -- lib/iris/tests/test_uri_callback.py | 2 -- lib/iris/tests/test_whatsnew_contributions.py | 2 -- lib/iris/tests/unit/__init__.py | 2 -- lib/iris/tests/unit/analysis/__init__.py | 2 -- lib/iris/tests/unit/analysis/area_weighted/__init__.py | 2 -- .../unit/analysis/area_weighted/test_AreaWeightedRegridder.py | 2 -- lib/iris/tests/unit/analysis/cartography/__init__.py | 2 -- .../tests/unit/analysis/cartography/test__quadrant_area.py | 2 -- lib/iris/tests/unit/analysis/cartography/test__xy_range.py | 2 -- lib/iris/tests/unit/analysis/cartography/test_area_weights.py | 2 -- .../tests/unit/analysis/cartography/test_gridcell_angles.py | 2 -- lib/iris/tests/unit/analysis/cartography/test_project.py | 2 -- .../unit/analysis/cartography/test_rotate_grid_vectors.py | 2 -- lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py | 2 -- lib/iris/tests/unit/analysis/geometry/__init__.py | 2 -- .../analysis/geometry/test__extract_relevant_cube_slice.py | 2 -- .../unit/analysis/geometry/test_geometry_area_weights.py | 2 -- lib/iris/tests/unit/analysis/interpolation/__init__.py | 2 -- .../analysis/interpolation/test_RectilinearInterpolator.py | 2 -- .../unit/analysis/interpolation/test_get_xy_dim_coords.py | 2 -- lib/iris/tests/unit/analysis/maths/test__get_dtype.py | 2 -- .../tests/unit/analysis/maths/test__inplace_common_checks.py | 2 -- lib/iris/tests/unit/analysis/maths/test_add.py | 2 -- lib/iris/tests/unit/analysis/maths/test_divide.py | 2 -- lib/iris/tests/unit/analysis/maths/test_multiply.py | 2 -- lib/iris/tests/unit/analysis/maths/test_subtract.py | 2 -- lib/iris/tests/unit/analysis/regrid/__init__.py | 2 -- .../scipy_interpolate/test__RegularGridInterpolator.py | 2 -- lib/iris/tests/unit/analysis/stats/__init__.py | 2 -- lib/iris/tests/unit/analysis/test_Aggregator.py | 2 -- lib/iris/tests/unit/analysis/test_AreaWeighted.py | 2 -- lib/iris/tests/unit/analysis/test_COUNT.py | 2 -- lib/iris/tests/unit/analysis/test_Linear.py | 2 -- lib/iris/tests/unit/analysis/test_MAX.py | 2 -- lib/iris/tests/unit/analysis/test_MEAN.py | 2 -- lib/iris/tests/unit/analysis/test_MIN.py | 2 -- lib/iris/tests/unit/analysis/test_Nearest.py | 2 -- lib/iris/tests/unit/analysis/test_PROPORTION.py | 2 -- lib/iris/tests/unit/analysis/test_PercentileAggregator.py | 2 -- lib/iris/tests/unit/analysis/test_PointInCell.py | 2 -- lib/iris/tests/unit/analysis/test_RMS.py | 2 -- lib/iris/tests/unit/analysis/test_STD_DEV.py | 2 -- lib/iris/tests/unit/analysis/test_SUM.py | 2 -- lib/iris/tests/unit/analysis/test_VARIANCE.py | 2 -- .../tests/unit/analysis/test_WeightedPercentileAggregator.py | 2 -- lib/iris/tests/unit/analysis/trajectory/__init__.py | 2 -- .../trajectory/test__nearest_neighbour_indices_ndcoords.py | 2 -- lib/iris/tests/unit/analysis/trajectory/test_interpolate.py | 2 -- lib/iris/tests/unit/aux_factory/__init__.py | 2 -- lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py | 2 -- lib/iris/tests/unit/aux_factory/test_HybridPressureFactory.py | 2 -- lib/iris/tests/unit/aux_factory/test_OceanSFactory.py | 2 -- lib/iris/tests/unit/aux_factory/test_OceanSg1Factory.py | 2 -- lib/iris/tests/unit/aux_factory/test_OceanSg2Factory.py | 2 -- lib/iris/tests/unit/aux_factory/test_OceanSigmaFactory.py | 2 -- lib/iris/tests/unit/aux_factory/test_OceanSigmaZFactory.py | 2 -- lib/iris/tests/unit/concatenate/__init__.py | 2 -- lib/iris/tests/unit/concatenate/test__CubeSignature.py | 2 -- lib/iris/tests/unit/config/__init__.py | 2 -- lib/iris/tests/unit/config/test_NetCDF.py | 2 -- lib/iris/tests/unit/coord_categorisation/__init__.py | 2 -- lib/iris/tests/unit/coord_categorisation/test_add_hour.py | 2 -- lib/iris/tests/unit/coord_systems/__init__.py | 2 -- lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py | 2 -- lib/iris/tests/unit/coord_systems/test_Geostationary.py | 2 -- .../unit/coord_systems/test_LambertAzimuthalEqualArea.py | 2 -- lib/iris/tests/unit/coord_systems/test_Mercator.py | 2 -- lib/iris/tests/unit/coord_systems/test_Orthographic.py | 2 -- lib/iris/tests/unit/coord_systems/test_RotatedPole.py | 2 -- lib/iris/tests/unit/coord_systems/test_VerticalPerspective.py | 2 -- lib/iris/tests/unit/coords/__init__.py | 2 -- lib/iris/tests/unit/coords/test_AncillaryVariable.py | 2 -- lib/iris/tests/unit/coords/test_AuxCoord.py | 2 -- lib/iris/tests/unit/coords/test_Cell.py | 2 -- lib/iris/tests/unit/coords/test_CellMeasure.py | 2 -- lib/iris/tests/unit/coords/test_CellMethod.py | 2 -- lib/iris/tests/unit/coords/test_Coord.py | 2 -- lib/iris/tests/unit/coords/test_DimCoord.py | 2 -- lib/iris/tests/unit/cube/__init__.py | 2 -- lib/iris/tests/unit/cube/test_Cube__operators.py | 2 -- lib/iris/tests/unit/cube_coord_common/__init__.py | 2 -- lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py | 2 -- .../unit/cube_coord_common/test_get_valid_standard_name.py | 2 -- lib/iris/tests/unit/data_manager/__init__.py | 2 -- lib/iris/tests/unit/data_manager/test_DataManager.py | 2 -- lib/iris/tests/unit/experimental/__init__.py | 2 -- lib/iris/tests/unit/experimental/equalise_cubes/__init__.py | 2 -- lib/iris/tests/unit/experimental/raster/__init__.py | 2 -- .../tests/unit/experimental/raster/test_export_geotiff.py | 2 -- lib/iris/tests/unit/experimental/regrid/__init__.py | 2 -- .../test_regrid_area_weighted_rectilinear_src_and_grid.py | 2 -- lib/iris/tests/unit/experimental/representation/__init__.py | 2 -- lib/iris/tests/unit/experimental/stratify/__init__.py | 2 -- lib/iris/tests/unit/experimental/stratify/test_relevel.py | 2 -- lib/iris/tests/unit/fileformats/__init__.py | 2 -- lib/iris/tests/unit/fileformats/abf/__init__.py | 2 -- lib/iris/tests/unit/fileformats/abf/test_ABFField.py | 2 -- lib/iris/tests/unit/fileformats/cf/__init__.py | 2 -- lib/iris/tests/unit/fileformats/dot/__init__.py | 2 -- lib/iris/tests/unit/fileformats/dot/test__dot_path.py | 2 -- lib/iris/tests/unit/fileformats/ff/__init__.py | 2 -- lib/iris/tests/unit/fileformats/ff/test_ArakawaC.py | 2 -- lib/iris/tests/unit/fileformats/ff/test_ENDGame.py | 2 -- lib/iris/tests/unit/fileformats/ff/test_FFHeader.py | 2 -- lib/iris/tests/unit/fileformats/ff/test_Grid.py | 2 -- lib/iris/tests/unit/fileformats/ff/test_NewDynamics.py | 2 -- lib/iris/tests/unit/fileformats/name_loaders/__init__.py | 2 -- .../unit/fileformats/name_loaders/test__build_cell_methods.py | 2 -- .../fileformats/name_loaders/test__calc_integration_period.py | 2 -- .../fileformats/name_loaders/test__cf_height_from_name.py | 2 -- lib/iris/tests/unit/fileformats/netcdf/__init__.py | 2 -- lib/iris/tests/unit/fileformats/netcdf/test_Saver.py | 2 -- .../tests/unit/fileformats/netcdf/test__get_cf_var_data.py | 2 -- .../tests/unit/fileformats/netcdf/test__load_aux_factory.py | 2 -- .../tests/unit/fileformats/netcdf/test_parse_cell_methods.py | 2 -- lib/iris/tests/unit/fileformats/nimrod_load_rules/__init__.py | 2 -- .../fileformats/nimrod_load_rules/test_tm_meridian_scaling.py | 2 -- .../unit/fileformats/nimrod_load_rules/test_vertical_coord.py | 2 -- lib/iris/tests/unit/fileformats/pp/__init__.py | 2 -- lib/iris/tests/unit/fileformats/pp/test_PPDataProxy.py | 2 -- lib/iris/tests/unit/fileformats/pp/test_PPField.py | 2 -- .../tests/unit/fileformats/pp/test__convert_constraints.py | 2 -- lib/iris/tests/unit/fileformats/pp/test__create_field_data.py | 2 -- .../unit/fileformats/pp/test__data_bytes_to_shaped_array.py | 2 -- lib/iris/tests/unit/fileformats/pp/test__field_gen.py | 2 -- lib/iris/tests/unit/fileformats/pp/test__interpret_field.py | 2 -- lib/iris/tests/unit/fileformats/pp/test_as_fields.py | 2 -- lib/iris/tests/unit/fileformats/pp/test_load.py | 2 -- lib/iris/tests/unit/fileformats/pp/test_save.py | 2 -- lib/iris/tests/unit/fileformats/pp/test_save_fields.py | 2 -- .../tests/unit/fileformats/pp/test_save_pairs_from_cube.py | 2 -- lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py | 2 -- .../unit/fileformats/pp_load_rules/test__all_other_rules.py | 2 -- .../test__collapse_degenerate_points_and_bounds.py | 2 -- .../pp_load_rules/test__convert_scalar_pseudo_level_coords.py | 2 -- .../pp_load_rules/test__convert_scalar_realization_coords.py | 2 -- .../fileformats/pp_load_rules/test__convert_time_coords.py | 2 -- .../unit/fileformats/pp_load_rules/test__epoch_date_hours.py | 2 -- .../pp_load_rules/test__reduced_points_and_bounds.py | 2 -- lib/iris/tests/unit/fileformats/pyke_rules/__init__.py | 2 -- .../unit/fileformats/pyke_rules/compiled_krb/__init__.py | 2 -- .../pyke_rules/compiled_krb/fc_rules_cf_fc/__init__.py | 2 -- .../fc_rules_cf_fc/test_build_auxiliary_coordinate.py | 2 -- .../compiled_krb/fc_rules_cf_fc/test_build_cube_metadata.py | 2 -- .../fc_rules_cf_fc/test_build_dimension_coordinate.py | 2 -- .../test_build_geostationary_coordinate_system.py | 2 -- .../fc_rules_cf_fc/test_build_mercator_coordinate_system.py | 2 -- .../test_build_stereographic_coordinate_system.py | 2 -- .../fc_rules_cf_fc/test_build_verticalp_coordinate_system.py | 2 -- .../compiled_krb/fc_rules_cf_fc/test_get_attr_units.py | 2 -- .../compiled_krb/fc_rules_cf_fc/test_get_cf_bounds_var.py | 2 -- .../pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_names.py | 2 -- .../fc_rules_cf_fc/test_has_supported_mercator_parameters.py | 2 -- .../test_has_supported_stereographic_parameters.py | 2 -- .../compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py | 2 -- lib/iris/tests/unit/fileformats/rules/__init__.py | 2 -- lib/iris/tests/unit/fileformats/rules/test_Loader.py | 2 -- lib/iris/tests/unit/fileformats/rules/test__make_cube.py | 2 -- .../fileformats/structured_array_identification/__init__.py | 2 -- lib/iris/tests/unit/fileformats/um/__init__.py | 2 -- lib/iris/tests/unit/fileformats/um/fast_load/__init__.py | 2 -- .../unit/fileformats/um/fast_load/test_FieldCollation.py | 2 -- .../unit/fileformats/um/fast_load/test__convert_collation.py | 2 -- .../fileformats/um/fast_load_structured_fields/__init__.py | 2 -- .../fast_load_structured_fields/test_BasicFieldCollation.py | 2 -- .../unit/fileformats/um/optimal_array_structuring/__init__.py | 2 -- .../optimal_array_structuring/test_optimal_array_structure.py | 2 -- lib/iris/tests/unit/fileformats/um/test_um_to_pp.py | 2 -- lib/iris/tests/unit/io/__init__.py | 2 -- lib/iris/tests/unit/io/test_expand_filespecs.py | 2 -- lib/iris/tests/unit/io/test_run_callback.py | 2 -- lib/iris/tests/unit/lazy_data/__init__.py | 2 -- lib/iris/tests/unit/lazy_data/test_as_concrete_data.py | 2 -- lib/iris/tests/unit/lazy_data/test_as_lazy_data.py | 2 -- lib/iris/tests/unit/lazy_data/test_co_realise_cubes.py | 2 -- lib/iris/tests/unit/lazy_data/test_is_lazy_data.py | 2 -- lib/iris/tests/unit/lazy_data/test_lazy_elementwise.py | 2 -- lib/iris/tests/unit/lazy_data/test_multidim_lazy_stack.py | 2 -- lib/iris/tests/unit/lazy_data/test_non_lazy.py | 2 -- lib/iris/tests/unit/merge/__init__.py | 2 -- lib/iris/tests/unit/merge/test_ProtoCube.py | 2 -- lib/iris/tests/unit/plot/_blockplot_common.py | 2 -- .../tests/unit/plot/test__check_bounds_contiguity_and_mask.py | 2 -- .../unit/plot/test__check_geostationary_coords_and_convert.py | 2 -- lib/iris/tests/unit/plot/test__fixup_dates.py | 2 -- lib/iris/tests/unit/plot/test__get_plot_defn.py | 2 -- .../unit/plot/test__get_plot_defn_custom_coords_picked.py | 2 -- lib/iris/tests/unit/plot/test_contour.py | 2 -- lib/iris/tests/unit/plot/test_contourf.py | 2 -- lib/iris/tests/unit/plot/test_outline.py | 2 -- lib/iris/tests/unit/plot/test_pcolor.py | 2 -- lib/iris/tests/unit/plot/test_pcolormesh.py | 2 -- lib/iris/tests/unit/plot/test_plot.py | 2 -- lib/iris/tests/unit/plot/test_points.py | 2 -- lib/iris/tests/unit/plot/test_scatter.py | 2 -- lib/iris/tests/unit/quickplot/__init__.py | 2 -- lib/iris/tests/unit/quickplot/test_contour.py | 2 -- lib/iris/tests/unit/quickplot/test_contourf.py | 2 -- lib/iris/tests/unit/quickplot/test_outline.py | 2 -- lib/iris/tests/unit/quickplot/test_pcolor.py | 2 -- lib/iris/tests/unit/quickplot/test_pcolormesh.py | 2 -- lib/iris/tests/unit/quickplot/test_plot.py | 2 -- lib/iris/tests/unit/quickplot/test_points.py | 2 -- lib/iris/tests/unit/quickplot/test_scatter.py | 2 -- lib/iris/tests/unit/test_Future.py | 4 ++++ lib/iris/tests/unit/test_sample_data_path.py | 2 -- lib/iris/tests/unit/tests/__init__.py | 2 -- lib/iris/tests/unit/tests/test_IrisTest.py | 2 -- lib/iris/tests/unit/util/__init__.py | 2 -- lib/iris/tests/unit/util/test__coord_regular.py | 2 -- lib/iris/tests/unit/util/test__is_circular.py | 2 -- lib/iris/tests/unit/util/test_array_equal.py | 2 -- lib/iris/tests/unit/util/test_column_slices_generator.py | 2 -- .../tests/unit/util/test_demote_dim_coord_to_aux_coord.py | 2 -- lib/iris/tests/unit/util/test_describe_diff.py | 2 -- lib/iris/tests/unit/util/test_file_is_newer_than.py | 2 -- lib/iris/tests/unit/util/test_find_discontiguities.py | 2 -- lib/iris/tests/unit/util/test_mask_cube.py | 2 -- .../tests/unit/util/test_promote_aux_coord_to_dim_coord.py | 2 -- lib/iris/tests/unit/util/test_reverse.py | 2 -- lib/iris/tests/unit/util/test_rolling_window.py | 2 -- lib/iris/tests/unit/util/test_squeeze.py | 2 -- lib/iris/tests/unit/util/test_unify_time_units.py | 2 -- lib/iris/time.py | 2 -- tools/gen_helpers.py | 2 -- tools/gen_stash_refs.py | 2 -- tools/gen_translations.py | 2 -- tools/generate_std_names.py | 2 -- 381 files changed, 4 insertions(+), 758 deletions(-) diff --git a/docs/iris/example_tests/__init__.py b/docs/iris/example_tests/__init__.py index 12f46ffdac..ac5753e58b 100644 --- a/docs/iris/example_tests/__init__.py +++ b/docs/iris/example_tests/__init__.py @@ -3,5 +3,3 @@ # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/docs/iris/example_tests/extest_util.py b/docs/iris/example_tests/extest_util.py index f069f03aae..2effb42ffb 100644 --- a/docs/iris/example_tests/extest_util.py +++ b/docs/iris/example_tests/extest_util.py @@ -10,8 +10,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import contextlib import os.path import warnings diff --git a/docs/iris/example_tests/test_COP_1d_plot.py b/docs/iris/example_tests/test_COP_1d_plot.py index 1921d440c2..81495c1a17 100644 --- a/docs/iris/example_tests/test_COP_1d_plot.py +++ b/docs/iris/example_tests/test_COP_1d_plot.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_COP_maps.py b/docs/iris/example_tests/test_COP_maps.py index 353e47ae0c..b87c09d7b9 100644 --- a/docs/iris/example_tests/test_COP_maps.py +++ b/docs/iris/example_tests/test_COP_maps.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_SOI_filtering.py b/docs/iris/example_tests/test_SOI_filtering.py index a4de5350c8..270523a363 100644 --- a/docs/iris/example_tests/test_SOI_filtering.py +++ b/docs/iris/example_tests/test_SOI_filtering.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_TEC.py b/docs/iris/example_tests/test_TEC.py index 568810919c..8c22c8c2da 100644 --- a/docs/iris/example_tests/test_TEC.py +++ b/docs/iris/example_tests/test_TEC.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_anomaly_log_colouring.py b/docs/iris/example_tests/test_anomaly_log_colouring.py index ea7a6d3ee4..2e020c8818 100644 --- a/docs/iris/example_tests/test_anomaly_log_colouring.py +++ b/docs/iris/example_tests/test_anomaly_log_colouring.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_atlantic_profiles.py b/docs/iris/example_tests/test_atlantic_profiles.py index 7622e3df69..5c6951af6d 100644 --- a/docs/iris/example_tests/test_atlantic_profiles.py +++ b/docs/iris/example_tests/test_atlantic_profiles.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_coriolis_plot.py b/docs/iris/example_tests/test_coriolis_plot.py index fc8b15ecea..f6137f5a33 100644 --- a/docs/iris/example_tests/test_coriolis_plot.py +++ b/docs/iris/example_tests/test_coriolis_plot.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. diff --git a/docs/iris/example_tests/test_cross_section.py b/docs/iris/example_tests/test_cross_section.py index 62adb1075a..8a63ff6d00 100644 --- a/docs/iris/example_tests/test_cross_section.py +++ b/docs/iris/example_tests/test_cross_section.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_custom_aggregation.py b/docs/iris/example_tests/test_custom_aggregation.py index 0bc4ed4397..29eaead0f8 100644 --- a/docs/iris/example_tests/test_custom_aggregation.py +++ b/docs/iris/example_tests/test_custom_aggregation.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_custom_file_loading.py b/docs/iris/example_tests/test_custom_file_loading.py index ecfefc527a..6278bd3f15 100644 --- a/docs/iris/example_tests/test_custom_file_loading.py +++ b/docs/iris/example_tests/test_custom_file_loading.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_deriving_phenomena.py b/docs/iris/example_tests/test_deriving_phenomena.py index a8280726b2..b462a736c1 100644 --- a/docs/iris/example_tests/test_deriving_phenomena.py +++ b/docs/iris/example_tests/test_deriving_phenomena.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_global_map.py b/docs/iris/example_tests/test_global_map.py index e7e8187739..efa0204491 100644 --- a/docs/iris/example_tests/test_global_map.py +++ b/docs/iris/example_tests/test_global_map.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_hovmoller.py b/docs/iris/example_tests/test_hovmoller.py index ccbf671035..68e45af1cf 100644 --- a/docs/iris/example_tests/test_hovmoller.py +++ b/docs/iris/example_tests/test_hovmoller.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_inset_plot.py b/docs/iris/example_tests/test_inset_plot.py index 7463886dbe..cbd3d7c97f 100644 --- a/docs/iris/example_tests/test_inset_plot.py +++ b/docs/iris/example_tests/test_inset_plot.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. diff --git a/docs/iris/example_tests/test_lagged_ensemble.py b/docs/iris/example_tests/test_lagged_ensemble.py index e21087547b..706af76138 100644 --- a/docs/iris/example_tests/test_lagged_ensemble.py +++ b/docs/iris/example_tests/test_lagged_ensemble.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_lineplot_with_legend.py b/docs/iris/example_tests/test_lineplot_with_legend.py index 2e3ecaeaf1..52820ff807 100644 --- a/docs/iris/example_tests/test_lineplot_with_legend.py +++ b/docs/iris/example_tests/test_lineplot_with_legend.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_load_nemo.py b/docs/iris/example_tests/test_load_nemo.py index fc63a84443..66ee62947f 100644 --- a/docs/iris/example_tests/test_load_nemo.py +++ b/docs/iris/example_tests/test_load_nemo.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_orca_projection.py b/docs/iris/example_tests/test_orca_projection.py index 9a338892ff..635583f587 100644 --- a/docs/iris/example_tests/test_orca_projection.py +++ b/docs/iris/example_tests/test_orca_projection.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_polar_stereo.py b/docs/iris/example_tests/test_polar_stereo.py index ce2d91d10c..2195b7e0fa 100644 --- a/docs/iris/example_tests/test_polar_stereo.py +++ b/docs/iris/example_tests/test_polar_stereo.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_polynomial_fit.py b/docs/iris/example_tests/test_polynomial_fit.py index a755b32cb8..53362a5920 100644 --- a/docs/iris/example_tests/test_polynomial_fit.py +++ b/docs/iris/example_tests/test_polynomial_fit.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_projections_and_annotations.py b/docs/iris/example_tests/test_projections_and_annotations.py index 488b594806..8f10642280 100644 --- a/docs/iris/example_tests/test_projections_and_annotations.py +++ b/docs/iris/example_tests/test_projections_and_annotations.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_rotated_pole_mapping.py b/docs/iris/example_tests/test_rotated_pole_mapping.py index f00fb2d39d..ef7500a4c1 100644 --- a/docs/iris/example_tests/test_rotated_pole_mapping.py +++ b/docs/iris/example_tests/test_rotated_pole_mapping.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/example_tests/test_wind_speed.py b/docs/iris/example_tests/test_wind_speed.py index ec40276114..4e341b2dae 100644 --- a/docs/iris/example_tests/test_wind_speed.py +++ b/docs/iris/example_tests/test_wind_speed.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # Import Iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/docs/iris/src/conf.py b/docs/iris/src/conf.py index 3ce5ed5399..a638e922d4 100644 --- a/docs/iris/src/conf.py +++ b/docs/iris/src/conf.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # -*- coding: utf-8 -*- # # Iris documentation build configuration file, created by diff --git a/docs/iris/src/developers_guide/gitwash_dumper.py b/docs/iris/src/developers_guide/gitwash_dumper.py index 4379f55c5a..b450d1f40c 100644 --- a/docs/iris/src/developers_guide/gitwash_dumper.py +++ b/docs/iris/src/developers_guide/gitwash_dumper.py @@ -1,8 +1,6 @@ #!/usr/bin/env python ''' Checkout gitwash repo into directory and do search replace on name ''' -from six.moves import (filter, input, map, range, zip) # noqa - import os from os.path import join as pjoin import shutil diff --git a/docs/iris/src/sphinxext/auto_label_figures.py b/docs/iris/src/sphinxext/auto_label_figures.py index c5981d1637..6fb72826fe 100644 --- a/docs/iris/src/sphinxext/auto_label_figures.py +++ b/docs/iris/src/sphinxext/auto_label_figures.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - import os from docutils import nodes diff --git a/docs/iris/src/sphinxext/custom_class_autodoc.py b/docs/iris/src/sphinxext/custom_class_autodoc.py index a517f22cc5..a558732bd1 100644 --- a/docs/iris/src/sphinxext/custom_class_autodoc.py +++ b/docs/iris/src/sphinxext/custom_class_autodoc.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - from sphinx.ext import autodoc from sphinx.ext.autodoc import * from sphinx.util import force_decode diff --git a/docs/iris/src/sphinxext/custom_data_autodoc.py b/docs/iris/src/sphinxext/custom_data_autodoc.py index de063e13a7..ade07dbc4e 100644 --- a/docs/iris/src/sphinxext/custom_data_autodoc.py +++ b/docs/iris/src/sphinxext/custom_data_autodoc.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - from sphinx.ext.autodoc import DataDocumenter, ModuleLevelDocumenter try: # Use 'object_description' in place of the former 'safe_repr' function. diff --git a/docs/iris/src/sphinxext/gen_example_directory.py b/docs/iris/src/sphinxext/gen_example_directory.py index fa20cc3092..c5de195670 100644 --- a/docs/iris/src/sphinxext/gen_example_directory.py +++ b/docs/iris/src/sphinxext/gen_example_directory.py @@ -9,8 +9,6 @@ Generate the rst files for the examples ''' -from six.moves import (filter, input, map, range, zip) # noqa - import os import re import shutil diff --git a/docs/iris/src/sphinxext/gen_gallery.py b/docs/iris/src/sphinxext/gen_gallery.py index 6bf6ce5df1..b4b88ff3bd 100644 --- a/docs/iris/src/sphinxext/gen_gallery.py +++ b/docs/iris/src/sphinxext/gen_gallery.py @@ -6,8 +6,6 @@ Generate a thumbnail gallery of examples. ''' -from six.moves import (filter, input, map, range, zip) # noqa - import os import glob import re diff --git a/docs/iris/src/userguide/plotting_examples/1d_quickplot_simple.py b/docs/iris/src/userguide/plotting_examples/1d_quickplot_simple.py index 8168d874c4..49d78a4e8a 100644 --- a/docs/iris/src/userguide/plotting_examples/1d_quickplot_simple.py +++ b/docs/iris/src/userguide/plotting_examples/1d_quickplot_simple.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import iris diff --git a/docs/iris/src/userguide/plotting_examples/1d_simple.py b/docs/iris/src/userguide/plotting_examples/1d_simple.py index 63fbc2897e..78f770f2dd 100644 --- a/docs/iris/src/userguide/plotting_examples/1d_simple.py +++ b/docs/iris/src/userguide/plotting_examples/1d_simple.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import iris diff --git a/docs/iris/src/userguide/plotting_examples/1d_with_legend.py b/docs/iris/src/userguide/plotting_examples/1d_with_legend.py index c28e8e23c8..da3bb14fff 100644 --- a/docs/iris/src/userguide/plotting_examples/1d_with_legend.py +++ b/docs/iris/src/userguide/plotting_examples/1d_with_legend.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import iris diff --git a/docs/iris/src/userguide/plotting_examples/brewer.py b/docs/iris/src/userguide/plotting_examples/brewer.py index 84acf63ab7..9712ebf412 100644 --- a/docs/iris/src/userguide/plotting_examples/brewer.py +++ b/docs/iris/src/userguide/plotting_examples/brewer.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import numpy as np diff --git a/docs/iris/src/userguide/plotting_examples/cube_blockplot.py b/docs/iris/src/userguide/plotting_examples/cube_blockplot.py index 8e71ad8911..90e934afd2 100644 --- a/docs/iris/src/userguide/plotting_examples/cube_blockplot.py +++ b/docs/iris/src/userguide/plotting_examples/cube_blockplot.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import iris diff --git a/docs/iris/src/userguide/plotting_examples/cube_brewer_cite_contourf.py b/docs/iris/src/userguide/plotting_examples/cube_brewer_cite_contourf.py index 2e929f8d8d..31ff916e2f 100644 --- a/docs/iris/src/userguide/plotting_examples/cube_brewer_cite_contourf.py +++ b/docs/iris/src/userguide/plotting_examples/cube_brewer_cite_contourf.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import iris diff --git a/docs/iris/src/userguide/plotting_examples/cube_brewer_contourf.py b/docs/iris/src/userguide/plotting_examples/cube_brewer_contourf.py index 30d4690067..948dcdc61c 100644 --- a/docs/iris/src/userguide/plotting_examples/cube_brewer_contourf.py +++ b/docs/iris/src/userguide/plotting_examples/cube_brewer_contourf.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.cm as mpl_cm import matplotlib.pyplot as plt diff --git a/docs/iris/src/userguide/plotting_examples/cube_contour.py b/docs/iris/src/userguide/plotting_examples/cube_contour.py index b1f35696a7..8e8cb91b37 100644 --- a/docs/iris/src/userguide/plotting_examples/cube_contour.py +++ b/docs/iris/src/userguide/plotting_examples/cube_contour.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import iris diff --git a/docs/iris/src/userguide/plotting_examples/cube_contourf.py b/docs/iris/src/userguide/plotting_examples/cube_contourf.py index 2deef44faf..831173de94 100644 --- a/docs/iris/src/userguide/plotting_examples/cube_contourf.py +++ b/docs/iris/src/userguide/plotting_examples/cube_contourf.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import matplotlib.pyplot as plt import iris diff --git a/docs/iris/src/userguide/regridding_plots/interpolate_column.py b/docs/iris/src/userguide/regridding_plots/interpolate_column.py index e7447c1de0..f2cdbae5c7 100644 --- a/docs/iris/src/userguide/regridding_plots/interpolate_column.py +++ b/docs/iris/src/userguide/regridding_plots/interpolate_column.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import iris import iris.quickplot as qplt import iris.analysis diff --git a/docs/iris/src/userguide/regridding_plots/regridded_to_global.py b/docs/iris/src/userguide/regridding_plots/regridded_to_global.py index fd39eb69b8..fdd91f3338 100644 --- a/docs/iris/src/userguide/regridding_plots/regridded_to_global.py +++ b/docs/iris/src/userguide/regridding_plots/regridded_to_global.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import iris import iris.analysis import iris.plot as iplt diff --git a/docs/iris/src/userguide/regridding_plots/regridded_to_rotated.py b/docs/iris/src/userguide/regridding_plots/regridded_to_rotated.py index 276eea488d..8b65553428 100644 --- a/docs/iris/src/userguide/regridding_plots/regridded_to_rotated.py +++ b/docs/iris/src/userguide/regridding_plots/regridded_to_rotated.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import iris import iris.analysis import iris.plot as iplt diff --git a/docs/iris/src/userguide/regridding_plots/regridding_plot.py b/docs/iris/src/userguide/regridding_plots/regridding_plot.py index 387ea44876..a646ba92ab 100644 --- a/docs/iris/src/userguide/regridding_plots/regridding_plot.py +++ b/docs/iris/src/userguide/regridding_plots/regridding_plot.py @@ -1,6 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa - import iris import iris.plot as iplt import matplotlib.pyplot as plt diff --git a/docs/iris/src/whatsnew/aggregate_directory.py b/docs/iris/src/whatsnew/aggregate_directory.py index 401d841bcf..76083c6972 100644 --- a/docs/iris/src/whatsnew/aggregate_directory.py +++ b/docs/iris/src/whatsnew/aggregate_directory.py @@ -18,8 +18,6 @@ is in the style "2001-Jan-23". """ - -from six.moves import (filter, input, map, range, zip) # noqa import datetime from glob import glob import os diff --git a/lib/iris/__init__.py b/lib/iris/__init__.py index 84bdbbd1b1..fa6a1fe8a4 100644 --- a/lib/iris/__init__.py +++ b/lib/iris/__init__.py @@ -84,8 +84,6 @@ def callback(cube, field, filename): cube.add_aux_coord(experiment_coord) """ - -from six.moves import (filter, input, map, range, zip) # noqa import six import contextlib diff --git a/lib/iris/_cube_coord_common.py b/lib/iris/_cube_coord_common.py index 462a5678a9..00eecc6858 100644 --- a/lib/iris/_cube_coord_common.py +++ b/lib/iris/_cube_coord_common.py @@ -3,8 +3,6 @@ # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - -from six.moves import (filter, input, map, range, zip) # noqa import six import re diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index c7cb46bacc..fb32656a6c 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa -import six import copy import numpy as np diff --git a/lib/iris/_deprecation.py b/lib/iris/_deprecation.py index e5e4e768bb..e147ed206d 100644 --- a/lib/iris/_deprecation.py +++ b/lib/iris/_deprecation.py @@ -7,8 +7,6 @@ Utilities for producing runtime deprecation messages. """ -from six.moves import (filter, input, map, range, zip) # noqa -import six import warnings diff --git a/lib/iris/analysis/_area_weighted.py b/lib/iris/analysis/_area_weighted.py index 267862595d..23c71bd8d8 100644 --- a/lib/iris/analysis/_area_weighted.py +++ b/lib/iris/analysis/_area_weighted.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - import numpy as np from iris.analysis._interpolation import get_xy_dim_coords, snapshot_grid diff --git a/lib/iris/analysis/_grid_angles.py b/lib/iris/analysis/_grid_angles.py index 8c4dbdcd5a..d603ab9ca5 100644 --- a/lib/iris/analysis/_grid_angles.py +++ b/lib/iris/analysis/_grid_angles.py @@ -8,8 +8,6 @@ from coordinate points and bounds. """ -from six.moves import (filter, input, map, range, zip) # noqa - import numpy as np import cartopy.crs as ccrs diff --git a/lib/iris/config.py b/lib/iris/config.py index 763c84a3bb..ed18a175ed 100644 --- a/lib/iris/config.py +++ b/lib/iris/config.py @@ -29,8 +29,6 @@ ---------- """ - -from six.moves import (filter, input, map, range, zip) # noqa import six from six.moves import configparser diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index c7bd8703cb..720835eff5 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -7,8 +7,6 @@ Definitions of coordinate systems. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six from abc import ABCMeta, abstractmethod diff --git a/lib/iris/exceptions.py b/lib/iris/exceptions.py index 34aedcc10b..1f9b0108b4 100644 --- a/lib/iris/exceptions.py +++ b/lib/iris/exceptions.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - class IrisError(Exception): """Base class for errors in the Iris package.""" diff --git a/lib/iris/experimental/__init__.py b/lib/iris/experimental/__init__.py index d657ac4a55..40ba7fdb66 100644 --- a/lib/iris/experimental/__init__.py +++ b/lib/iris/experimental/__init__.py @@ -10,5 +10,3 @@ codebase. The code is expected to graduate, eventually, to "full status". """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/experimental/concatenate.py b/lib/iris/experimental/concatenate.py index d7bfcfa2c8..7446360f02 100644 --- a/lib/iris/experimental/concatenate.py +++ b/lib/iris/experimental/concatenate.py @@ -13,8 +13,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - def concatenate(cubes): """ diff --git a/lib/iris/experimental/equalise_cubes.py b/lib/iris/experimental/equalise_cubes.py index bdd566cd19..3a5049a038 100644 --- a/lib/iris/experimental/equalise_cubes.py +++ b/lib/iris/experimental/equalise_cubes.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import numpy as np diff --git a/lib/iris/experimental/raster.py b/lib/iris/experimental/raster.py index 94f97f028c..1535efe6af 100644 --- a/lib/iris/experimental/raster.py +++ b/lib/iris/experimental/raster.py @@ -14,8 +14,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import numpy as np import numpy.ma as ma from osgeo import gdal, osr diff --git a/lib/iris/experimental/regrid.py b/lib/iris/experimental/regrid.py index 95074e531e..878515f66d 100644 --- a/lib/iris/experimental/regrid.py +++ b/lib/iris/experimental/regrid.py @@ -8,7 +8,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six from collections import namedtuple import copy diff --git a/lib/iris/experimental/ugrid.py b/lib/iris/experimental/ugrid.py index b88fd198b9..0ff95a4fdf 100644 --- a/lib/iris/experimental/ugrid.py +++ b/lib/iris/experimental/ugrid.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import iris diff --git a/lib/iris/fileformats/__init__.py b/lib/iris/fileformats/__init__.py index fd4b2bc9ad..17fded7298 100644 --- a/lib/iris/fileformats/__init__.py +++ b/lib/iris/fileformats/__init__.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - from iris.io.format_picker import (FileExtension, FormatAgent, FormatSpecification, MagicNumber, UriProtocol, LeadingLine) diff --git a/lib/iris/fileformats/_pp_lbproc_pairs.py b/lib/iris/fileformats/_pp_lbproc_pairs.py index 380956b118..0a812019d2 100644 --- a/lib/iris/fileformats/_pp_lbproc_pairs.py +++ b/lib/iris/fileformats/_pp_lbproc_pairs.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa -import six import itertools diff --git a/lib/iris/fileformats/abf.py b/lib/iris/fileformats/abf.py index e5e8f8f263..c2e1209b47 100644 --- a/lib/iris/fileformats/abf.py +++ b/lib/iris/fileformats/abf.py @@ -13,8 +13,6 @@ `here `_. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six import calendar diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index 80883a9b85..624f5b5a88 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -13,8 +13,6 @@ [NUG] NetCDF User's Guide, http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html """ - -from six.moves import (filter, input, map, range, zip) # noqa import six from abc import ABCMeta, abstractmethod diff --git a/lib/iris/fileformats/dot.py b/lib/iris/fileformats/dot.py index 35ca2fc3ac..5fb7511775 100644 --- a/lib/iris/fileformats/dot.py +++ b/lib/iris/fileformats/dot.py @@ -7,8 +7,6 @@ Provides Creation and saving of DOT graphs for a :class:`iris.cube.Cube`. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six import os diff --git a/lib/iris/fileformats/name.py b/lib/iris/fileformats/name.py index 919362c9ab..ebfad9f81a 100644 --- a/lib/iris/fileformats/name.py +++ b/lib/iris/fileformats/name.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Provides NAME file format loading capabilities.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six import iris.io diff --git a/lib/iris/fileformats/nimrod.py b/lib/iris/fileformats/nimrod.py index 57c67a5eea..94a28645b2 100644 --- a/lib/iris/fileformats/nimrod.py +++ b/lib/iris/fileformats/nimrod.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Provides NIMROD file format capabilities.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six import glob diff --git a/lib/iris/fileformats/nimrod_load_rules.py b/lib/iris/fileformats/nimrod_load_rules.py index e216f66760..8ea4e4c200 100644 --- a/lib/iris/fileformats/nimrod_load_rules.py +++ b/lib/iris/fileformats/nimrod_load_rules.py @@ -5,8 +5,6 @@ # licensing details. """Rules for converting NIMROD fields into cubes.""" -from six.moves import (filter, input, map, range, zip) # noqa - import warnings diff --git a/lib/iris/fileformats/pp_save_rules.py b/lib/iris/fileformats/pp_save_rules.py index b0203585bf..02b0417e13 100644 --- a/lib/iris/fileformats/pp_save_rules.py +++ b/lib/iris/fileformats/pp_save_rules.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa -import six import warnings diff --git a/lib/iris/fileformats/um/__init__.py b/lib/iris/fileformats/um/__init__.py index 7b01fbce4b..0f9a34be88 100644 --- a/lib/iris/fileformats/um/__init__.py +++ b/lib/iris/fileformats/um/__init__.py @@ -11,8 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Publish the FF-replacement features here, and include documentation. from ._ff_replacement import um_to_pp, load_cubes, load_cubes_32bit_ieee from ._fast_load import structured_um_loading, FieldCollation diff --git a/lib/iris/fileformats/um/_fast_load.py b/lib/iris/fileformats/um/_fast_load.py index 384f57e4ea..0f3873ccfb 100644 --- a/lib/iris/fileformats/um/_fast_load.py +++ b/lib/iris/fileformats/um/_fast_load.py @@ -22,7 +22,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six from contextlib import contextmanager import threading diff --git a/lib/iris/fileformats/um/_ff_replacement.py b/lib/iris/fileformats/um/_ff_replacement.py index 1b5816b3ef..21ecd471f1 100644 --- a/lib/iris/fileformats/um/_ff_replacement.py +++ b/lib/iris/fileformats/um/_ff_replacement.py @@ -11,8 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa -import six from iris.fileformats._ff import FF2PP from iris.fileformats.pp import _load_cubes_variable_loader diff --git a/lib/iris/fileformats/um/_optimal_array_structuring.py b/lib/iris/fileformats/um/_optimal_array_structuring.py index 3c77d89ca1..297984ac31 100644 --- a/lib/iris/fileformats/um/_optimal_array_structuring.py +++ b/lib/iris/fileformats/um/_optimal_array_structuring.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """A module to provide an optimal array structure calculation.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six import itertools diff --git a/lib/iris/io/format_picker.py b/lib/iris/io/format_picker.py index fc0f458acc..f39f0146e6 100644 --- a/lib/iris/io/format_picker.py +++ b/lib/iris/io/format_picker.py @@ -39,8 +39,6 @@ """ - -from six.moves import (filter, input, map, range, zip) # noqa import six try: # Python 3 diff --git a/lib/iris/pandas.py b/lib/iris/pandas.py index 4d3fd618be..6f95b9a0a7 100644 --- a/lib/iris/pandas.py +++ b/lib/iris/pandas.py @@ -10,8 +10,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import datetime import cf_units diff --git a/lib/iris/quickplot.py b/lib/iris/quickplot.py index a0cc4496dc..bef634edd9 100644 --- a/lib/iris/quickplot.py +++ b/lib/iris/quickplot.py @@ -13,8 +13,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import cf_units import matplotlib.pyplot as plt diff --git a/lib/iris/symbols.py b/lib/iris/symbols.py index 85c6367e84..54cb88f7b0 100644 --- a/lib/iris/symbols.py +++ b/lib/iris/symbols.py @@ -7,8 +7,6 @@ Contains symbol definitions for use with :func:`iris.plot.symbols`. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six import itertools diff --git a/lib/iris/tests/experimental/__init__.py b/lib/iris/tests/experimental/__init__.py index ef53e57ca4..fa2390c45b 100644 --- a/lib/iris/tests/experimental/__init__.py +++ b/lib/iris/tests/experimental/__init__.py @@ -7,5 +7,3 @@ Experimental code is tested in this package. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/experimental/regrid/__init__.py b/lib/iris/tests/experimental/regrid/__init__.py index f23a9e2fdc..653505e3d5 100644 --- a/lib/iris/tests/experimental/regrid/__init__.py +++ b/lib/iris/tests/experimental/regrid/__init__.py @@ -7,5 +7,3 @@ Regridding code is tested in this package. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py b/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py index bebd36c9e6..7712a216a5 100644 --- a/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py +++ b/lib/iris/tests/experimental/regrid/test_regrid_conservative_via_esmpy.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/experimental/test_raster.py b/lib/iris/tests/experimental/test_raster.py index f9ccbbe63f..ee950d3ebc 100644 --- a/lib/iris/tests/experimental/test_raster.py +++ b/lib/iris/tests/experimental/test_raster.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa -import six import iris.tests as tests import iris diff --git a/lib/iris/tests/experimental/ugrid/__init__.py b/lib/iris/tests/experimental/ugrid/__init__.py index a192e5fade..765c1d09a2 100644 --- a/lib/iris/tests/experimental/ugrid/__init__.py +++ b/lib/iris/tests/experimental/ugrid/__init__.py @@ -7,5 +7,3 @@ Ugrid code is tested in this package. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/experimental/ugrid/test_ugrid.py b/lib/iris/tests/experimental/ugrid/test_ugrid.py index ff31d82dcd..fd03a85684 100644 --- a/lib/iris/tests/experimental/ugrid/test_ugrid.py +++ b/lib/iris/tests/experimental/ugrid/test_ugrid.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import iris.tests as tests import unittest diff --git a/lib/iris/tests/idiff.py b/lib/iris/tests/idiff.py index f9ce0ece56..1aedb12e79 100755 --- a/lib/iris/tests/idiff.py +++ b/lib/iris/tests/idiff.py @@ -11,8 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import argparse import codecs import contextlib diff --git a/lib/iris/tests/integration/__init__.py b/lib/iris/tests/integration/__init__.py index 7ca4ce9ec6..71b911cbb0 100644 --- a/lib/iris/tests/integration/__init__.py +++ b/lib/iris/tests/integration/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for the :mod:`iris` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/aux_factory/__init__.py b/lib/iris/tests/integration/aux_factory/__init__.py index 7e50f43013..58ba6fb82b 100644 --- a/lib/iris/tests/integration/aux_factory/__init__.py +++ b/lib/iris/tests/integration/aux_factory/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for the :mod:`iris.aux_factory` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/concatenate/__init__.py b/lib/iris/tests/integration/concatenate/__init__.py index 4b6692c254..fb136098ee 100644 --- a/lib/iris/tests/integration/concatenate/__init__.py +++ b/lib/iris/tests/integration/concatenate/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for the :mod:`iris._concatenate` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/experimental/__init__.py b/lib/iris/tests/integration/experimental/__init__.py index 61e926f453..269cf3dd9a 100644 --- a/lib/iris/tests/integration/experimental/__init__.py +++ b/lib/iris/tests/integration/experimental/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for the :mod:`iris.experimental` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/experimental/test_CubeRepresentation.py b/lib/iris/tests/integration/experimental/test_CubeRepresentation.py index d973201ceb..3bf2991af1 100644 --- a/lib/iris/tests/integration/experimental/test_CubeRepresentation.py +++ b/lib/iris/tests/integration/experimental/test_CubeRepresentation.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for cube html representation.""" - -from six.moves import (filter, input, map, range, zip) # noqa from html import escape # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/integration/experimental/test_regrid_ProjectedUnstructured.py b/lib/iris/tests/integration/experimental/test_regrid_ProjectedUnstructured.py index d74ee5ab2e..f78d2c240a 100644 --- a/lib/iris/tests/integration/experimental/test_regrid_ProjectedUnstructured.py +++ b/lib/iris/tests/integration/experimental/test_regrid_ProjectedUnstructured.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for experimental regridding.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/fast_load/__init__.py b/lib/iris/tests/integration/fast_load/__init__.py index bd637837ae..a94785ca58 100644 --- a/lib/iris/tests/integration/fast_load/__init__.py +++ b/lib/iris/tests/integration/fast_load/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for :mod:`iris.fileformats.um` fast load functions.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/format_interop/__init__.py b/lib/iris/tests/integration/format_interop/__init__.py index 9b3017faa7..b9024f2f39 100644 --- a/lib/iris/tests/integration/format_interop/__init__.py +++ b/lib/iris/tests/integration/format_interop/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for format interoperability.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/format_interop/test_name_grib.py b/lib/iris/tests/integration/format_interop/test_name_grib.py index 743cac5062..f600c021db 100644 --- a/lib/iris/tests/integration/format_interop/test_name_grib.py +++ b/lib/iris/tests/integration/format_interop/test_name_grib.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for NAME to GRIB2 interoperability.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/format_interop/test_pp_grib.py b/lib/iris/tests/integration/format_interop/test_pp_grib.py index 782f067eb7..e860a6ac23 100644 --- a/lib/iris/tests/integration/format_interop/test_pp_grib.py +++ b/lib/iris/tests/integration/format_interop/test_pp_grib.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for PP/GRIB interoperability.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/plot/__init__.py b/lib/iris/tests/integration/plot/__init__.py index 67f7dde82e..aafa488e2d 100644 --- a/lib/iris/tests/integration/plot/__init__.py +++ b/lib/iris/tests/integration/plot/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for the :mod:`iris.plot` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/plot/test_colorbar.py b/lib/iris/tests/integration/plot/test_colorbar.py index f6342411e2..42ddf5ddd7 100644 --- a/lib/iris/tests/integration/plot/test_colorbar.py +++ b/lib/iris/tests/integration/plot/test_colorbar.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/plot/test_netcdftime.py b/lib/iris/tests/integration/plot/test_netcdftime.py index 52e59ae282..d69f315490 100644 --- a/lib/iris/tests/integration/plot/test_netcdftime.py +++ b/lib/iris/tests/integration/plot/test_netcdftime.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/plot/test_nzdateline.py b/lib/iris/tests/integration/plot/test_nzdateline.py index 73064e16c7..5e485c11e2 100644 --- a/lib/iris/tests/integration/plot/test_nzdateline.py +++ b/lib/iris/tests/integration/plot/test_nzdateline.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/plot/test_plot_2d_coords.py b/lib/iris/tests/integration/plot/test_plot_2d_coords.py index f1acb0600f..08a4b96703 100644 --- a/lib/iris/tests/integration/plot/test_plot_2d_coords.py +++ b/lib/iris/tests/integration/plot/test_plot_2d_coords.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/plot/test_vector_plots.py b/lib/iris/tests/integration/plot/test_vector_plots.py index a2376b7e0c..7e8bd9cf60 100644 --- a/lib/iris/tests/integration/plot/test_vector_plots.py +++ b/lib/iris/tests/integration/plot/test_vector_plots.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/test_PartialDateTime.py b/lib/iris/tests/integration/test_PartialDateTime.py index 1887316854..cc19dfe3f8 100644 --- a/lib/iris/tests/integration/test_PartialDateTime.py +++ b/lib/iris/tests/integration/test_PartialDateTime.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for :class:`iris.time.PartialDateTime`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_climatology.py b/lib/iris/tests/integration/test_climatology.py index fa55bf89ba..e6b78c480c 100644 --- a/lib/iris/tests/integration/test_climatology.py +++ b/lib/iris/tests/integration/test_climatology.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for loading and saving netcdf files.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_cube.py b/lib/iris/tests/integration/test_cube.py index 2bea650484..36038516f9 100644 --- a/lib/iris/tests/integration/test_cube.py +++ b/lib/iris/tests/integration/test_cube.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for :class:`iris.cube.Cube`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_ff.py b/lib/iris/tests/integration/test_ff.py index 8afb33fa55..cfff8424cc 100644 --- a/lib/iris/tests/integration/test_ff.py +++ b/lib/iris/tests/integration/test_ff.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for loading LBC fieldsfiles.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_grib2.py b/lib/iris/tests/integration/test_grib2.py index 13fbcedfd3..a567fa5536 100644 --- a/lib/iris/tests/integration/test_grib2.py +++ b/lib/iris/tests/integration/test_grib2.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for loading and saving GRIB2 files.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_grib_load.py b/lib/iris/tests/integration/test_grib_load.py index 045adbf23a..77641dbc0a 100644 --- a/lib/iris/tests/integration/test_grib_load.py +++ b/lib/iris/tests/integration/test_grib_load.py @@ -14,8 +14,6 @@ specific, and target the module 'iris_grib'. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/test_new_axis.py b/lib/iris/tests/integration/test_new_axis.py index 6ed1e865a9..86beb4e0e7 100644 --- a/lib/iris/tests/integration/test_new_axis.py +++ b/lib/iris/tests/integration/test_new_axis.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for :func:`iris.util.new_axis`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_pickle.py b/lib/iris/tests/integration/test_pickle.py index 5af72ef28d..a8e2aad20d 100644 --- a/lib/iris/tests/integration/test_pickle.py +++ b/lib/iris/tests/integration/test_pickle.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for pickling things.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_pp.py b/lib/iris/tests/integration/test_pp.py index da5b5804a1..11e0ae6b07 100644 --- a/lib/iris/tests/integration/test_pp.py +++ b/lib/iris/tests/integration/test_pp.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for loading and saving PP files.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests 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 0ed0be1843..f2a364252e 100644 --- a/lib/iris/tests/integration/test_pp_constrained_load_cubes.py +++ b/lib/iris/tests/integration/test_pp_constrained_load_cubes.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for :func:`iris.fileformats.rules.load_cubes`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_regrid_equivalence.py b/lib/iris/tests/integration/test_regrid_equivalence.py index 2c878d63d7..8a5b35af65 100644 --- a/lib/iris/tests/integration/test_regrid_equivalence.py +++ b/lib/iris/tests/integration/test_regrid_equivalence.py @@ -9,8 +9,6 @@ "iris.cube.Cube.regrid(scheme=iris.analysis.Nearest())". """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_subset.py b/lib/iris/tests/integration/test_subset.py index d2f66a61b2..13894fdcf2 100644 --- a/lib/iris/tests/integration/test_subset.py +++ b/lib/iris/tests/integration/test_subset.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for subset.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/um/__init__.py b/lib/iris/tests/integration/um/__init__.py index bd637837ae..a94785ca58 100644 --- a/lib/iris/tests/integration/um/__init__.py +++ b/lib/iris/tests/integration/um/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for :mod:`iris.fileformats.um` fast load functions.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/integration/um/test_fieldsfile.py b/lib/iris/tests/integration/um/test_fieldsfile.py index bdbb076072..8563a1184c 100644 --- a/lib/iris/tests/integration/um/test_fieldsfile.py +++ b/lib/iris/tests/integration/um/test_fieldsfile.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/pp.py b/lib/iris/tests/pp.py index 94a59bdd3e..7c1b012386 100644 --- a/lib/iris/tests/pp.py +++ b/lib/iris/tests/pp.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - import contextlib import os.path diff --git a/lib/iris/tests/runner/__init__.py b/lib/iris/tests/runner/__init__.py index 1894584a92..b561e1cf87 100644 --- a/lib/iris/tests/runner/__init__.py +++ b/lib/iris/tests/runner/__init__.py @@ -7,5 +7,3 @@ Empty file to allow import. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/runner/__main__.py b/lib/iris/tests/runner/__main__.py index 08a2a82f46..e91da1082f 100644 --- a/lib/iris/tests/runner/__main__.py +++ b/lib/iris/tests/runner/__main__.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import argparse from ._runner import TestRunner diff --git a/lib/iris/tests/runner/_runner.py b/lib/iris/tests/runner/_runner.py index 47b672fc3a..c84bffba9a 100644 --- a/lib/iris/tests/runner/_runner.py +++ b/lib/iris/tests/runner/_runner.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Because this file is imported by setup.py, there may be additional runtime # imports later in the file. import multiprocessing diff --git a/lib/iris/tests/system_test.py b/lib/iris/tests/system_test.py index 75434ed841..d919d01903 100644 --- a/lib/iris/tests/system_test.py +++ b/lib/iris/tests/system_test.py @@ -12,8 +12,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import cf_units diff --git a/lib/iris/tests/test_abf.py b/lib/iris/tests/test_abf.py index fecabd6f33..72ff3d5853 100644 --- a/lib/iris/tests/test_abf.py +++ b/lib/iris/tests/test_abf.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_aggregate_by.py b/lib/iris/tests/test_aggregate_by.py index cad392a4be..3d1a7b471b 100644 --- a/lib/iris/tests/test_aggregate_by.py +++ b/lib/iris/tests/test_aggregate_by.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_analysis.py b/lib/iris/tests/test_analysis.py index fa2ab9269e..82ccd489c7 100644 --- a/lib/iris/tests/test_analysis.py +++ b/lib/iris/tests/test_analysis.py @@ -5,8 +5,6 @@ # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa -import six # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_analysis_calculus.py b/lib/iris/tests/test_analysis_calculus.py index 4c7eef9398..500504811b 100644 --- a/lib/iris/tests/test_analysis_calculus.py +++ b/lib/iris/tests/test_analysis_calculus.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_basic_maths.py b/lib/iris/tests/test_basic_maths.py index bf14821890..f520076aa4 100644 --- a/lib/iris/tests/test_basic_maths.py +++ b/lib/iris/tests/test_basic_maths.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_cartography.py b/lib/iris/tests/test_cartography.py index d6f9d8858b..77460cd231 100644 --- a/lib/iris/tests/test_cartography.py +++ b/lib/iris/tests/test_cartography.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index acde3b73d0..da2d4d6029 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -7,8 +7,6 @@ Test cube indexing, slicing, and extracting, and also the dot graphs. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before importing anything else diff --git a/lib/iris/tests/test_cell.py b/lib/iris/tests/test_cell.py index f6baa6f680..bc9f1fdc36 100644 --- a/lib/iris/tests/test_cell.py +++ b/lib/iris/tests/test_cell.py @@ -5,8 +5,6 @@ # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_cf.py b/lib/iris/tests/test_cf.py index 2e8609d438..b6b981156b 100644 --- a/lib/iris/tests/test_cf.py +++ b/lib/iris/tests/test_cf.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_coding_standards.py b/lib/iris/tests/test_coding_standards.py index b3635a4167..5e24e77dbf 100644 --- a/lib/iris/tests/test_coding_standards.py +++ b/lib/iris/tests/test_coding_standards.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris.tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_concatenate.py b/lib/iris/tests/test_concatenate.py index 6b3c35651f..c41d2438b4 100644 --- a/lib/iris/tests/test_concatenate.py +++ b/lib/iris/tests/test_concatenate.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/test_coord_categorisation.py b/lib/iris/tests/test_coord_categorisation.py index 4a515869a6..d983e09d99 100644 --- a/lib/iris/tests/test_coord_categorisation.py +++ b/lib/iris/tests/test_coord_categorisation.py @@ -7,8 +7,6 @@ Test the coordinate categorisation functions. """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_coordsystem.py b/lib/iris/tests/test_coordsystem.py index 30cb30c0d6..18603d6c19 100644 --- a/lib/iris/tests/test_coordsystem.py +++ b/lib/iris/tests/test_coordsystem.py @@ -5,8 +5,6 @@ # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_cube.py b/lib/iris/tests/test_cube.py index fbf665ef6a..79f618891d 100644 --- a/lib/iris/tests/test_cube.py +++ b/lib/iris/tests/test_cube.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_file_load.py b/lib/iris/tests/test_file_load.py index f71b267d25..621542b537 100644 --- a/lib/iris/tests/test_file_load.py +++ b/lib/iris/tests/test_file_load.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests import iris diff --git a/lib/iris/tests/test_file_save.py b/lib/iris/tests/test_file_save.py index 7e6eab40b0..0f62975757 100644 --- a/lib/iris/tests/test_file_save.py +++ b/lib/iris/tests/test_file_save.py @@ -7,8 +7,6 @@ Test the file saving mechanism. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before importing anything else diff --git a/lib/iris/tests/test_grib_load_translations.py b/lib/iris/tests/test_grib_load_translations.py index c98616f0f7..f4e6795036 100644 --- a/lib/iris/tests/test_grib_load_translations.py +++ b/lib/iris/tests/test_grib_load_translations.py @@ -7,8 +7,6 @@ Tests for specific implementation aspects of the grib loaders. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_grib_save.py b/lib/iris/tests/test_grib_save.py index 526ca19843..7ddc3965d3 100644 --- a/lib/iris/tests/test_grib_save.py +++ b/lib/iris/tests/test_grib_save.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_grib_save_rules.py b/lib/iris/tests/test_grib_save_rules.py index 895d20a86e..61c18d0052 100644 --- a/lib/iris/tests/test_grib_save_rules.py +++ b/lib/iris/tests/test_grib_save_rules.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for :mod:`iris_grib._save_rules`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_hybrid.py b/lib/iris/tests/test_hybrid.py index 30f32091e1..9193a9988e 100644 --- a/lib/iris/tests/test_hybrid.py +++ b/lib/iris/tests/test_hybrid.py @@ -7,8 +7,6 @@ Test the hybrid vertical coordinate representations. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/test_image_json.py b/lib/iris/tests/test_image_json.py index 151a22f41b..775e0644f6 100644 --- a/lib/iris/tests/test_image_json.py +++ b/lib/iris/tests/test_image_json.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/test_intersect.py b/lib/iris/tests/test_intersect.py index 92badecd69..d9d070223b 100644 --- a/lib/iris/tests/test_intersect.py +++ b/lib/iris/tests/test_intersect.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_io_init.py b/lib/iris/tests/test_io_init.py index 4967cfd44f..7679ffa74c 100644 --- a/lib/iris/tests/test_io_init.py +++ b/lib/iris/tests/test_io_init.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_load.py b/lib/iris/tests/test_load.py index c67e2b30e0..41d7ff1e89 100644 --- a/lib/iris/tests/test_load.py +++ b/lib/iris/tests/test_load.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_name.py b/lib/iris/tests/test_name.py index 1f76a1310d..a69d305011 100644 --- a/lib/iris/tests/test_name.py +++ b/lib/iris/tests/test_name.py @@ -5,8 +5,6 @@ # licensing details. """Tests for NAME loading.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_netcdf.py b/lib/iris/tests/test_netcdf.py index a115c8eb6b..97e5fd38ff 100644 --- a/lib/iris/tests/test_netcdf.py +++ b/lib/iris/tests/test_netcdf.py @@ -7,8 +7,6 @@ Test CF-NetCDF file loading and saving. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/test_nimrod.py b/lib/iris/tests/test_nimrod.py index 9f4ad805f6..4e587c120f 100644 --- a/lib/iris/tests/test_nimrod.py +++ b/lib/iris/tests/test_nimrod.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_pandas.py b/lib/iris/tests/test_pandas.py index d7d12a9a0e..5988059eb3 100644 --- a/lib/iris/tests/test_pandas.py +++ b/lib/iris/tests/test_pandas.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_peak.py b/lib/iris/tests/test_peak.py index 6864f1b6ce..d7fd37a783 100644 --- a/lib/iris/tests/test_peak.py +++ b/lib/iris/tests/test_peak.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - import iris.analysis import iris.tests as tests import iris.tests.stock diff --git a/lib/iris/tests/test_pp_cf.py b/lib/iris/tests/test_pp_cf.py index 19301e20be..bd430ba543 100644 --- a/lib/iris/tests/test_pp_cf.py +++ b/lib/iris/tests/test_pp_cf.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests import iris.coords diff --git a/lib/iris/tests/test_pp_stash.py b/lib/iris/tests/test_pp_stash.py index c6528b15c5..f03ae8c0dd 100644 --- a/lib/iris/tests/test_pp_stash.py +++ b/lib/iris/tests/test_pp_stash.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_quickplot.py b/lib/iris/tests/test_quickplot.py index 2eed7e0436..26eb1157b0 100644 --- a/lib/iris/tests/test_quickplot.py +++ b/lib/iris/tests/test_quickplot.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests import iris.tests.test_plot as test_plot diff --git a/lib/iris/tests/test_std_names.py b/lib/iris/tests/test_std_names.py index 5163dd2237..c0551f704c 100644 --- a/lib/iris/tests/test_std_names.py +++ b/lib/iris/tests/test_std_names.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_uri_callback.py b/lib/iris/tests/test_uri_callback.py index 39a2d370ab..d2323506c5 100644 --- a/lib/iris/tests/test_uri_callback.py +++ b/lib/iris/tests/test_uri_callback.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_whatsnew_contributions.py b/lib/iris/tests/test_whatsnew_contributions.py index 742098fbbe..22524501ee 100644 --- a/lib/iris/tests/test_whatsnew_contributions.py +++ b/lib/iris/tests/test_whatsnew_contributions.py @@ -19,8 +19,6 @@ invokes the checking command directly. """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first. import iris.tests as tests diff --git a/lib/iris/tests/unit/__init__.py b/lib/iris/tests/unit/__init__.py index 8aa372e7f0..50929c8020 100644 --- a/lib/iris/tests/unit/__init__.py +++ b/lib/iris/tests/unit/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/__init__.py b/lib/iris/tests/unit/analysis/__init__.py index 354136f500..930c63eecf 100644 --- a/lib/iris/tests/unit/analysis/__init__.py +++ b/lib/iris/tests/unit/analysis/__init__.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :mod:`iris.analysis` package.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/area_weighted/__init__.py b/lib/iris/tests/unit/analysis/area_weighted/__init__.py index f71d333ff3..464036a6dd 100644 --- a/lib/iris/tests/unit/analysis/area_weighted/__init__.py +++ b/lib/iris/tests/unit/analysis/area_weighted/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.analysis._area_weighted` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py b/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py index 402a5e94bf..510e81eb62 100644 --- a/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py +++ b/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/cartography/__init__.py b/lib/iris/tests/unit/analysis/cartography/__init__.py index 57155636e5..625a6fa141 100644 --- a/lib/iris/tests/unit/analysis/cartography/__init__.py +++ b/lib/iris/tests/unit/analysis/cartography/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.analysis.cartography` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py index db34711dee..44fdf5640c 100644 --- a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py +++ b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py @@ -6,8 +6,6 @@ """Unit tests for the `iris.analysis.cartography._quadrant_area` function""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/cartography/test__xy_range.py b/lib/iris/tests/unit/analysis/cartography/test__xy_range.py index d550fcf527..abed3eb5da 100644 --- a/lib/iris/tests/unit/analysis/cartography/test__xy_range.py +++ b/lib/iris/tests/unit/analysis/cartography/test__xy_range.py @@ -9,8 +9,6 @@ # Import iris.tests first so that some things can be initialised before # importing anything else. -from six.moves import (filter, input, map, range, zip) # noqa - import iris.tests as tests import iris.tests.stock as stock import numpy as np diff --git a/lib/iris/tests/unit/analysis/cartography/test_area_weights.py b/lib/iris/tests/unit/analysis/cartography/test_area_weights.py index 04e96e782c..027993b9dc 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_area_weights.py +++ b/lib/iris/tests/unit/analysis/cartography/test_area_weights.py @@ -8,8 +8,6 @@ # Import iris.tests first so that some things can be initialised before # importing anything else. - -from six.moves import (filter, input, map, range, zip) # noqa import iris.tests as tests import iris.tests.stock as stock import iris.analysis.cartography diff --git a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py index a2927ee7be..fe2ac9b675 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py +++ b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py @@ -8,8 +8,6 @@ :func:`iris.analysis.cartography.gridcell_angles`. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/cartography/test_project.py b/lib/iris/tests/unit/analysis/cartography/test_project.py index 491f06e07d..9e9f336b89 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_project.py +++ b/lib/iris/tests/unit/analysis/cartography/test_project.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :func:`iris.analysis.cartography.project`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py b/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py index 9d0dcf79dd..1d0eb36193 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py +++ b/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py @@ -8,8 +8,6 @@ :func:`iris.analysis.cartography.rotate_grid_vectors`. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py b/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py index 52ba4822dd..bf29a174d4 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py +++ b/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py @@ -8,8 +8,6 @@ :func:`iris.analysis.cartography.rotate_winds`. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/geometry/__init__.py b/lib/iris/tests/unit/analysis/geometry/__init__.py index fa3c2df2d3..c57f5e246a 100644 --- a/lib/iris/tests/unit/analysis/geometry/__init__.py +++ b/lib/iris/tests/unit/analysis/geometry/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.analysis.geometry` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py b/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py index 56ba1e8010..b6d959bb09 100644 --- a/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py +++ b/lib/iris/tests/unit/analysis/geometry/test__extract_relevant_cube_slice.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py b/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py index 9a48a0927f..ec43dc6852 100644 --- a/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py +++ b/lib/iris/tests/unit/analysis/geometry/test_geometry_area_weights.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/analysis/interpolation/__init__.py b/lib/iris/tests/unit/analysis/interpolation/__init__.py index c7d5063917..3825dacda3 100644 --- a/lib/iris/tests/unit/analysis/interpolation/__init__.py +++ b/lib/iris/tests/unit/analysis/interpolation/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.analysis._interpolation` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py index 3fda059999..428a4a03a4 100644 --- a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py +++ b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py b/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py index 6cac1dd58f..058b0e29f2 100644 --- a/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py +++ b/lib/iris/tests/unit/analysis/interpolation/test_get_xy_dim_coords.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/test__get_dtype.py b/lib/iris/tests/unit/analysis/maths/test__get_dtype.py index 1224344188..8930502ee3 100644 --- a/lib/iris/tests/unit/analysis/maths/test__get_dtype.py +++ b/lib/iris/tests/unit/analysis/maths/test__get_dtype.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py b/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py index 34405306c2..05d15b5d90 100644 --- a/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py +++ b/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/test_add.py b/lib/iris/tests/unit/analysis/maths/test_add.py index 192556aa17..7620d67bcc 100644 --- a/lib/iris/tests/unit/analysis/maths/test_add.py +++ b/lib/iris/tests/unit/analysis/maths/test_add.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :func:`iris.analysis.maths.add` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/test_divide.py b/lib/iris/tests/unit/analysis/maths/test_divide.py index 5e26859894..36cb0eab15 100644 --- a/lib/iris/tests/unit/analysis/maths/test_divide.py +++ b/lib/iris/tests/unit/analysis/maths/test_divide.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :func:`iris.analysis.maths.divide` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/test_multiply.py b/lib/iris/tests/unit/analysis/maths/test_multiply.py index 550a04b1cd..aaf685eb73 100644 --- a/lib/iris/tests/unit/analysis/maths/test_multiply.py +++ b/lib/iris/tests/unit/analysis/maths/test_multiply.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :func:`iris.analysis.maths.multiply` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/test_subtract.py b/lib/iris/tests/unit/analysis/maths/test_subtract.py index 7d59b73840..9f333fc3b7 100644 --- a/lib/iris/tests/unit/analysis/maths/test_subtract.py +++ b/lib/iris/tests/unit/analysis/maths/test_subtract.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :func:`iris.analysis.maths.subtract` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/regrid/__init__.py b/lib/iris/tests/unit/analysis/regrid/__init__.py index 920fd84ddc..a0a0fd0a6b 100644 --- a/lib/iris/tests/unit/analysis/regrid/__init__.py +++ b/lib/iris/tests/unit/analysis/regrid/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.analysis._regrid` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py b/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py index 9fb307af23..5c01689878 100644 --- a/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py +++ b/lib/iris/tests/unit/analysis/scipy_interpolate/test__RegularGridInterpolator.py @@ -6,8 +6,6 @@ """Unit tests for the :func:`iris.analysis._scipy_interpolate._RegularGridInterpolator` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/stats/__init__.py b/lib/iris/tests/unit/analysis/stats/__init__.py index 68eb9b1b04..0b896d648d 100644 --- a/lib/iris/tests/unit/analysis/stats/__init__.py +++ b/lib/iris/tests/unit/analysis/stats/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.analysis.stats` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/test_Aggregator.py b/lib/iris/tests/unit/analysis/test_Aggregator.py index 18dc2a2d9c..5ef7b3b88c 100644 --- a/lib/iris/tests/unit/analysis/test_Aggregator.py +++ b/lib/iris/tests/unit/analysis/test_Aggregator.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.analysis.Aggregator` class instance.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_AreaWeighted.py b/lib/iris/tests/unit/analysis/test_AreaWeighted.py index eb2ef85683..caeb5298ca 100644 --- a/lib/iris/tests/unit/analysis/test_AreaWeighted.py +++ b/lib/iris/tests/unit/analysis/test_AreaWeighted.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.analysis.AreaWeighted`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_COUNT.py b/lib/iris/tests/unit/analysis/test_COUNT.py index 0f971d5a3b..8d1aec76f2 100644 --- a/lib/iris/tests/unit/analysis/test_COUNT.py +++ b/lib/iris/tests/unit/analysis/test_COUNT.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.COUNT` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_Linear.py b/lib/iris/tests/unit/analysis/test_Linear.py index cce06f227c..373dfd0286 100644 --- a/lib/iris/tests/unit/analysis/test_Linear.py +++ b/lib/iris/tests/unit/analysis/test_Linear.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.analysis.Linear`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_MAX.py b/lib/iris/tests/unit/analysis/test_MAX.py index 6e22dc52a2..2ea587e06b 100644 --- a/lib/iris/tests/unit/analysis/test_MAX.py +++ b/lib/iris/tests/unit/analysis/test_MAX.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.MAX` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_MEAN.py b/lib/iris/tests/unit/analysis/test_MEAN.py index 806b064963..64ad4ca581 100644 --- a/lib/iris/tests/unit/analysis/test_MEAN.py +++ b/lib/iris/tests/unit/analysis/test_MEAN.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.MEAN` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_MIN.py b/lib/iris/tests/unit/analysis/test_MIN.py index cd55ed3d7b..9106573914 100644 --- a/lib/iris/tests/unit/analysis/test_MIN.py +++ b/lib/iris/tests/unit/analysis/test_MIN.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.MIN` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_Nearest.py b/lib/iris/tests/unit/analysis/test_Nearest.py index ea39a2e8f5..09313c2d6c 100644 --- a/lib/iris/tests/unit/analysis/test_Nearest.py +++ b/lib/iris/tests/unit/analysis/test_Nearest.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.analysis.Nearest`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_PROPORTION.py b/lib/iris/tests/unit/analysis/test_PROPORTION.py index 95af98930a..268c2938c4 100644 --- a/lib/iris/tests/unit/analysis/test_PROPORTION.py +++ b/lib/iris/tests/unit/analysis/test_PROPORTION.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.PROPORTION` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_PercentileAggregator.py b/lib/iris/tests/unit/analysis/test_PercentileAggregator.py index 890f23d96d..2711c3601f 100644 --- a/lib/iris/tests/unit/analysis/test_PercentileAggregator.py +++ b/lib/iris/tests/unit/analysis/test_PercentileAggregator.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_PointInCell.py b/lib/iris/tests/unit/analysis/test_PointInCell.py index b7f3094faa..4acd55147a 100644 --- a/lib/iris/tests/unit/analysis/test_PointInCell.py +++ b/lib/iris/tests/unit/analysis/test_PointInCell.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.analysis.PointInCell`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_RMS.py b/lib/iris/tests/unit/analysis/test_RMS.py index fbda374eb6..1dfe6f4fb1 100644 --- a/lib/iris/tests/unit/analysis/test_RMS.py +++ b/lib/iris/tests/unit/analysis/test_RMS.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.RMS` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_STD_DEV.py b/lib/iris/tests/unit/analysis/test_STD_DEV.py index 4e4c789a9e..2750d689ba 100644 --- a/lib/iris/tests/unit/analysis/test_STD_DEV.py +++ b/lib/iris/tests/unit/analysis/test_STD_DEV.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.STD_DEV` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_SUM.py b/lib/iris/tests/unit/analysis/test_SUM.py index 01a9468dcc..a27c10716b 100644 --- a/lib/iris/tests/unit/analysis/test_SUM.py +++ b/lib/iris/tests/unit/analysis/test_SUM.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.SUM` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_VARIANCE.py b/lib/iris/tests/unit/analysis/test_VARIANCE.py index 10c9c51712..de7d14b432 100644 --- a/lib/iris/tests/unit/analysis/test_VARIANCE.py +++ b/lib/iris/tests/unit/analysis/test_VARIANCE.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :data:`iris.analysis.VARIANCE` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py b/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py index d0ea70d1c7..f6a917c05c 100644 --- a/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py +++ b/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/trajectory/__init__.py b/lib/iris/tests/unit/analysis/trajectory/__init__.py index 644be35257..55d3ebd8bc 100644 --- a/lib/iris/tests/unit/analysis/trajectory/__init__.py +++ b/lib/iris/tests/unit/analysis/trajectory/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.analysis.trajectory` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py b/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py index 56b40209eb..a557727346 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py +++ b/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py b/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py index f341bc6340..2e13133e5b 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/aux_factory/__init__.py b/lib/iris/tests/unit/aux_factory/__init__.py index 685185af4b..00b9f1a3bd 100644 --- a/lib/iris/tests/unit/aux_factory/__init__.py +++ b/lib/iris/tests/unit/aux_factory/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.aux_factory` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py b/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py index 4beb88371c..5b52593047 100644 --- a/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py +++ b/lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/aux_factory/test_HybridPressureFactory.py b/lib/iris/tests/unit/aux_factory/test_HybridPressureFactory.py index 76c202fdf3..20599f53ca 100644 --- a/lib/iris/tests/unit/aux_factory/test_HybridPressureFactory.py +++ b/lib/iris/tests/unit/aux_factory/test_HybridPressureFactory.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/aux_factory/test_OceanSFactory.py b/lib/iris/tests/unit/aux_factory/test_OceanSFactory.py index 0e94cffe04..c2b1eb2906 100644 --- a/lib/iris/tests/unit/aux_factory/test_OceanSFactory.py +++ b/lib/iris/tests/unit/aux_factory/test_OceanSFactory.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/aux_factory/test_OceanSg1Factory.py b/lib/iris/tests/unit/aux_factory/test_OceanSg1Factory.py index b08a04cea6..034b8bf8d4 100644 --- a/lib/iris/tests/unit/aux_factory/test_OceanSg1Factory.py +++ b/lib/iris/tests/unit/aux_factory/test_OceanSg1Factory.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/aux_factory/test_OceanSg2Factory.py b/lib/iris/tests/unit/aux_factory/test_OceanSg2Factory.py index 88365ccb85..19443e8653 100644 --- a/lib/iris/tests/unit/aux_factory/test_OceanSg2Factory.py +++ b/lib/iris/tests/unit/aux_factory/test_OceanSg2Factory.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/aux_factory/test_OceanSigmaFactory.py b/lib/iris/tests/unit/aux_factory/test_OceanSigmaFactory.py index 93dd5762fe..69b45cdb50 100644 --- a/lib/iris/tests/unit/aux_factory/test_OceanSigmaFactory.py +++ b/lib/iris/tests/unit/aux_factory/test_OceanSigmaFactory.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/aux_factory/test_OceanSigmaZFactory.py b/lib/iris/tests/unit/aux_factory/test_OceanSigmaZFactory.py index dfc3823355..1c72bf8ead 100644 --- a/lib/iris/tests/unit/aux_factory/test_OceanSigmaZFactory.py +++ b/lib/iris/tests/unit/aux_factory/test_OceanSigmaZFactory.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/concatenate/__init__.py b/lib/iris/tests/unit/concatenate/__init__.py index 284ee3be1a..cf671a6553 100644 --- a/lib/iris/tests/unit/concatenate/__init__.py +++ b/lib/iris/tests/unit/concatenate/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris._concatenate` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/concatenate/test__CubeSignature.py b/lib/iris/tests/unit/concatenate/test__CubeSignature.py index f33118c858..4c4b0bb65e 100644 --- a/lib/iris/tests/unit/concatenate/test__CubeSignature.py +++ b/lib/iris/tests/unit/concatenate/test__CubeSignature.py @@ -5,8 +5,6 @@ # licensing details. """Test class :class:`iris._concatenate._CubeSignature`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/config/__init__.py b/lib/iris/tests/unit/config/__init__.py index ceaf971f07..38806c7db8 100644 --- a/lib/iris/tests/unit/config/__init__.py +++ b/lib/iris/tests/unit/config/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.config` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/config/test_NetCDF.py b/lib/iris/tests/unit/config/test_NetCDF.py index 33abf6c8ad..3d2e445f83 100644 --- a/lib/iris/tests/unit/config/test_NetCDF.py +++ b/lib/iris/tests/unit/config/test_NetCDF.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.config.NetCDF` class.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/coord_categorisation/__init__.py b/lib/iris/tests/unit/coord_categorisation/__init__.py index dd2ef9fdb1..18fe8f2482 100644 --- a/lib/iris/tests/unit/coord_categorisation/__init__.py +++ b/lib/iris/tests/unit/coord_categorisation/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.coord_categorisation` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/coord_categorisation/test_add_hour.py b/lib/iris/tests/unit/coord_categorisation/test_add_hour.py index d2c0774473..3c16131401 100644 --- a/lib/iris/tests/unit/coord_categorisation/test_add_hour.py +++ b/lib/iris/tests/unit/coord_categorisation/test_add_hour.py @@ -7,8 +7,6 @@ Test coordinate categorisation function add_hour. """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_systems/__init__.py b/lib/iris/tests/unit/coord_systems/__init__.py index a2498300da..39d4d25f73 100644 --- a/lib/iris/tests/unit/coord_systems/__init__.py +++ b/lib/iris/tests/unit/coord_systems/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.coord_systems` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py b/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py index 4c238da9c8..3e68d0a629 100644 --- a/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py +++ b/lib/iris/tests/unit/coord_systems/test_AlbersEqualArea.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_systems/test_Geostationary.py b/lib/iris/tests/unit/coord_systems/test_Geostationary.py index bee4f0c132..cd8b11a2b1 100644 --- a/lib/iris/tests/unit/coord_systems/test_Geostationary.py +++ b/lib/iris/tests/unit/coord_systems/test_Geostationary.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coord_systems.Geostationary` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py b/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py index e1a5248883..42a9e2a675 100644 --- a/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py +++ b/lib/iris/tests/unit/coord_systems/test_LambertAzimuthalEqualArea.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_systems/test_Mercator.py b/lib/iris/tests/unit/coord_systems/test_Mercator.py index bca4482ba3..01491997f0 100644 --- a/lib/iris/tests/unit/coord_systems/test_Mercator.py +++ b/lib/iris/tests/unit/coord_systems/test_Mercator.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coord_systems.Mercator` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_systems/test_Orthographic.py b/lib/iris/tests/unit/coord_systems/test_Orthographic.py index 0fea64eb49..093ae91bd9 100644 --- a/lib/iris/tests/unit/coord_systems/test_Orthographic.py +++ b/lib/iris/tests/unit/coord_systems/test_Orthographic.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coord_systems.Orthographic` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_systems/test_RotatedPole.py b/lib/iris/tests/unit/coord_systems/test_RotatedPole.py index e5506c90ab..1c0ba67c4a 100644 --- a/lib/iris/tests/unit/coord_systems/test_RotatedPole.py +++ b/lib/iris/tests/unit/coord_systems/test_RotatedPole.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coord_systems.RotatedPole` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_systems/test_VerticalPerspective.py b/lib/iris/tests/unit/coord_systems/test_VerticalPerspective.py index b93701a3de..4a97d1975a 100644 --- a/lib/iris/tests/unit/coord_systems/test_VerticalPerspective.py +++ b/lib/iris/tests/unit/coord_systems/test_VerticalPerspective.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coord_systems.VerticalPerspective` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/__init__.py b/lib/iris/tests/unit/coords/__init__.py index e5f29ca220..840922ebc7 100644 --- a/lib/iris/tests/unit/coords/__init__.py +++ b/lib/iris/tests/unit/coords/__init__.py @@ -11,8 +11,6 @@ :class:`~iris.tests.unit.coords.test_DimCoord`. """ -from six.moves import (filter, input, map, range, zip) # noqa - import dask.array as da import numpy as np import numpy.ma as ma diff --git a/lib/iris/tests/unit/coords/test_AncillaryVariable.py b/lib/iris/tests/unit/coords/test_AncillaryVariable.py index b54726b046..f6fdb1cccd 100644 --- a/lib/iris/tests/unit/coords/test_AncillaryVariable.py +++ b/lib/iris/tests/unit/coords/test_AncillaryVariable.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coords.AncillaryVariable` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/test_AuxCoord.py b/lib/iris/tests/unit/coords/test_AuxCoord.py index 4658679761..c077e486f5 100644 --- a/lib/iris/tests/unit/coords/test_AuxCoord.py +++ b/lib/iris/tests/unit/coords/test_AuxCoord.py @@ -11,8 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/test_Cell.py b/lib/iris/tests/unit/coords/test_Cell.py index f339cf68fd..5dd9368f84 100644 --- a/lib/iris/tests/unit/coords/test_Cell.py +++ b/lib/iris/tests/unit/coords/test_Cell.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coords.Cell` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/test_CellMeasure.py b/lib/iris/tests/unit/coords/test_CellMeasure.py index 19a60e7b4d..8b08226a04 100644 --- a/lib/iris/tests/unit/coords/test_CellMeasure.py +++ b/lib/iris/tests/unit/coords/test_CellMeasure.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.coords.CellMeasure` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/test_CellMethod.py b/lib/iris/tests/unit/coords/test_CellMethod.py index a49b3da89f..dd7ea0b990 100644 --- a/lib/iris/tests/unit/coords/test_CellMethod.py +++ b/lib/iris/tests/unit/coords/test_CellMethod.py @@ -7,8 +7,6 @@ Unit tests for the :class:`iris.coords.CellMethod`. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/test_Coord.py b/lib/iris/tests/unit/coords/test_Coord.py index 1ca9d4de3d..4bda190ca4 100644 --- a/lib/iris/tests/unit/coords/test_Coord.py +++ b/lib/iris/tests/unit/coords/test_Coord.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :class:`iris.coords.Coord` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/test_DimCoord.py b/lib/iris/tests/unit/coords/test_DimCoord.py index 148f56ab2e..d16d380f2d 100644 --- a/lib/iris/tests/unit/coords/test_DimCoord.py +++ b/lib/iris/tests/unit/coords/test_DimCoord.py @@ -10,8 +10,6 @@ but can only be tested on concrete instances (DimCoord or AuxCoord). """ - -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/cube/__init__.py b/lib/iris/tests/unit/cube/__init__.py index c0a40891f4..7852593e21 100644 --- a/lib/iris/tests/unit/cube/__init__.py +++ b/lib/iris/tests/unit/cube/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.cube` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/cube/test_Cube__operators.py b/lib/iris/tests/unit/cube/test_Cube__operators.py index 7a4fef0863..061251434d 100644 --- a/lib/iris/tests/unit/cube/test_Cube__operators.py +++ b/lib/iris/tests/unit/cube/test_Cube__operators.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.cube.Cube` class operators.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/cube_coord_common/__init__.py b/lib/iris/tests/unit/cube_coord_common/__init__.py index 9b768c10cd..4390f95921 100644 --- a/lib/iris/tests/unit/cube_coord_common/__init__.py +++ b/lib/iris/tests/unit/cube_coord_common/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris._cube_coord_common` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py b/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py index b34eccaa9f..f095afaf41 100644 --- a/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py +++ b/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py @@ -7,8 +7,6 @@ Unit tests for the :class:`iris._cube_coord_common.CFVariableMixin`. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py b/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py index 8232202455..87aca5ddef 100644 --- a/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py +++ b/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/data_manager/__init__.py b/lib/iris/tests/unit/data_manager/__init__.py index 0728d2f9d9..41dcc0adf3 100644 --- a/lib/iris/tests/unit/data_manager/__init__.py +++ b/lib/iris/tests/unit/data_manager/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris._data_manager` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/data_manager/test_DataManager.py b/lib/iris/tests/unit/data_manager/test_DataManager.py index 0bdcbfcff9..3617674228 100644 --- a/lib/iris/tests/unit/data_manager/test_DataManager.py +++ b/lib/iris/tests/unit/data_manager/test_DataManager.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/experimental/__init__.py b/lib/iris/tests/unit/experimental/__init__.py index 2df67beadb..438827bab2 100644 --- a/lib/iris/tests/unit/experimental/__init__.py +++ b/lib/iris/tests/unit/experimental/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.experimental` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/experimental/equalise_cubes/__init__.py b/lib/iris/tests/unit/experimental/equalise_cubes/__init__.py index b0101c31d6..5d470b347b 100644 --- a/lib/iris/tests/unit/experimental/equalise_cubes/__init__.py +++ b/lib/iris/tests/unit/experimental/equalise_cubes/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.experimental.equalise_cubes` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/experimental/raster/__init__.py b/lib/iris/tests/unit/experimental/raster/__init__.py index 57e8133918..5f85d810c9 100644 --- a/lib/iris/tests/unit/experimental/raster/__init__.py +++ b/lib/iris/tests/unit/experimental/raster/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.experimental.raster` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/experimental/raster/test_export_geotiff.py b/lib/iris/tests/unit/experimental/raster/test_export_geotiff.py index 969d55c09a..f2ce456233 100644 --- a/lib/iris/tests/unit/experimental/raster/test_export_geotiff.py +++ b/lib/iris/tests/unit/experimental/raster/test_export_geotiff.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.experimental.raster.export_geotiff` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/experimental/regrid/__init__.py b/lib/iris/tests/unit/experimental/regrid/__init__.py index 3a55d4c39d..578c15f11c 100644 --- a/lib/iris/tests/unit/experimental/regrid/__init__.py +++ b/lib/iris/tests/unit/experimental/regrid/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.experimental.regrid` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py b/lib/iris/tests/unit/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py index 724a7bbb37..8acbca7e78 100644 --- a/lib/iris/tests/unit/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py +++ b/lib/iris/tests/unit/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/experimental/representation/__init__.py b/lib/iris/tests/unit/experimental/representation/__init__.py index fa3f45443e..c856263a5c 100644 --- a/lib/iris/tests/unit/experimental/representation/__init__.py +++ b/lib/iris/tests/unit/experimental/representation/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.experimental.representation` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/experimental/stratify/__init__.py b/lib/iris/tests/unit/experimental/stratify/__init__.py index 9bcdff02bc..7218455e76 100644 --- a/lib/iris/tests/unit/experimental/stratify/__init__.py +++ b/lib/iris/tests/unit/experimental/stratify/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.experimental.stratify` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/experimental/stratify/test_relevel.py b/lib/iris/tests/unit/experimental/stratify/test_relevel.py index 5b9b4fd3a6..ec51cdd8c6 100644 --- a/lib/iris/tests/unit/experimental/stratify/test_relevel.py +++ b/lib/iris/tests/unit/experimental/stratify/test_relevel.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/__init__.py b/lib/iris/tests/unit/fileformats/__init__.py index d13d670566..8ba2c435b2 100644 --- a/lib/iris/tests/unit/fileformats/__init__.py +++ b/lib/iris/tests/unit/fileformats/__init__.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :mod:`iris.fileformats` package.""" -from six.moves import (filter, input, map, range, zip) # noqa - import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/abf/__init__.py b/lib/iris/tests/unit/fileformats/abf/__init__.py index ce6fdd97a3..aaddf427c5 100644 --- a/lib/iris/tests/unit/fileformats/abf/__init__.py +++ b/lib/iris/tests/unit/fileformats/abf/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.abf` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/abf/test_ABFField.py b/lib/iris/tests/unit/fileformats/abf/test_ABFField.py index 87641d72a5..56d45fd031 100644 --- a/lib/iris/tests/unit/fileformats/abf/test_ABFField.py +++ b/lib/iris/tests/unit/fileformats/abf/test_ABFField.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.abf.ABFField` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/cf/__init__.py b/lib/iris/tests/unit/fileformats/cf/__init__.py index 665cd211c9..1bff79368b 100644 --- a/lib/iris/tests/unit/fileformats/cf/__init__.py +++ b/lib/iris/tests/unit/fileformats/cf/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.cf` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/dot/__init__.py b/lib/iris/tests/unit/fileformats/dot/__init__.py index 1fe028756a..0dbc3ad4c6 100644 --- a/lib/iris/tests/unit/fileformats/dot/__init__.py +++ b/lib/iris/tests/unit/fileformats/dot/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for :mod:`iris.fileformats.dot`.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/dot/test__dot_path.py b/lib/iris/tests/unit/fileformats/dot/test__dot_path.py index b960b34476..a41937bf8a 100644 --- a/lib/iris/tests/unit/fileformats/dot/test__dot_path.py +++ b/lib/iris/tests/unit/fileformats/dot/test__dot_path.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :func:`iris.fileformats.dot._dot_path`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/ff/__init__.py b/lib/iris/tests/unit/fileformats/ff/__init__.py index 769427bc02..4d13a18520 100644 --- a/lib/iris/tests/unit/fileformats/ff/__init__.py +++ b/lib/iris/tests/unit/fileformats/ff/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.ff` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/ff/test_ArakawaC.py b/lib/iris/tests/unit/fileformats/ff/test_ArakawaC.py index e5e3681175..cc76fcc81e 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_ArakawaC.py +++ b/lib/iris/tests/unit/fileformats/ff/test_ArakawaC.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.fileformat.ff.ArakawaC`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/ff/test_ENDGame.py b/lib/iris/tests/unit/fileformats/ff/test_ENDGame.py index 7930a50ed5..417fef4d66 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_ENDGame.py +++ b/lib/iris/tests/unit/fileformats/ff/test_ENDGame.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.fileformat.ff.ENDGame`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/ff/test_FFHeader.py b/lib/iris/tests/unit/fileformats/ff/test_FFHeader.py index 9239f016c5..a2148f12d6 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_FFHeader.py +++ b/lib/iris/tests/unit/fileformats/ff/test_FFHeader.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.fileformat.ff.FFHeader`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/ff/test_Grid.py b/lib/iris/tests/unit/fileformats/ff/test_Grid.py index e935e336ca..6ae172c72a 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_Grid.py +++ b/lib/iris/tests/unit/fileformats/ff/test_Grid.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.fileformat.ff.Grid`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/ff/test_NewDynamics.py b/lib/iris/tests/unit/fileformats/ff/test_NewDynamics.py index 855bdbbfc8..7498158cf3 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_NewDynamics.py +++ b/lib/iris/tests/unit/fileformats/ff/test_NewDynamics.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.fileformat.ff.NewDynamics`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/name_loaders/__init__.py b/lib/iris/tests/unit/fileformats/name_loaders/__init__.py index fede7b578f..751801a176 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/__init__.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.name_loaders` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py b/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py index dfacf1c631..7068f2ae1e 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__build_cell_methods.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py b/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py index 8af40ff1d4..f07f0b626e 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__calc_integration_period.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__cf_height_from_name.py b/lib/iris/tests/unit/fileformats/name_loaders/test__cf_height_from_name.py index 151e003f8a..efb219a9c1 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__cf_height_from_name.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__cf_height_from_name.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/__init__.py b/lib/iris/tests/unit/fileformats/netcdf/__init__.py index 71f6d68a68..732094f67a 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/__init__.py +++ b/lib/iris/tests/unit/fileformats/netcdf/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.netcdf` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py index f52365aa25..e37086abbb 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.netcdf.Saver` class.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/netcdf/test__get_cf_var_data.py b/lib/iris/tests/unit/fileformats/netcdf/test__get_cf_var_data.py index 835f431556..bddec20f2e 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test__get_cf_var_data.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test__get_cf_var_data.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.netcdf._get_cf_var_data` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test__load_aux_factory.py b/lib/iris/tests/unit/fileformats/netcdf/test__load_aux_factory.py index 179dcc913c..0aae63620a 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test__load_aux_factory.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test__load_aux_factory.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.netcdf._load_aux_factory` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_parse_cell_methods.py b/lib/iris/tests/unit/fileformats/netcdf/test_parse_cell_methods.py index 37610648ca..47626c891e 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_parse_cell_methods.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_parse_cell_methods.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/nimrod_load_rules/__init__.py b/lib/iris/tests/unit/fileformats/nimrod_load_rules/__init__.py index aa3184d128..429ee9ce1f 100644 --- a/lib/iris/tests/unit/fileformats/nimrod_load_rules/__init__.py +++ b/lib/iris/tests/unit/fileformats/nimrod_load_rules/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.nimrod_load_rules` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_tm_meridian_scaling.py b/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_tm_meridian_scaling.py index 6d09c472f6..25354881bb 100644 --- a/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_tm_meridian_scaling.py +++ b/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_tm_meridian_scaling.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_vertical_coord.py b/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_vertical_coord.py index 0be17e6ab2..363569142b 100644 --- a/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_vertical_coord.py +++ b/lib/iris/tests/unit/fileformats/nimrod_load_rules/test_vertical_coord.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/__init__.py b/lib/iris/tests/unit/fileformats/pp/__init__.py index 54084efdeb..f309b6848a 100644 --- a/lib/iris/tests/unit/fileformats/pp/__init__.py +++ b/lib/iris/tests/unit/fileformats/pp/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.pp` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/pp/test_PPDataProxy.py b/lib/iris/tests/unit/fileformats/pp/test_PPDataProxy.py index 47b1bded9a..b91c0af7b7 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_PPDataProxy.py +++ b/lib/iris/tests/unit/fileformats/pp/test_PPDataProxy.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp.PPDataProxy` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test_PPField.py b/lib/iris/tests/unit/fileformats/pp/test_PPField.py index 895bb84f3b..95cbce8a2e 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_PPField.py +++ b/lib/iris/tests/unit/fileformats/pp/test_PPField.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp.PPField` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test__convert_constraints.py b/lib/iris/tests/unit/fileformats/pp/test__convert_constraints.py index d96c58f874..cb56bec4fd 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__convert_constraints.py +++ b/lib/iris/tests/unit/fileformats/pp/test__convert_constraints.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp.load` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test__create_field_data.py b/lib/iris/tests/unit/fileformats/pp/test__create_field_data.py index 2c7f0f9bb3..7668c510f0 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__create_field_data.py +++ b/lib/iris/tests/unit/fileformats/pp/test__create_field_data.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp._create_field_data` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py b/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py index b3cea6786f..9da22fa051 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py +++ b/lib/iris/tests/unit/fileformats/pp/test__data_bytes_to_shaped_array.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py index 7d29026718..034a5cecd7 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py +++ b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.pp._field_gen` function.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/pp/test__interpret_field.py b/lib/iris/tests/unit/fileformats/pp/test__interpret_field.py index 0e4e19eca2..adc3430693 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__interpret_field.py +++ b/lib/iris/tests/unit/fileformats/pp/test__interpret_field.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp._interpret_field` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test_as_fields.py b/lib/iris/tests/unit/fileformats/pp/test_as_fields.py index 30a1cf07bb..25641a3f08 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_as_fields.py +++ b/lib/iris/tests/unit/fileformats/pp/test_as_fields.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp.as_fields` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test_load.py b/lib/iris/tests/unit/fileformats/pp/test_load.py index f558ec0714..71a52a13c1 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_load.py +++ b/lib/iris/tests/unit/fileformats/pp/test_load.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp.load` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp/test_save.py b/lib/iris/tests/unit/fileformats/pp/test_save.py index bb1fec5648..f285764ec1 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_save.py +++ b/lib/iris/tests/unit/fileformats/pp/test_save.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp.save` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - import cftime import cf_units diff --git a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py index 75e6ab0c58..a9df529e2e 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py +++ b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.pp.save_fields` function.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/pp/test_save_pairs_from_cube.py b/lib/iris/tests/unit/fileformats/pp/test_save_pairs_from_cube.py index 20c796ec62..2a2eed588c 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_save_pairs_from_cube.py +++ b/lib/iris/tests/unit/fileformats/pp/test_save_pairs_from_cube.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.fileformats.pp.save_pairs_from_cube` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py b/lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py index fd34c23437..70d28f7c09 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.pp_load_rules` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa 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 6e491d0c30..cd2e067498 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 @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__collapse_degenerate_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__collapse_degenerate_points_and_bounds.py index 5c8c13f6eb..d1bd52c9a7 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__collapse_degenerate_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__collapse_degenerate_points_and_bounds.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_pseudo_level_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_pseudo_level_coords.py index 1fe36c6c34..7082d00d43 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_pseudo_level_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_pseudo_level_coords.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py index 6454ab75d6..01a52c85e1 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_scalar_realization_coords.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py index 215b217bb2..32a3d1477b 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py index 02006fa277..b088ecd528 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py @@ -8,8 +8,6 @@ :func:`iris.fileformats.pp_load_rules._epoch_date_hours`. """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reduced_points_and_bounds.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reduced_points_and_bounds.py index 63dff23c7b..65ad79fcda 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reduced_points_and_bounds.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reduced_points_and_bounds.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/__init__.py b/lib/iris/tests/unit/fileformats/pyke_rules/__init__.py index 2c7385a984..71d129e4a7 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/__init__.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats._pyke_rules` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/__init__.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/__init__.py index 2b6ca01683..a8093f5c8c 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/__init__.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/__init__.py @@ -7,5 +7,3 @@ Unit tests for the :mod:`iris.fileformats._pyke_rules.compiled_krb` module. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/__init__.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/__init__.py index a29fc9dfa1..ae709e85e1 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/__init__.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.fc_rules_cf_fc` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_auxiliary_coordinate.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_auxiliary_coordinate.py index d45592a34a..70d72fb133 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_auxiliary_coordinate.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_auxiliary_coordinate.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_cube_metadata.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_cube_metadata.py index 05a65e977b..7f6ecb27c2 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_cube_metadata.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_cube_metadata.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_dimension_coordinate.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_dimension_coordinate.py index 02266330e8..37af34c8b8 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_dimension_coordinate.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_dimension_coordinate.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_geostationary_coordinate_system.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_geostationary_coordinate_system.py index 5a911644b1..bb045769d8 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_geostationary_coordinate_system.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_geostationary_coordinate_system.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_mercator_coordinate_system.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_mercator_coordinate_system.py index bf57ff13c8..2f02c71c9c 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_mercator_coordinate_system.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_mercator_coordinate_system.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_stereographic_coordinate_system.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_stereographic_coordinate_system.py index fe3dda9a3b..8912614f96 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_stereographic_coordinate_system.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_stereographic_coordinate_system.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_verticalp_coordinate_system.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_verticalp_coordinate_system.py index 107141896c..d06e93e0ab 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_verticalp_coordinate_system.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_verticalp_coordinate_system.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_attr_units.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_attr_units.py index d39e729fab..c5e36e8d8e 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_attr_units.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_attr_units.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_cf_bounds_var.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_cf_bounds_var.py index df32813535..547683922d 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_cf_bounds_var.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_cf_bounds_var.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_names.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_names.py index f676ab920b..c94d9ac02c 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_names.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_names.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py index 149856a4a1..74a2643246 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py @@ -8,8 +8,6 @@ fc_rules_cf_fc.has_supported_mercator_parameters`. """ - -from six.moves import (filter, input, map, range, zip) # noqa import warnings # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py index 1b56c25074..7e075abdab 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py @@ -8,8 +8,6 @@ fc_rules_cf_fc.has_supported_stereographic_parameters`. """ - -from six.moves import (filter, input, map, range, zip) # noqa import warnings # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py index af3d2760da..3d7ddcb253 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/rules/__init__.py b/lib/iris/tests/unit/fileformats/rules/__init__.py index e971967006..55c9c7779e 100644 --- a/lib/iris/tests/unit/fileformats/rules/__init__.py +++ b/lib/iris/tests/unit/fileformats/rules/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.fileformats.rules` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/rules/test_Loader.py b/lib/iris/tests/unit/fileformats/rules/test_Loader.py index 7f6b3dc41e..ac9119833f 100644 --- a/lib/iris/tests/unit/fileformats/rules/test_Loader.py +++ b/lib/iris/tests/unit/fileformats/rules/test_Loader.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :class:`iris.fileformats.rules.Loader`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/rules/test__make_cube.py b/lib/iris/tests/unit/fileformats/rules/test__make_cube.py index 5abdb6cf79..156e585bc3 100644 --- a/lib/iris/tests/unit/fileformats/rules/test__make_cube.py +++ b/lib/iris/tests/unit/fileformats/rules/test__make_cube.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :func:`iris.fileformats.rules._make_cube`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/structured_array_identification/__init__.py b/lib/iris/tests/unit/fileformats/structured_array_identification/__init__.py index daf2ada7e6..c703284fc0 100644 --- a/lib/iris/tests/unit/fileformats/structured_array_identification/__init__.py +++ b/lib/iris/tests/unit/fileformats/structured_array_identification/__init__.py @@ -8,5 +8,3 @@ :mod:`iris.fileformats._structured_array_identification` module. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/um/__init__.py b/lib/iris/tests/unit/fileformats/um/__init__.py index 6072b37250..6b4abc61bb 100644 --- a/lib/iris/tests/unit/fileformats/um/__init__.py +++ b/lib/iris/tests/unit/fileformats/um/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.um` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py b/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py index 8f3d79a26e..b5eb259e5b 100644 --- a/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py +++ b/lib/iris/tests/unit/fileformats/um/fast_load/__init__.py @@ -7,5 +7,3 @@ Unit tests for the module :mod:`iris.fileformats.um._fast_load`. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/um/fast_load/test_FieldCollation.py b/lib/iris/tests/unit/fileformats/um/fast_load/test_FieldCollation.py index 8c91de9ab3..fd95e47865 100644 --- a/lib/iris/tests/unit/fileformats/um/fast_load/test_FieldCollation.py +++ b/lib/iris/tests/unit/fileformats/um/fast_load/test_FieldCollation.py @@ -13,8 +13,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/um/fast_load/test__convert_collation.py b/lib/iris/tests/unit/fileformats/um/fast_load/test__convert_collation.py index 06f62b6e3b..88c6df8c70 100644 --- a/lib/iris/tests/unit/fileformats/um/fast_load/test__convert_collation.py +++ b/lib/iris/tests/unit/fileformats/um/fast_load/test__convert_collation.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :func:`iris.fileformats.um._fast_load._convert_collation`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/__init__.py b/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/__init__.py index 6eb1ee5a99..f0932c3ac8 100644 --- a/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/__init__.py +++ b/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/__init__.py @@ -8,5 +8,3 @@ :mod:`iris.fileformats.um._fast_load_structured_fields`. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_BasicFieldCollation.py b/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_BasicFieldCollation.py index c36674bd97..cef59f8b25 100644 --- a/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_BasicFieldCollation.py +++ b/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_BasicFieldCollation.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/__init__.py b/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/__init__.py index d909df57b9..8070719de8 100644 --- a/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/__init__.py +++ b/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/__init__.py @@ -8,5 +8,3 @@ :mod:`iris.fileformats.um._optimal_array_structuring`. """ - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py b/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py index da1aaa0598..3d06739999 100644 --- a/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py +++ b/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/um/test_um_to_pp.py b/lib/iris/tests/unit/fileformats/um/test_um_to_pp.py index f8acdf82ff..4463bb0249 100644 --- a/lib/iris/tests/unit/fileformats/um/test_um_to_pp.py +++ b/lib/iris/tests/unit/fileformats/um/test_um_to_pp.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/io/__init__.py b/lib/iris/tests/unit/io/__init__.py index 5388d79428..5e347c9ebc 100644 --- a/lib/iris/tests/unit/io/__init__.py +++ b/lib/iris/tests/unit/io/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.io` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/io/test_expand_filespecs.py b/lib/iris/tests/unit/io/test_expand_filespecs.py index 47a9f9b687..d2b3f5c27d 100644 --- a/lib/iris/tests/unit/io/test_expand_filespecs.py +++ b/lib/iris/tests/unit/io/test_expand_filespecs.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.io.expand_filespecs` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/io/test_run_callback.py b/lib/iris/tests/unit/io/test_run_callback.py index b771f59600..3ff61499f3 100644 --- a/lib/iris/tests/unit/io/test_run_callback.py +++ b/lib/iris/tests/unit/io/test_run_callback.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.io.run_callback` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/lazy_data/__init__.py b/lib/iris/tests/unit/lazy_data/__init__.py index 7e685f5635..b463897c50 100644 --- a/lib/iris/tests/unit/lazy_data/__init__.py +++ b/lib/iris/tests/unit/lazy_data/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris._lazy_data` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py b/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py index 3ab06c4b16..ca81eab4e6 100644 --- a/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py +++ b/lib/iris/tests/unit/lazy_data/test_as_concrete_data.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris._lazy data.as_concrete_data`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/lazy_data/test_as_lazy_data.py b/lib/iris/tests/unit/lazy_data/test_as_lazy_data.py index 1205325a16..163ac19d83 100644 --- a/lib/iris/tests/unit/lazy_data/test_as_lazy_data.py +++ b/lib/iris/tests/unit/lazy_data/test_as_lazy_data.py @@ -5,8 +5,6 @@ # licensing details. """Test the function :func:`iris._lazy data.as_lazy_data`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/lazy_data/test_co_realise_cubes.py b/lib/iris/tests/unit/lazy_data/test_co_realise_cubes.py index d3881aa78c..a183ec2950 100644 --- a/lib/iris/tests/unit/lazy_data/test_co_realise_cubes.py +++ b/lib/iris/tests/unit/lazy_data/test_co_realise_cubes.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris._lazy data.co_realise_cubes`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/lazy_data/test_is_lazy_data.py b/lib/iris/tests/unit/lazy_data/test_is_lazy_data.py index dd9966befb..94f325f5fe 100644 --- a/lib/iris/tests/unit/lazy_data/test_is_lazy_data.py +++ b/lib/iris/tests/unit/lazy_data/test_is_lazy_data.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris._lazy data.is_lazy_data`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/lazy_data/test_lazy_elementwise.py b/lib/iris/tests/unit/lazy_data/test_lazy_elementwise.py index 64c413b6fe..d512870170 100644 --- a/lib/iris/tests/unit/lazy_data/test_lazy_elementwise.py +++ b/lib/iris/tests/unit/lazy_data/test_lazy_elementwise.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris._lazy data.lazy_elementwise`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/lazy_data/test_multidim_lazy_stack.py b/lib/iris/tests/unit/lazy_data/test_multidim_lazy_stack.py index 532247994b..ad4d27143f 100644 --- a/lib/iris/tests/unit/lazy_data/test_multidim_lazy_stack.py +++ b/lib/iris/tests/unit/lazy_data/test_multidim_lazy_stack.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris._lazy data.multidim_lazy_stack`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/lazy_data/test_non_lazy.py b/lib/iris/tests/unit/lazy_data/test_non_lazy.py index c31cb5b3d3..6540c56c1e 100644 --- a/lib/iris/tests/unit/lazy_data/test_non_lazy.py +++ b/lib/iris/tests/unit/lazy_data/test_non_lazy.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris._lazy data.non_lazy`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/merge/__init__.py b/lib/iris/tests/unit/merge/__init__.py index cf6010325a..c3ead61576 100644 --- a/lib/iris/tests/unit/merge/__init__.py +++ b/lib/iris/tests/unit/merge/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris._merge` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/merge/test_ProtoCube.py b/lib/iris/tests/unit/merge/test_ProtoCube.py index bba214ba5c..b9b1d08063 100644 --- a/lib/iris/tests/unit/merge/test_ProtoCube.py +++ b/lib/iris/tests/unit/merge/test_ProtoCube.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris._merge.ProtoCube` class.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/plot/_blockplot_common.py b/lib/iris/tests/unit/plot/_blockplot_common.py index 78ee111063..8fd3974e80 100644 --- a/lib/iris/tests/unit/plot/_blockplot_common.py +++ b/lib/iris/tests/unit/plot/_blockplot_common.py @@ -5,8 +5,6 @@ # licensing details. """Common test code for `iris.plot.pcolor` and `iris.plot.pcolormesh`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py b/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py index ab967447cd..7d7b95933f 100644 --- a/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py +++ b/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py @@ -6,8 +6,6 @@ """Unit tests for the `iris.plot._check_bounds_contiguity_and_mask` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py b/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py index 8a97746476..073b6eb011 100644 --- a/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py +++ b/lib/iris/tests/unit/plot/test__check_geostationary_coords_and_convert.py @@ -6,8 +6,6 @@ """Unit tests for the `iris.plot._check_geostationary_coords_and_convert function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test__fixup_dates.py b/lib/iris/tests/unit/plot/test__fixup_dates.py index 446eac4bca..8dd0027f98 100644 --- a/lib/iris/tests/unit/plot/test__fixup_dates.py +++ b/lib/iris/tests/unit/plot/test__fixup_dates.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot._fixup_dates` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test__get_plot_defn.py b/lib/iris/tests/unit/plot/test__get_plot_defn.py index 9df1baa782..41ba6cfa06 100644 --- a/lib/iris/tests/unit/plot/test__get_plot_defn.py +++ b/lib/iris/tests/unit/plot/test__get_plot_defn.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot._get_plot_defn` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py index 519dc667ef..cc72650af5 100644 --- a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py +++ b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py @@ -7,8 +7,6 @@ function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_contour.py b/lib/iris/tests/unit/plot/test_contour.py index 6d48803843..6c041015be 100644 --- a/lib/iris/tests/unit/plot/test_contour.py +++ b/lib/iris/tests/unit/plot/test_contour.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.contour` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_contourf.py b/lib/iris/tests/unit/plot/test_contourf.py index 1037665ad9..5c2e81a466 100644 --- a/lib/iris/tests/unit/plot/test_contourf.py +++ b/lib/iris/tests/unit/plot/test_contourf.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.contourf` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_outline.py b/lib/iris/tests/unit/plot/test_outline.py index 910c2bd4a4..aca87166ab 100644 --- a/lib/iris/tests/unit/plot/test_outline.py +++ b/lib/iris/tests/unit/plot/test_outline.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.outline` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_pcolor.py b/lib/iris/tests/unit/plot/test_pcolor.py index 8882e04d3b..2e84acdff5 100644 --- a/lib/iris/tests/unit/plot/test_pcolor.py +++ b/lib/iris/tests/unit/plot/test_pcolor.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.pcolor` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_pcolormesh.py b/lib/iris/tests/unit/plot/test_pcolormesh.py index 7883eec14d..cceab75293 100644 --- a/lib/iris/tests/unit/plot/test_pcolormesh.py +++ b/lib/iris/tests/unit/plot/test_pcolormesh.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.pcolormesh` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_plot.py b/lib/iris/tests/unit/plot/test_plot.py index ca3f85ec28..9898f7eca5 100644 --- a/lib/iris/tests/unit/plot/test_plot.py +++ b/lib/iris/tests/unit/plot/test_plot.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.plot` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_points.py b/lib/iris/tests/unit/plot/test_points.py index d2e8018610..12d5bc5388 100644 --- a/lib/iris/tests/unit/plot/test_points.py +++ b/lib/iris/tests/unit/plot/test_points.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.points` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test_scatter.py b/lib/iris/tests/unit/plot/test_scatter.py index 93f2bb4810..634c9f2b6d 100644 --- a/lib/iris/tests/unit/plot/test_scatter.py +++ b/lib/iris/tests/unit/plot/test_scatter.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.plot.scatter` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/__init__.py b/lib/iris/tests/unit/quickplot/__init__.py index 7c4facba87..471ef0f6a5 100644 --- a/lib/iris/tests/unit/quickplot/__init__.py +++ b/lib/iris/tests/unit/quickplot/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.quickplot` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/quickplot/test_contour.py b/lib/iris/tests/unit/quickplot/test_contour.py index a41f4f79c2..9027010bce 100644 --- a/lib/iris/tests/unit/quickplot/test_contour.py +++ b/lib/iris/tests/unit/quickplot/test_contour.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.contour` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/test_contourf.py b/lib/iris/tests/unit/quickplot/test_contourf.py index e96ae8e0d2..ff8bf4d12c 100644 --- a/lib/iris/tests/unit/quickplot/test_contourf.py +++ b/lib/iris/tests/unit/quickplot/test_contourf.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.contourf` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/test_outline.py b/lib/iris/tests/unit/quickplot/test_outline.py index 3335423b47..f42c5e0fa3 100644 --- a/lib/iris/tests/unit/quickplot/test_outline.py +++ b/lib/iris/tests/unit/quickplot/test_outline.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.outline` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/test_pcolor.py b/lib/iris/tests/unit/quickplot/test_pcolor.py index c653abb143..77eb218aeb 100644 --- a/lib/iris/tests/unit/quickplot/test_pcolor.py +++ b/lib/iris/tests/unit/quickplot/test_pcolor.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.pcolor` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/test_pcolormesh.py b/lib/iris/tests/unit/quickplot/test_pcolormesh.py index f0c602e83e..53704d8c10 100644 --- a/lib/iris/tests/unit/quickplot/test_pcolormesh.py +++ b/lib/iris/tests/unit/quickplot/test_pcolormesh.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.pcolormesh` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/test_plot.py b/lib/iris/tests/unit/quickplot/test_plot.py index 3b5bf17a72..3e81636a2c 100644 --- a/lib/iris/tests/unit/quickplot/test_plot.py +++ b/lib/iris/tests/unit/quickplot/test_plot.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.plot` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/test_points.py b/lib/iris/tests/unit/quickplot/test_points.py index 355f135c5a..032b932dce 100644 --- a/lib/iris/tests/unit/quickplot/test_points.py +++ b/lib/iris/tests/unit/quickplot/test_points.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.points` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/quickplot/test_scatter.py b/lib/iris/tests/unit/quickplot/test_scatter.py index 45afbf6f07..ff5b5192f1 100644 --- a/lib/iris/tests/unit/quickplot/test_scatter.py +++ b/lib/iris/tests/unit/quickplot/test_scatter.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.quickplot.scatter` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/test_Future.py b/lib/iris/tests/unit/test_Future.py index 1c5342ba09..2fb8925c34 100644 --- a/lib/iris/tests/unit/test_Future.py +++ b/lib/iris/tests/unit/test_Future.py @@ -5,8 +5,12 @@ # licensing details. """Unit tests for the `iris.Future` class.""" +<<<<<<< HEAD import six from six.moves import (filter, input, map, range, zip) # noqa +======= +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed unused six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/test_sample_data_path.py b/lib/iris/tests/unit/test_sample_data_path.py index 7caf27e938..21578ebeba 100644 --- a/lib/iris/tests/unit/test_sample_data_path.py +++ b/lib/iris/tests/unit/test_sample_data_path.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :func:`iris.sample_data_path` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/tests/__init__.py b/lib/iris/tests/unit/tests/__init__.py index e07177d798..b8d27d34d3 100644 --- a/lib/iris/tests/unit/tests/__init__.py +++ b/lib/iris/tests/unit/tests/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.tests` package.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/tests/test_IrisTest.py b/lib/iris/tests/unit/tests/test_IrisTest.py index ba8c6f05a2..30b1ca83f9 100644 --- a/lib/iris/tests/unit/tests/test_IrisTest.py +++ b/lib/iris/tests/unit/tests/test_IrisTest.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.tests.IrisTest` class.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/util/__init__.py b/lib/iris/tests/unit/util/__init__.py index 11315d4f40..9aed566a19 100644 --- a/lib/iris/tests/unit/util/__init__.py +++ b/lib/iris/tests/unit/util/__init__.py @@ -4,5 +4,3 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.util` module.""" - -from six.moves import (filter, input, map, range, zip) # noqa diff --git a/lib/iris/tests/unit/util/test__coord_regular.py b/lib/iris/tests/unit/util/test__coord_regular.py index fb075873bf..8efd5cc748 100644 --- a/lib/iris/tests/unit/util/test__coord_regular.py +++ b/lib/iris/tests/unit/util/test__coord_regular.py @@ -13,8 +13,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa -import six # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/util/test__is_circular.py b/lib/iris/tests/unit/util/test__is_circular.py index 7e72165829..c63894ffec 100644 --- a/lib/iris/tests/unit/util/test__is_circular.py +++ b/lib/iris/tests/unit/util/test__is_circular.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util._is_circular`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_array_equal.py b/lib/iris/tests/unit/util/test_array_equal.py index 4b40d04196..ed8953dfd0 100644 --- a/lib/iris/tests/unit/util/test_array_equal.py +++ b/lib/iris/tests/unit/util/test_array_equal.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.array_equal`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_column_slices_generator.py b/lib/iris/tests/unit/util/test_column_slices_generator.py index 5f7343ca43..1d87c42d17 100644 --- a/lib/iris/tests/unit/util/test_column_slices_generator.py +++ b/lib/iris/tests/unit/util/test_column_slices_generator.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.column_slices_generator`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_demote_dim_coord_to_aux_coord.py b/lib/iris/tests/unit/util/test_demote_dim_coord_to_aux_coord.py index 3fcf30c4a6..3bd2c256aa 100644 --- a/lib/iris/tests/unit/util/test_demote_dim_coord_to_aux_coord.py +++ b/lib/iris/tests/unit/util/test_demote_dim_coord_to_aux_coord.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.demote_dim_coord_to_aux_coord`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_describe_diff.py b/lib/iris/tests/unit/util/test_describe_diff.py index 66dfd1750a..a50886873d 100644 --- a/lib/iris/tests/unit/util/test_describe_diff.py +++ b/lib/iris/tests/unit/util/test_describe_diff.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Test function :func:`iris.util.describe_diff`.""" - -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/util/test_file_is_newer_than.py b/lib/iris/tests/unit/util/test_file_is_newer_than.py index c86fa82cf8..aba4296ef5 100644 --- a/lib/iris/tests/unit/util/test_file_is_newer_than.py +++ b/lib/iris/tests/unit/util/test_file_is_newer_than.py @@ -7,8 +7,6 @@ Test function :func:`iris.util.test_file_is_newer`. """ - -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/util/test_find_discontiguities.py b/lib/iris/tests/unit/util/test_find_discontiguities.py index 691a375926..90f12675fc 100644 --- a/lib/iris/tests/unit/util/test_find_discontiguities.py +++ b/lib/iris/tests/unit/util/test_find_discontiguities.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.find_discontiguities""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_mask_cube.py b/lib/iris/tests/unit/util/test_mask_cube.py index 1ad0e1de53..96fb62e29d 100644 --- a/lib/iris/tests/unit/util/test_mask_cube.py +++ b/lib/iris/tests/unit/util/test_mask_cube.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.mask_cube""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_promote_aux_coord_to_dim_coord.py b/lib/iris/tests/unit/util/test_promote_aux_coord_to_dim_coord.py index c2dce5b6f6..66e6710aa0 100644 --- a/lib/iris/tests/unit/util/test_promote_aux_coord_to_dim_coord.py +++ b/lib/iris/tests/unit/util/test_promote_aux_coord_to_dim_coord.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.promote_aux_coord_to_dim_coord`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_reverse.py b/lib/iris/tests/unit/util/test_reverse.py index 750862ccbd..bfe0a8eded 100644 --- a/lib/iris/tests/unit/util/test_reverse.py +++ b/lib/iris/tests/unit/util/test_reverse.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.reverse`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_rolling_window.py b/lib/iris/tests/unit/util/test_rolling_window.py index 03910ae9b6..18a64a0920 100644 --- a/lib/iris/tests/unit/util/test_rolling_window.py +++ b/lib/iris/tests/unit/util/test_rolling_window.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.rolling_window`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_squeeze.py b/lib/iris/tests/unit/util/test_squeeze.py index 9e707c407f..3ed03781bc 100644 --- a/lib/iris/tests/unit/util/test_squeeze.py +++ b/lib/iris/tests/unit/util/test_squeeze.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.squeeze`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_unify_time_units.py b/lib/iris/tests/unit/util/test_unify_time_units.py index b7230974e9..920d5e2780 100644 --- a/lib/iris/tests/unit/util/test_unify_time_units.py +++ b/lib/iris/tests/unit/util/test_unify_time_units.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.array_equal`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/time.py b/lib/iris/time.py index 8376d4bb3b..38e1366007 100644 --- a/lib/iris/time.py +++ b/lib/iris/time.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - import functools diff --git a/tools/gen_helpers.py b/tools/gen_helpers.py index 79164adfc7..825c78139e 100644 --- a/tools/gen_helpers.py +++ b/tools/gen_helpers.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - from datetime import datetime import os import os.path diff --git a/tools/gen_stash_refs.py b/tools/gen_stash_refs.py index 4aea8fd3cf..5e52a66365 100644 --- a/tools/gen_stash_refs.py +++ b/tools/gen_stash_refs.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - import json import urllib import urllib2 diff --git a/tools/gen_translations.py b/tools/gen_translations.py index 1902bab9b0..5c0c2c8332 100644 --- a/tools/gen_translations.py +++ b/tools/gen_translations.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - from datetime import datetime import os.path import requests diff --git a/tools/generate_std_names.py b/tools/generate_std_names.py index 6cbf275c8f..2eefbd30d8 100644 --- a/tools/generate_std_names.py +++ b/tools/generate_std_names.py @@ -16,8 +16,6 @@ http://cf-pcmdi.llnl.gov/documents/cf-standard-names """ - -from six.moves import (filter, input, map, range, zip) # noqa import six import argparse From 0a50dcc4564c54994ae1184e3a8db4e3c63619c2 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Thu, 31 Oct 2019 16:21:59 +0000 Subject: [PATCH 02/35] Removed six from test_coding_standards.py. --- lib/iris/tests/unit/test_Future.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/iris/tests/unit/test_Future.py b/lib/iris/tests/unit/test_Future.py index 2fb8925c34..1b99257a74 100644 --- a/lib/iris/tests/unit/test_Future.py +++ b/lib/iris/tests/unit/test_Future.py @@ -5,13 +5,6 @@ # licensing details. """Unit tests for the `iris.Future` class.""" -<<<<<<< HEAD -import six -from six.moves import (filter, input, map, range, zip) # noqa -======= -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed unused six imports. - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests From 5be4634f9fb60bf6673970f84ffcaf5d55663a8b Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 11:20:47 +0000 Subject: [PATCH 03/35] Removed six string_type usages. --- lib/iris/__init__.py | 2 +- lib/iris/_constraints.py | 6 ++-- lib/iris/analysis/calculus.py | 5 ++-- lib/iris/analysis/trajectory.py | 3 +- lib/iris/coord_categorisation.py | 10 +++---- lib/iris/coords.py | 19 ++++++------ lib/iris/cube.py | 30 +++++++++---------- lib/iris/experimental/stratify.py | 5 ++-- lib/iris/fileformats/abf.py | 3 +- lib/iris/fileformats/cf.py | 4 +-- lib/iris/fileformats/dot.py | 8 ++--- lib/iris/fileformats/name.py | 3 +- lib/iris/fileformats/netcdf.py | 6 ++-- lib/iris/fileformats/nimrod.py | 2 +- lib/iris/fileformats/pp.py | 16 +++++----- lib/iris/fileformats/rules.py | 2 +- lib/iris/io/__init__.py | 6 ++-- lib/iris/tests/__init__.py | 8 ++--- .../integration/fast_load/test_fast_load.py | 7 ++--- lib/iris/tests/test_merge.py | 5 ++-- lib/iris/tests/unit/merge/test_ProtoCube.py | 2 +- .../unit/util/test_file_is_newer_than.py | 3 +- lib/iris/util.py | 10 +++---- 23 files changed, 77 insertions(+), 88 deletions(-) diff --git a/lib/iris/__init__.py b/lib/iris/__init__.py index fa6a1fe8a4..bd75f7dca8 100644 --- a/lib/iris/__init__.py +++ b/lib/iris/__init__.py @@ -229,7 +229,7 @@ def context(self, **kwargs): def _generate_cubes(uris, callback, constraints): """Returns a generator of cubes given the URIs and a callback.""" - if isinstance(uris, six.string_types): + if isinstance(uris, str): uris = [uris] # Group collections of uris by their iris handler diff --git a/lib/iris/_constraints.py b/lib/iris/_constraints.py index b7f0df4305..92063b34cc 100644 --- a/lib/iris/_constraints.py +++ b/lib/iris/_constraints.py @@ -83,7 +83,7 @@ def __init__(self, name=None, cube_func=None, coord_values=None, **kwargs): :class:`iris.coords.Cell`. """ - if not (name is None or isinstance(name, six.string_types)): + if not (name is None or isinstance(name, str)): raise TypeError('name must be None or string, got %r' % name) if not (cube_func is None or callable(cube_func)): raise TypeError('cube_func must be None or callable, got %r' @@ -251,7 +251,7 @@ def extract(self, cube): call_func = self._coord_thing elif (isinstance(self._coord_thing, Iterable) and not isinstance(self._coord_thing, - (six.string_types, iris.coords.Cell))): + (str, iris.coords.Cell))): desired_values = list(self._coord_thing) # A dramatic speedup can be had if we don't have bounds. if coord.has_bounds(): @@ -421,7 +421,7 @@ def as_constraint(thing): return thing elif thing is None: return Constraint() - elif isinstance(thing, six.string_types): + elif isinstance(thing, str): return Constraint(thing) else: raise TypeError('%r cannot be cast to a constraint.' % thing) diff --git a/lib/iris/analysis/calculus.py b/lib/iris/analysis/calculus.py index 8178ff1ac7..11473d7f2f 100644 --- a/lib/iris/analysis/calculus.py +++ b/lib/iris/analysis/calculus.py @@ -11,7 +11,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six import re import warnings @@ -143,7 +142,7 @@ def cube_delta(cube, coord): """ # handle the case where a user passes a coordinate name - if isinstance(coord, six.string_types): + if isinstance(coord, str): coord = cube.coord(coord) if coord.ndim != 1: @@ -242,7 +241,7 @@ def differentiate(cube, coord_to_differentiate): # This operation results in a copy of the original cube. delta_cube = cube_delta(cube, coord_to_differentiate) - if isinstance(coord_to_differentiate, six.string_types): + if isinstance(coord_to_differentiate, str): coord = cube.coord(coord_to_differentiate) else: coord = coord_to_differentiate diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index 5505da5d08..76623a3a15 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -10,7 +10,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six import math @@ -221,7 +220,7 @@ def interpolate(cube, sample_points, method=None): # Convert any coordinate names to coords points = [] for coord, values in sample_points: - if isinstance(coord, six.string_types): + if isinstance(coord, str): coord = cube.coord(coord) points.append((coord, values)) sample_points = points diff --git a/lib/iris/coord_categorisation.py b/lib/iris/coord_categorisation.py index 36f4600103..846befd2fa 100644 --- a/lib/iris/coord_categorisation.py +++ b/lib/iris/coord_categorisation.py @@ -17,7 +17,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six import calendar import collections @@ -53,7 +52,7 @@ def add_categorised_coord(cube, name, from_coord, category_function, units of the category value, typically 'no_unit' or '1'. """ # Interpret coord, if given as a name - if isinstance(from_coord, six.string_types): + if isinstance(from_coord, str): from_coord = cube.coord(from_coord) if len(cube.coords(name)) > 0: @@ -65,13 +64,12 @@ def add_categorised_coord(cube, name, from_coord, category_function, # Test whether the result contains strings. If it does we must manually # force the dtype because of a numpy bug (see numpy #3270 on GitHub). result = category_function(from_coord, from_coord.points.ravel()[0]) - if isinstance(result, six.string_types): + if isinstance(result, str): str_vectorised_fn = np.vectorize(category_function, otypes=[object]) - # Use a common type for string arrays (N.B. limited to 64 chars) - all_cases_string_type = '|S64' if six.PY2 else '|U64' def vectorised_fn(*args): - return str_vectorised_fn(*args).astype(all_cases_string_type) + # Use a common type for string arrays (N.B. limited to 64 chars). + return str_vectorised_fn(*args).astype('|U64') else: vectorised_fn = np.vectorize(category_function) diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 2044d54af9..6548c56f62 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -494,7 +494,7 @@ def is_compatible(self, other, ignore=None): if compatible: common_keys = set(self.attributes).intersection(other.attributes) if ignore is not None: - if isinstance(ignore, six.string_types): + if isinstance(ignore, str): ignore = (ignore,) common_keys = common_keys.difference(ignore) for key in common_keys: @@ -1015,8 +1015,8 @@ def __eq__(self, other): return self.point == other elif isinstance(other, Cell): return (self.point == other.point) and (self.bound == other.bound) - elif (isinstance(other, six.string_types) and self.bound is None and - isinstance(self.point, six.string_types)): + elif (isinstance(other, str) and self.bound is None and + isinstance(self.point, str)): return self.point == other else: return NotImplemented @@ -1760,17 +1760,16 @@ def collapsed(self, dims_to_collapse=None): def serialize(x): return '|'.join([str(i) for i in x.flatten()]) bounds = None - string_type_fmt = 'S{}' if six.PY2 else 'U{}' if self.has_bounds(): shape = self._bounds_dm.shape[1:] bounds = [] for index in np.ndindex(shape): index_slice = (slice(None),) + tuple(index) bounds.append(serialize(self.bounds[index_slice])) - dtype = np.dtype(string_type_fmt.format(max(map(len, bounds)))) + dtype = np.dtype('U{}'.format(max(map(len, bounds)))) bounds = np.array(bounds, dtype=dtype).reshape((1,) + shape) points = serialize(self.points) - dtype = np.dtype(string_type_fmt.format(len(points))) + dtype = np.dtype('U{}'.format(len(points))) # Create the new collapsed coordinate. coord = self.copy(points=np.array(points, dtype=dtype), bounds=bounds) @@ -2389,7 +2388,7 @@ def __init__(self, method, coords=None, intervals=None, comments=None): comments. """ - if not isinstance(method, six.string_types): + if not isinstance(method, str): raise TypeError("'method' must be a string - got a '%s'" % type(method)) @@ -2399,7 +2398,7 @@ def __init__(self, method, coords=None, intervals=None, comments=None): pass elif isinstance(coords, Coord): _coords.append(coords.name(token=True)) - elif isinstance(coords, six.string_types): + elif isinstance(coords, str): _coords.append(CFVariableMixin.token(coords) or default_name) else: normalise = (lambda coord: coord.name(token=True) if @@ -2410,7 +2409,7 @@ def __init__(self, method, coords=None, intervals=None, comments=None): _intervals = [] if intervals is None: pass - elif isinstance(intervals, six.string_types): + elif isinstance(intervals, str): _intervals = [intervals] else: _intervals.extend(intervals) @@ -2418,7 +2417,7 @@ def __init__(self, method, coords=None, intervals=None, comments=None): _comments = [] if comments is None: pass - elif isinstance(comments, six.string_types): + elif isinstance(comments, str): _comments = [comments] else: _comments.extend(comments) diff --git a/lib/iris/cube.py b/lib/iris/cube.py index b6d296d7ca..ca562f8ec4 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -336,7 +336,7 @@ def extract_overlapping(self, coord_names): over which to perform the extraction. """ - if isinstance(coord_names, six.string_types): + if isinstance(coord_names, str): coord_names = [coord_names] def make_overlap_fn(coord_name): @@ -633,7 +633,7 @@ def _is_single_item(testee): We count string types as 'single', also. """ - return (isinstance(testee, six.string_types) or + return (isinstance(testee, str) or not isinstance(testee, Iterable)) @@ -746,7 +746,7 @@ def __init__(self, data, standard_name=None, long_name=None, """ # Temporary error while we transition the API. - if isinstance(data, six.string_types): + if isinstance(data, str): raise TypeError('Invalid data type: {!r}.'.format(data)) # Initialise the cube data manager. @@ -884,7 +884,7 @@ def is_compatible(self, other, ignore=None): if compatible: common_keys = set(self.attributes).intersection(other.attributes) if ignore is not None: - if isinstance(ignore, six.string_types): + if isinstance(ignore, str): ignore = (ignore,) common_keys = common_keys.difference(ignore) for key in common_keys: @@ -1425,7 +1425,7 @@ def coords(self, name_or_coord=None, standard_name=None, name = None coord = None - if isinstance(name_or_coord, six.string_types): + if isinstance(name_or_coord, str): name = name_or_coord else: coord = name_or_coord @@ -1551,7 +1551,7 @@ def coord(self, name_or_coord=None, standard_name=None, elif len(coords) == 0: _name = name_or_coord if name_or_coord is not None: - if not isinstance(name_or_coord, six.string_types): + if not isinstance(name_or_coord, str): _name = name_or_coord.name() bad_name = _name or standard_name or long_name or '' msg = 'Expected to find exactly 1 %s coordinate, but found ' \ @@ -1586,7 +1586,7 @@ def coord_system(self, spec=None): The :class:`iris.coord_systems.CoordSystem` or None. """ - if isinstance(spec, six.string_types) or spec is None: + if isinstance(spec, str) or spec is None: spec_name = spec else: msg = "type %s is not a subclass of CoordSystem" % spec @@ -1632,7 +1632,7 @@ def cell_measures(self, name_or_cell_measure=None): """ name = None - if isinstance(name_or_cell_measure, six.string_types): + if isinstance(name_or_cell_measure, str): name = name_or_cell_measure else: cell_measure = name_or_cell_measure @@ -1674,7 +1674,7 @@ def cell_measure(self, name_or_cell_measure=None): ', '.join(cm.name() for cm in cell_measures)) raise iris.exceptions.CellMeasureNotFoundError(msg) elif len(cell_measures) == 0: - if isinstance(name_or_cell_measure, six.string_types): + if isinstance(name_or_cell_measure, str): bad_name = name_or_cell_measure else: bad_name = (name_or_cell_measure and @@ -1709,7 +1709,7 @@ def ancillary_variables(self, name_or_ancillary_variable=None): """ name = None - if isinstance(name_or_ancillary_variable, six.string_types): + if isinstance(name_or_ancillary_variable, str): name = name_or_ancillary_variable else: ancillary_variable = name_or_ancillary_variable @@ -1752,7 +1752,7 @@ def ancillary_variable(self, name_or_ancillary_variable=None): for anc_var in ancillary_variables)) raise iris.exceptions.AncillaryVariableNotFoundError(msg) elif len(ancillary_variables) == 0: - if isinstance(name_or_ancillary_variable, six.string_types): + if isinstance(name_or_ancillary_variable, str): bad_name = name_or_ancillary_variable else: bad_name = (name_or_ancillary_variable and @@ -2210,7 +2210,7 @@ def vector_summary(vector_coords, cube_header, max_line_offset, # Format cell depending on type of point and whether it # has a bound. coord_cell = coord.cell(0) - if isinstance(coord_cell.point, six.string_types): + if isinstance(coord_cell.point, str): # Indent string type coordinates coord_cell_split = [iris.util.clip_string(str(item)) for item in @@ -2816,13 +2816,13 @@ def _as_list_of_coords(self, names_or_coords): coords = [] for name_or_coord in names_or_coords: - if (isinstance(name_or_coord, six.string_types) or + if (isinstance(name_or_coord, str) or isinstance(name_or_coord, iris.coords.Coord)): coords.append(self.coord(name_or_coord)) else: # Don't know how to handle this type msg = ("Don't know how to handle coordinate of type %s. " - "Ensure all coordinates are of type six.string_types " + "Ensure all coordinates are of type str " "or iris.coords.Coord.") % (type(name_or_coord), ) raise TypeError(msg) return coords @@ -3053,7 +3053,7 @@ def _xml_element(self, doc, checksum=False, order=True, byteorder=True): if type(value) in (list, tuple): delimiter = '[]' if isinstance(value, list) else '()' value = ', '.join(("'%s'" - if isinstance(item, six.string_types) + if isinstance(item, str) else '%s') % (item, ) for item in value) value = delimiter[0] + value + delimiter[1] else: diff --git a/lib/iris/experimental/stratify.py b/lib/iris/experimental/stratify.py index f03d6fabfc..54d2beb118 100644 --- a/lib/iris/experimental/stratify.py +++ b/lib/iris/experimental/stratify.py @@ -11,7 +11,6 @@ from six.moves import (filter, input, map, range, zip) # noqa from functools import partial -import six import numpy as np import stratify @@ -115,11 +114,11 @@ def relevel(cube, src_levels, tgt_levels, axis=None, interpolator=None): if axis is None: axis = 0 - if isinstance(axis, (six.string_types, Coord)): + if isinstance(axis, (str, Coord)): [axis] = cube.coord_dims(axis) # Get the source level data. - if isinstance(src_levels, six.string_types): + if isinstance(src_levels, str): src_data = cube.coord(src_levels).points elif isinstance(src_levels, Coord): src_data = src_levels.points diff --git a/lib/iris/fileformats/abf.py b/lib/iris/fileformats/abf.py index c2e1209b47..cade3b0e5a 100644 --- a/lib/iris/fileformats/abf.py +++ b/lib/iris/fileformats/abf.py @@ -13,7 +13,6 @@ `here `_. """ -import six import calendar import datetime @@ -180,7 +179,7 @@ def load_cubes(filespecs, callback=None): The resultant cubes may not be in the same order as in the file. """ - if isinstance(filespecs, six.string_types): + if isinstance(filespecs, str): filespecs = [filespecs] for filespec in filespecs: diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index 624f5b5a88..7b1dfa366c 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -102,7 +102,7 @@ def _identify_common(variables, ignore, target): if target is None: target = variables - elif isinstance(target, six.string_types): + elif isinstance(target, str): if target not in variables: raise ValueError('Cannot identify unknown target CF-netCDF variable %r' % target) target = {target: variables[target]} @@ -1078,7 +1078,7 @@ def _build(cf_variable): cf_root_var = self.cf_group[cf_root] name = cf_root_var.standard_name or cf_root_var.long_name terms = reference_terms.get(name, []) - if isinstance(terms, six.string_types) or \ + if isinstance(terms, str) or \ not isinstance(terms, Iterable): terms = [terms] cf_var_name = cf_var.cf_name diff --git a/lib/iris/fileformats/dot.py b/lib/iris/fileformats/dot.py index 5fb7511775..8402d92ff9 100644 --- a/lib/iris/fileformats/dot.py +++ b/lib/iris/fileformats/dot.py @@ -61,7 +61,7 @@ def save(cube, target): See also :func:`iris.io.save`. """ - if isinstance(target, six.string_types): + if isinstance(target, str): dot_file = open(target, "wt") elif hasattr(target, "write"): if hasattr(target, "mode") and "b" in target.mode: @@ -73,7 +73,7 @@ def save(cube, target): try: dot_file.write(cube_text(cube)) finally: - if isinstance(target, six.string_types): + if isinstance(target, str): dot_file.close() @@ -99,7 +99,7 @@ def save_png(source, target, launch=False): # Create dot file dot_file_path = iris.util.create_temp_filename(".dot") save(source, dot_file_path) - elif isinstance(source, six.string_types): + elif isinstance(source, str): dot_file_path = source else: raise ValueError("Can only write dot png for a Cube or DOT file") @@ -109,7 +109,7 @@ def save_png(source, target, launch=False): raise ValueError('Executable "dot" not found: ' 'Review dot_path setting in site.cfg.') # To filename or open file handle? - if isinstance(target, six.string_types): + if isinstance(target, str): subprocess.call([_dot_path(), '-T', 'png', '-o', target, dot_file_path]) elif hasattr(target, "write"): diff --git a/lib/iris/fileformats/name.py b/lib/iris/fileformats/name.py index ebfad9f81a..c6852ba404 100644 --- a/lib/iris/fileformats/name.py +++ b/lib/iris/fileformats/name.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Provides NAME file format loading capabilities.""" -import six import iris.io @@ -67,7 +66,7 @@ def load_cubes(filenames, callback): A generator of :class:`iris.cubes.Cube` instances. """ - if isinstance(filenames, six.string_types): + if isinstance(filenames, str): filenames = [filenames] for filename in filenames: diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index 7de3f340cf..af147c46a7 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -688,7 +688,7 @@ def load_cubes(filenames, callback=None): # Initialise the pyke inference engine. engine = _pyke_kb_engine() - if isinstance(filenames, six.string_types): + if isinstance(filenames, str): filenames = [filenames] for filename in filenames: @@ -728,7 +728,7 @@ def _bytes_if_ascii(string): be returned by the function unchanged. """ - if isinstance(string, six.string_types): + if isinstance(string, str): try: return string.encode(encoding='ascii') except (AttributeError, UnicodeEncodeError): @@ -2355,7 +2355,7 @@ def is_valid_packspec(p): packspecs = packing # Make fill-value(s) into an iterable over cubes. - if isinstance(fill_value, six.string_types): + if isinstance(fill_value, str): # Strings are awkward -- handle separately. fill_values = repeat(fill_value) else: diff --git a/lib/iris/fileformats/nimrod.py b/lib/iris/fileformats/nimrod.py index 94a28645b2..39468572f6 100644 --- a/lib/iris/fileformats/nimrod.py +++ b/lib/iris/fileformats/nimrod.py @@ -214,7 +214,7 @@ def load_cubes(filenames, callback=None): The resultant cubes may not be in the same order as in the files. """ - if isinstance(filenames, six.string_types): + if isinstance(filenames, str): filenames = [filenames] for filename in filenames: diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index b15b87aa13..8ac6928897 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -266,7 +266,7 @@ def __new__(cls, model, section, item): @staticmethod def from_msi(msi): """Convert a STASH code MSI string to a STASH instance.""" - if not isinstance(msi, six.string_types): + if not isinstance(msi, str): raise TypeError('Expected STASH code MSI string, got %r' % (msi,)) msi_match = re.match( @@ -320,7 +320,7 @@ def __hash__(self): return super(STASH, self).__hash__() def __eq__(self, other): - if isinstance(other, six.string_types): + if isinstance(other, str): return super(STASH, self).__eq__(STASH.from_msi(other)) else: return super(STASH, self).__eq__(other) @@ -889,7 +889,7 @@ def stash(self): @stash.setter def stash(self, stash): - if isinstance(stash, six.string_types): + if isinstance(stash, str): self._stash = STASH.from_msi(stash) elif isinstance(stash, STASH): self._stash = stash @@ -1117,7 +1117,7 @@ def save(self, file_handle): extra_elem = getattr(self, extra_data_attr_name, None) if extra_elem is not None: # The special case of character extra data must be caught - if isinstance(extra_elem, six.string_types): + if isinstance(extra_elem, str): ia = len(extra_elem) # pad any strings up to a multiple of PP_WORD_DEPTH # (this length is # of bytes) @@ -1229,7 +1229,7 @@ def save(self, file_handle): # extra data elements for int_code, extra_data in extra_items: pp_file.write(struct.pack(">L", int(int_code))) - if isinstance(extra_data, six.string_types): + if isinstance(extra_data, str): pp_file.write(struct.pack(">%ss" % len(extra_data), extra_data.encode())) else: @@ -1803,7 +1803,7 @@ def _make_func(stashobj): stashobj = con._attributes['STASH'] if callable(stashobj): call_func = stashobj - elif isinstance(stashobj, (six.string_types, STASH)): + elif isinstance(stashobj, (str, STASH)): call_func = _make_func(stashobj) else: raise TypeError("STASH constraints should be either a" @@ -2201,7 +2201,7 @@ def save_fields(fields, target, append=False): # LBTYP - Fields file field type code # LBLEV - Fields file level code / hybrid height model level - if isinstance(target, six.string_types): + if isinstance(target, str): pp_file = open(target, "ab" if append else "wb") elif hasattr(target, "write"): if hasattr(target, "mode") and "b" not in target.mode: @@ -2216,5 +2216,5 @@ def save_fields(fields, target, append=False): # Write to file pp_field.save(pp_file) finally: - if isinstance(target, six.string_types): + if isinstance(target, str): pp_file.close() diff --git a/lib/iris/fileformats/rules.py b/lib/iris/fileformats/rules.py index c242da7d78..99063cf7c2 100644 --- a/lib/iris/fileformats/rules.py +++ b/lib/iris/fileformats/rules.py @@ -391,7 +391,7 @@ def load_pairs_from_fields(fields, converter): def load_cubes(filenames, user_callback, loader, filter_function=None): - if isinstance(filenames, six.string_types): + if isinstance(filenames, str): filenames = [filenames] def _generate_all_fields_and_filenames(): diff --git a/lib/iris/io/__init__.py b/lib/iris/io/__init__.py index e64146b4b2..ebbdd60f63 100644 --- a/lib/iris/io/__init__.py +++ b/lib/iris/io/__init__.py @@ -26,7 +26,7 @@ class _SaversDict(dict): """A dictionary that can only have string keys with no overlap.""" def __setitem__(self, key, value): - if not isinstance(key, six.string_types): + if not isinstance(key, str): raise ValueError("key is not a string") if key in self: raise ValueError("A saver already exists for", key) @@ -382,11 +382,11 @@ def save(source, target, saver=None, **kwargs): """ # Determine format from filename - if isinstance(target, six.string_types) and saver is None: + if isinstance(target, str) and saver is None: saver = find_saver(target) elif hasattr(target, 'name') and saver is None: saver = find_saver(target.name) - elif isinstance(saver, six.string_types): + elif isinstance(saver, str): saver = find_saver(saver) if saver is None: raise ValueError("Cannot save; no saver") diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index eb84673912..91d2ad60f0 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -176,7 +176,7 @@ def get_data_path(relative_path): as a string, or sequence of strings. """ - if not isinstance(relative_path, six.string_types): + if not isinstance(relative_path, str): relative_path = os.path.join(*relative_path) test_data_dir = iris.config.TEST_DATA_DIR if test_data_dir is None: @@ -186,7 +186,7 @@ def get_data_path(relative_path): if _EXPORT_DATAPATHS_FILE is not None: _EXPORT_DATAPATHS_FILE.write(data_path + '\n') - if isinstance(data_path, six.string_types) and not os.path.exists(data_path): + if isinstance(data_path, str) and not os.path.exists(data_path): # if the file is gzipped, ungzip it and return the path of the ungzipped # file. gzipped_fname = data_path + '.gz' @@ -230,7 +230,7 @@ def get_result_path(relative_path): as a string, or sequence of strings. """ - if not isinstance(relative_path, six.string_types): + if not isinstance(relative_path, str): relative_path = os.path.join(*relative_path) return os.path.abspath(os.path.join(_RESULT_PATH, relative_path)) @@ -329,7 +329,7 @@ def assertCDL(self, netcdf_filename, reference_filename=None, flags='-h'): # Convert the netCDF file to CDL file format. if flags is None: flags = [] - elif isinstance(flags, six.string_types): + elif isinstance(flags, str): flags = flags.split() else: flags = list(map(str, flags)) diff --git a/lib/iris/tests/integration/fast_load/test_fast_load.py b/lib/iris/tests/integration/fast_load/test_fast_load.py index 1d73ab7a7d..db8001634b 100644 --- a/lib/iris/tests/integration/fast_load/test_fast_load.py +++ b/lib/iris/tests/integration/fast_load/test_fast_load.py @@ -20,7 +20,6 @@ from cf_units import Unit import numpy as np -import six import iris.coords from iris.coords import DimCoord, AuxCoord, CellMethod @@ -107,7 +106,7 @@ def arglen(arg): # Get the 'length' of a control argument. if arg is None: result = 0 - elif isinstance(arg, six.string_types): + elif isinstance(arg, str): result = len(arg) else: result = 1 @@ -162,7 +161,7 @@ def arg_vals(arg, vals): # First get a list of value indices from the argument. # Can be: a single index value; a list of indices; or a string. if (isinstance(arg, Iterable) and - not isinstance(arg, six.string_types)): + not isinstance(arg, str)): # Can also just pass a simple iterable of values. inds = [int(val) for val in arg] else: @@ -172,7 +171,7 @@ def arg_vals(arg, vals): elif n_vals == 1: inds = [int(arg)] * n_flds else: - assert isinstance(arg, six.string_types) + assert isinstance(arg, str) inds = [None if char == '-' else int(char) for char in arg] diff --git a/lib/iris/tests/test_merge.py b/lib/iris/tests/test_merge.py index a551676bbb..f3c6a7b6c3 100644 --- a/lib/iris/tests/test_merge.py +++ b/lib/iris/tests/test_merge.py @@ -9,7 +9,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests @@ -382,7 +381,7 @@ def _make_cube(self, a, b, c, d, data=0): long_name='y', units='1'), 0) for name, value in zip(['a', 'b', 'c', 'd'], [a, b, c, d]): - dtype = np.str if isinstance(value, six.string_types) else np.float32 + dtype = np.str if isinstance(value, str) else np.float32 cube.add_aux_coord(AuxCoord(np.array([value], dtype=dtype), long_name=name, units='1')) @@ -448,7 +447,7 @@ def _make_cube(self, a, b, data=0, a_dim=False, b_dim=False): long_name='y', units='1'), 0) for name, value, dim in zip(['a', 'b'], [a, b], [a_dim, b_dim]): - dtype = np.str if isinstance(value, six.string_types) else np.float32 + dtype = np.str if isinstance(value, str) else np.float32 ctype = DimCoord if dim else AuxCoord coord = ctype(np.array([value], dtype=dtype), long_name=name, units='1') diff --git a/lib/iris/tests/unit/merge/test_ProtoCube.py b/lib/iris/tests/unit/merge/test_ProtoCube.py index b9b1d08063..26aab8ef75 100644 --- a/lib/iris/tests/unit/merge/test_ProtoCube.py +++ b/lib/iris/tests/unit/merge/test_ProtoCube.py @@ -260,7 +260,7 @@ def check_merge_fails_with_message(self): return str(arc.exception) def check_fail(self, *substrs): - if isinstance(substrs, six.string_types): + if isinstance(substrs, str): substrs = [substrs] msg = self.check_merge_fails_with_message() for substr in substrs: diff --git a/lib/iris/tests/unit/util/test_file_is_newer_than.py b/lib/iris/tests/unit/util/test_file_is_newer_than.py index aba4296ef5..d8008ab7ea 100644 --- a/lib/iris/tests/unit/util/test_file_is_newer_than.py +++ b/lib/iris/tests/unit/util/test_file_is_newer_than.py @@ -7,7 +7,6 @@ Test function :func:`iris.util.test_file_is_newer`. """ -import six # import iris tests first so that some things can be initialised before # importing anything else @@ -53,7 +52,7 @@ def _test(self, boolean_result, result_name, source_names): """Test expected result of executing with given args.""" # Make args into full paths result_path = self._name2path(result_name) - if isinstance(source_names, six.string_types): + if isinstance(source_names, str): source_paths = self._name2path(source_names) else: source_paths = [self._name2path(name) diff --git a/lib/iris/util.py b/lib/iris/util.py index 369cec5eaa..11f19bd016 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -1267,7 +1267,7 @@ def file_is_newer_than(result_path, source_paths): """ # Accept a string as a single source path - if isinstance(source_paths, six.string_types): + if isinstance(source_paths, str): source_paths = [source_paths] # Fix our chosen timestamp function file_date = os.path.getmtime @@ -1458,14 +1458,14 @@ def promote_aux_coord_to_dim_coord(cube, name_or_coord): """ - if isinstance(name_or_coord, six.string_types): + if isinstance(name_or_coord, str): aux_coord = cube.coord(name_or_coord) elif isinstance(name_or_coord, iris.coords.Coord): aux_coord = name_or_coord else: # Don't know how to handle this type msg = ("Don't know how to handle coordinate of type {}. " - "Ensure all coordinates are of type six.string_types or " + "Ensure all coordinates are of type str or " "iris.coords.Coord.") msg = msg.format(type(name_or_coord)) raise TypeError(msg) @@ -1558,14 +1558,14 @@ def demote_dim_coord_to_aux_coord(cube, name_or_coord): """ - if isinstance(name_or_coord, six.string_types): + if isinstance(name_or_coord, str): dim_coord = cube.coord(name_or_coord) elif isinstance(name_or_coord, iris.coords.Coord): dim_coord = name_or_coord else: # Don't know how to handle this type msg = ("Don't know how to handle coordinate of type {}. " - "Ensure all coordinates are of type six.string_types or " + "Ensure all coordinates are of type str or " "iris.coords.Coord.") msg = msg.format(type(name_or_coord)) raise TypeError(msg) From 8100a06b83cff95a4806bcc9f0a5d44ad6146544 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 11:35:20 +0000 Subject: [PATCH 04/35] Removed uses of six.AssertRaisesRegex --- lib/iris/tests/__init__.py | 14 -------- .../integration/plot/test_vector_plots.py | 2 +- lib/iris/tests/integration/test_netcdf.py | 4 +-- lib/iris/tests/test_analysis.py | 2 +- lib/iris/tests/test_basic_maths.py | 16 ++++----- lib/iris/tests/test_coord_api.py | 15 ++++----- lib/iris/tests/test_coordsystem.py | 4 +-- lib/iris/tests/test_hybrid.py | 4 +-- lib/iris/tests/test_pp_stash.py | 8 ++--- .../test_AreaWeightedRegridder.py | 4 +-- .../cartography/test__quadrant_area.py | 2 +- .../analysis/cartography/test__xy_range.py | 2 +- .../analysis/cartography/test_area_weights.py | 4 +-- .../cartography/test_gridcell_angles.py | 18 +++++----- .../analysis/cartography/test_rotate_winds.py | 10 +++--- .../test_RectilinearInterpolator.py | 16 ++++----- .../maths/test__inplace_common_checks.py | 16 ++++----- .../regrid/test_RectilinearRegridder.py | 14 ++++---- .../regrid/test__CurvilinearRegridder.py | 8 ++--- .../tests/unit/analysis/test_Aggregator.py | 2 +- .../tests/unit/analysis/test_AreaWeighted.py | 4 +-- lib/iris/tests/unit/analysis/test_COUNT.py | 6 ++-- lib/iris/tests/unit/analysis/test_Linear.py | 2 +- lib/iris/tests/unit/analysis/test_Nearest.py | 2 +- .../tests/unit/analysis/test_PERCENTILE.py | 8 ++--- .../analysis/test_PercentileAggregator.py | 2 +- lib/iris/tests/unit/analysis/test_RMS.py | 10 +++--- .../tests/unit/analysis/test_WPERCENTILE.py | 18 +++++----- .../test_WeightedPercentileAggregator.py | 4 +-- ...t_UnstructuredNearestNeighbourRegridder.py | 24 +++++++------- ...est__nearest_neighbour_indices_ndcoords.py | 2 +- .../analysis/trajectory/test_interpolate.py | 6 ++-- .../unit/concatenate/test_concatenate.py | 18 +++++----- .../unit/coord_systems/test_Geostationary.py | 8 ++--- .../unit/coords/test_AncillaryVariable.py | 2 +- lib/iris/tests/unit/coords/test_AuxCoord.py | 6 ++-- lib/iris/tests/unit/coords/test_Cell.py | 14 ++++---- .../tests/unit/coords/test_CellMeasure.py | 4 +-- lib/iris/tests/unit/coords/test_CellMethod.py | 2 +- lib/iris/tests/unit/coords/test_Coord.py | 25 +++++++------- lib/iris/tests/unit/coords/test_DimCoord.py | 33 +++++++++---------- lib/iris/tests/unit/cube/test_Cube.py | 10 +++--- lib/iris/tests/unit/cube/test_CubeList.py | 2 +- .../cube_coord_common/test_CFVariableMixin.py | 4 +-- .../test_get_valid_standard_name.py | 8 ++--- .../unit/data_manager/test_DataManager.py | 16 ++++----- .../experimental/stratify/test_relevel.py | 4 +-- .../tests/unit/fileformats/ff/test_FF2PP.py | 12 +++---- .../unit/fileformats/netcdf/test_Saver.py | 12 +++---- .../pp_load_rules/test__epoch_date_hours.py | 2 +- .../test__reshape_vector_args.py | 2 +- .../test_reorder_bounds_data.py | 2 +- .../test_ArrayStructure.py | 2 +- .../test_GroupStructure.py | 2 +- .../test_optimal_array_structure.py | 2 +- .../tests/unit/io/test_expand_filespecs.py | 2 +- lib/iris/tests/unit/io/test_run_callback.py | 4 +-- .../test__check_bounds_contiguity_and_mask.py | 4 +-- ...est__get_plot_defn_custom_coords_picked.py | 2 +- lib/iris/tests/unit/test_Future.py | 2 +- lib/iris/tests/unit/test_sample_data_path.py | 10 +++--- lib/iris/tests/unit/tests/test_IrisTest.py | 2 +- .../tests/unit/util/test__coord_regular.py | 6 ++-- .../unit/util/test__slice_data_with_keys.py | 8 ++--- lib/iris/tests/unit/util/test_reverse.py | 32 +++++++++--------- 65 files changed, 249 insertions(+), 268 deletions(-) diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 91d2ad60f0..c4afa353a5 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -512,20 +512,6 @@ def assertXMLElement(self, obj, reference_filename): def assertArrayEqual(self, a, b, err_msg=''): np.testing.assert_array_equal(a, b, err_msg=err_msg) - def assertRaisesRegexp(self, *args, **kwargs): - """ - Emulate the old :meth:`unittest.TestCase.assertRaisesRegexp`. - - Because the original function is now deprecated in Python 3. - Now calls :meth:`six.assertRaisesRegex()` (no final "p") instead. - It is the same, except for providing an additional 'msg' argument. - - """ - # Note: invoke via parent class to avoid recursion as, in Python 2, - # "six.assertRaisesRegex" calls getattr(self, 'assertRaisesRegexp'). - return six.assertRaisesRegex(super(IrisTest_nometa, self), - *args, **kwargs) - @contextlib.contextmanager def _recordWarningMatches(self, expected_regexp=''): # Record warnings raised matching a given expression. diff --git a/lib/iris/tests/integration/plot/test_vector_plots.py b/lib/iris/tests/integration/plot/test_vector_plots.py index 7e8bd9cf60..20bc5d3655 100644 --- a/lib/iris/tests/integration/plot/test_vector_plots.py +++ b/lib/iris/tests/integration/plot/test_vector_plots.py @@ -149,7 +149,7 @@ def test_fail_unsupported_coord_system(self): coord.coord_system = patch_coord_system re_msg = ('Can only plot .* lat-lon projection, .* ' 'This .* translates as Cartopy.*Mercator') - with self.assertRaisesRegexp(ValueError, re_msg): + with self.assertRaisesRegex(ValueError, re_msg): self.plot('2d_rotated', u_cube, v_cube, coords=('longitude', 'latitude')) diff --git a/lib/iris/tests/integration/test_netcdf.py b/lib/iris/tests/integration/test_netcdf.py index 53b8aa71d9..1338b5b7a2 100644 --- a/lib/iris/tests/integration/test_netcdf.py +++ b/lib/iris/tests/integration/test_netcdf.py @@ -98,7 +98,7 @@ def test_shared_primary(self): factory.rename('another altitude') cube.add_aux_factory(factory) with self.temp_filename(suffix='.nc') as filename, \ - self.assertRaisesRegexp(ValueError, 'multiple aux factories'): + self.assertRaisesRegex(ValueError, 'multiple aux factories'): iris.save(cube, filename) def test_hybrid_height_cubes(self): @@ -121,7 +121,7 @@ def test_hybrid_height_cubes_on_dimension_coordinate(self): sa.points = sa.points * 10 emsg = 'Unable to create dimensonless vertical coordinate.' with self.temp_filename('.nc') as fname, \ - self.assertRaisesRegexp(ValueError, emsg): + self.assertRaisesRegex(ValueError, emsg): iris.save([hh1, hh2], fname) diff --git a/lib/iris/tests/test_analysis.py b/lib/iris/tests/test_analysis.py index 82ccd489c7..c32ac82dc4 100644 --- a/lib/iris/tests/test_analysis.py +++ b/lib/iris/tests/test_analysis.py @@ -564,7 +564,7 @@ def test_fast_percentile_3d_masked_type_masked(self): cube = tests.stock.simple_3d_mask() msg = 'Cannot use fast np.percentile method with masked array.' - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaisesRegex(TypeError, msg): cube.collapsed('wibble', iris.analysis.PERCENTILE, percent=75, fast_percentile_method=True) diff --git a/lib/iris/tests/test_basic_maths.py b/lib/iris/tests/test_basic_maths.py index f520076aa4..0c4185b0a7 100644 --- a/lib/iris/tests/test_basic_maths.py +++ b/lib/iris/tests/test_basic_maths.py @@ -695,9 +695,9 @@ def test_operator__inplace__mixed_ints_uints_floats(self): # requirement. for test_op in self.iops: test_emsg = 'Cannot perform inplace' - with self.assertRaisesRegexp(ArithmeticError, test_emsg): + with self.assertRaisesRegex(ArithmeticError, test_emsg): test_op(self.cube_1i, self.cube_2f) - with self.assertRaisesRegexp(ArithmeticError, test_emsg): + with self.assertRaisesRegex(ArithmeticError, test_emsg): test_op(self.cube_1u, self.cube_2f) def test_operator__inplace__scalar_int(self): @@ -723,9 +723,9 @@ def test_operator__inplace__scalar_float(self): scalar = 2.5 for test_op in self.iops: test_emsg = 'Cannot perform inplace' - with self.assertRaisesRegexp(ArithmeticError, test_emsg): + with self.assertRaisesRegex(ArithmeticError, test_emsg): test_op(self.cube_1i, scalar) - with self.assertRaisesRegexp(ArithmeticError, test_emsg): + with self.assertRaisesRegex(ArithmeticError, test_emsg): test_op(self.cube_1u, scalar) def test_operator__scalar_float(self): @@ -758,22 +758,22 @@ def test_operator_array(self): self.assertArrayAlmostEqual(result3.data, result4) def test_cube_itruediv__int(self): - with self.assertRaisesRegexp(ArithmeticError, + with self.assertRaisesRegex(ArithmeticError, 'Cannot perform inplace division'): operator.itruediv(self.cube_1i, self.cube_2i) def test_cube_itruediv__uint(self): - with self.assertRaisesRegexp(ArithmeticError, + with self.assertRaisesRegex(ArithmeticError, 'Cannot perform inplace division'): operator.itruediv(self.cube_1u, self.cube_2u) def test_int_cube_itruediv__scalar(self): - with self.assertRaisesRegexp(ArithmeticError, + with self.assertRaisesRegex(ArithmeticError, 'Cannot perform inplace division'): operator.itruediv(self.cube_1i, 5) def test_uint_cube_itruediv__scalar(self): - with self.assertRaisesRegexp(ArithmeticError, + with self.assertRaisesRegex(ArithmeticError, 'Cannot perform inplace division'): operator.itruediv(self.cube_1u, 5) diff --git a/lib/iris/tests/test_coord_api.py b/lib/iris/tests/test_coord_api.py index c0144b3852..ad964bec51 100644 --- a/lib/iris/tests/test_coord_api.py +++ b/lib/iris/tests/test_coord_api.py @@ -6,7 +6,6 @@ from six.moves import (filter, input, map, range, zip) # noqa -import six # import iris tests first so that some things can be initialised before # importing anything else @@ -340,30 +339,30 @@ def test_bounded(self): def test_dim_coord_restrictions(self): # 1d - with self.assertRaisesRegexp(ValueError, 'must be scalar or 1-dim'): + with self.assertRaisesRegex(ValueError, 'must be scalar or 1-dim'): iris.coords.DimCoord([[1, 2, 3], [4, 5, 6]]) # monotonic points - with self.assertRaisesRegexp(ValueError, 'must be strictly monotonic'): + with self.assertRaisesRegex(ValueError, 'must be strictly monotonic'): iris.coords.DimCoord([1, 2, 99, 4, 5]) # monotonic bounds - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'direction of monotonicity'): iris.coords.DimCoord([1, 2, 3], bounds=[[1, 12], [2, 9], [3, 6]]) # masked points emsg = 'points array must not be masked' - with six.assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): iris.coords.DimCoord(ma.masked_array([0, 1, 2], mask=[0, 1, 0])) # masked bounds emsg = 'bounds array must not be masked' - with six.assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): iris.coords.DimCoord([1], bounds=ma.masked_array([[0, 2]], mask=True)) # shapes of points and bounds msg = "The shape of the 'unknown' DimCoord bounds array should be" - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): iris.coords.DimCoord([1, 2, 3], bounds=[0.5, 1.5, 2.5, 3.5]) # another example of shapes of points and bounds - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): iris.coords.DimCoord([1, 2, 3], bounds=[[0.5, 1.5], [1.5, 2.5]]) # numeric diff --git a/lib/iris/tests/test_coordsystem.py b/lib/iris/tests/test_coordsystem.py index 18603d6c19..fc114871d6 100644 --- a/lib/iris/tests/test_coordsystem.py +++ b/lib/iris/tests/test_coordsystem.py @@ -367,12 +367,12 @@ def test_as_cartopy_projection(self): class Test_LambertConformal(tests.GraphicsTest): def test_fail_secant_latitudes_none(self): emsg = 'one or two secant latitudes required' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): LambertConformal(secant_latitudes=()) def test_fail_secant_latitudes_excessive(self): emsg = 'one or two secant latitudes required' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): LambertConformal(secant_latitudes=(1, 2, 3)) def test_secant_latitudes_single_value(self): diff --git a/lib/iris/tests/test_hybrid.py b/lib/iris/tests/test_hybrid.py index 9193a9988e..99f010cf02 100644 --- a/lib/iris/tests/test_hybrid.py +++ b/lib/iris/tests/test_hybrid.py @@ -144,7 +144,7 @@ def test_bounded_orography(self): with warnings.catch_warnings(): # Cause all warnings to raise Exceptions warnings.simplefilter("error") - with self.assertRaisesRegexp(UserWarning, msg): + with self.assertRaisesRegex(UserWarning, msg): self.cube.coord('altitude') @@ -224,7 +224,7 @@ def test_bounded_surface_pressure(self): with warnings.catch_warnings(): # Cause all warnings to raise Exceptions warnings.simplefilter("error") - with self.assertRaisesRegexp(UserWarning, msg): + with self.assertRaisesRegex(UserWarning, msg): self.cube.coord('air_pressure') if __name__ == "__main__": diff --git a/lib/iris/tests/test_pp_stash.py b/lib/iris/tests/test_pp_stash.py index f03ae8c0dd..6affcee0b1 100644 --- a/lib/iris/tests/test_pp_stash.py +++ b/lib/iris/tests/test_pp_stash.py @@ -99,9 +99,9 @@ def test_illegal_stash_format(self): for (test_value, reference) in test_values: msg = 'Expected STASH code .* {!r}'.format(test_value) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): test_value == iris.fileformats.pp.STASH(*reference) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): iris.fileformats.pp.STASH(*reference) == test_value def test_illegal_stash_type(self): @@ -112,9 +112,9 @@ def test_illegal_stash_type(self): for (test_value, reference) in test_values: msg = 'Expected STASH code .* {!r}'.format(test_value) - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaisesRegex(TypeError, msg): iris.fileformats.pp.STASH.from_msi(test_value) == reference - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaisesRegex(TypeError, msg): reference == iris.fileformats.pp.STASH.from_msi(test_value) def test_stash_lbuser(self): diff --git a/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py b/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py index 510e81eb62..35d903e187 100644 --- a/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py +++ b/lib/iris/tests/unit/analysis/area_weighted/test_AreaWeightedRegridder.py @@ -78,13 +78,13 @@ def test_specified_mdtol(self): def test_invalid_high_mdtol(self): src, target = self.grids() msg = 'mdtol must be in range 0 - 1' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): AreaWeightedRegridder(src, target, mdtol=1.2) def test_invalid_low_mdtol(self): src, target = self.grids() msg = 'mdtol must be in range 0 - 1' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): AreaWeightedRegridder(src, target, mdtol=-0.2) def test_mismatched_src_coord_systems(self): diff --git a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py index 44fdf5640c..78f3f0b97b 100644 --- a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py +++ b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py @@ -110,7 +110,7 @@ def test_too_many_lon_bounds_error(self): [[0, 10, 20]]) def _assert_error_on_malformed_bounds(self, lat_bnds, lon_bnds): - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'Bounds must be \[n,2\] array'): _quadrant_area(np.array(lat_bnds), np.array(lon_bnds), diff --git a/lib/iris/tests/unit/analysis/cartography/test__xy_range.py b/lib/iris/tests/unit/analysis/cartography/test__xy_range.py index abed3eb5da..0251cb94ba 100644 --- a/lib/iris/tests/unit/analysis/cartography/test__xy_range.py +++ b/lib/iris/tests/unit/analysis/cartography/test__xy_range.py @@ -20,7 +20,7 @@ def test_bounds_mismatch(self): cube = stock.realistic_3d() cube.coord('grid_longitude').guess_bounds() - with self.assertRaisesRegexp(ValueError, 'bounds'): + with self.assertRaisesRegex(ValueError, 'bounds'): result_non_circ = _xy_range(cube) def test_non_circular(self): diff --git a/lib/iris/tests/unit/analysis/cartography/test_area_weights.py b/lib/iris/tests/unit/analysis/cartography/test_area_weights.py index 027993b9dc..a8f6e70b50 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_area_weights.py +++ b/lib/iris/tests/unit/analysis/cartography/test_area_weights.py @@ -19,7 +19,7 @@ def test_latitude_no_units(self): cube.coord('longitude').guess_bounds() cube.coord('latitude').guess_bounds() cube.coord('latitude').units = None - with self.assertRaisesRegexp(ValueError, 'Units of degrees or ' + with self.assertRaisesRegex(ValueError, 'Units of degrees or ' 'radians required'): iris.analysis.cartography.area_weights(cube) @@ -28,7 +28,7 @@ def test_longitude_no_units(self): cube.coord('latitude').guess_bounds() cube.coord('longitude').guess_bounds() cube.coord('longitude').units = None - with self.assertRaisesRegexp(ValueError, 'Units of degrees or ' + with self.assertRaisesRegex(ValueError, 'Units of degrees or ' 'radians required'): iris.analysis.cartography.area_weights(cube) diff --git a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py index fe2ac9b675..91879a2584 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py +++ b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py @@ -238,20 +238,20 @@ def test_fail_coords_bad_units(self): co_x, co_y = (self.standard_regional_cube.coord(axis=ax) for ax in ('x', 'y')) co_y.units = 'm' - with self.assertRaisesRegexp(ValueError, 'must have angular units'): + with self.assertRaisesRegex(ValueError, 'must have angular units'): gridcell_angles(co_x, co_y) def test_fail_nonarraylike(self): # Check error with bad args. co_x, co_y = 1, 2 - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'must have array shape property'): gridcell_angles(co_x, co_y) def test_fail_non2d_coords(self): # Check error with bad args. cube = lat_lon_cube() - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'inputs must have 2-dimensional shape'): gridcell_angles(cube) @@ -260,14 +260,14 @@ def test_fail_different_shapes(self): co_x, co_y = (self.standard_regional_cube.coord(axis=ax) for ax in ('x', 'y')) co_y = co_y[1:] - with self.assertRaisesRegexp(ValueError, 'must have same shape'): + with self.assertRaisesRegex(ValueError, 'must have same shape'): gridcell_angles(co_x, co_y) def test_fail_different_coord_system(self): # Check error with mismatched coord systems. cube = sample_2d_latlons(regional=True, rotated=True) cube.coord(axis='x').coord_system = None - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'must have same coordinate system'): gridcell_angles(cube) @@ -282,7 +282,7 @@ def test_fail_cube_dims(self): bounds=bds.transpose((1, 0, 2))) cube.remove_coord(co_x) cube.add_aux_coord(co_new_x, (1, 0)) - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'must have the same cube dimensions'): gridcell_angles(cube) @@ -290,7 +290,7 @@ def test_fail_coord_noncoord(self): # Check that passing a coord + an array gives an error. co_x, co_y = (self.standard_regional_cube.coord(axis=ax) for ax in ('x', 'y')) - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'is a Coordinate, but .* is not'): gridcell_angles(co_x, co_y.bounds) @@ -298,12 +298,12 @@ def test_fail_noncoord_coord(self): # Check that passing an array + a coord gives an error. co_x, co_y = (self.standard_regional_cube.coord(axis=ax) for ax in ('x', 'y')) - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'is a Coordinate, but .* is not'): gridcell_angles(co_x.points, co_y) def test_fail_bad_method(self): - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'unrecognised cell_angle_boundpoints'): self._check_multiple_orientations_and_latitudes( method='something_unknown') diff --git a/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py b/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py index bf29a174d4..88a403e5aa 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py +++ b/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py @@ -76,7 +76,7 @@ class TestPrerequisites(tests.IrisTest): def test_different_coord_systems(self): u, v = uv_cubes() v.coord('grid_latitude').coord_system = iris.coord_systems.GeogCS(1) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( ValueError, 'Coordinates differ between u and v cubes'): rotate_winds(u, v, iris.coord_systems.OSGB()) @@ -84,7 +84,7 @@ def test_different_xy_coord_systems(self): u, v = uv_cubes() u.coord('grid_latitude').coord_system = iris.coord_systems.GeogCS(1) v.coord('grid_latitude').coord_system = iris.coord_systems.GeogCS(1) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( ValueError, 'Coordinate systems of x and y coordinates differ'): rotate_winds(u, v, iris.coord_systems.OSGB()) @@ -94,7 +94,7 @@ def test_different_shape(self): y = np.linspace(-23.6, 24.8, 5) u, _ = uv_cubes(x, y) _, v = uv_cubes(x[:-1], y) - with self.assertRaisesRegexp(ValueError, 'same shape'): + with self.assertRaisesRegex(ValueError, 'same shape'): rotate_winds(u, v, iris.coord_systems.OSGB()) def test_xy_dimensionality(self): @@ -109,7 +109,7 @@ def test_xy_dimensionality(self): cube.remove_coord('grid_latitude') cube.add_aux_coord(lat_2d.copy(), (0, 1)) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( ValueError, 'x and y coordinates must have the same number of dimensions'): rotate_winds(u, v, iris.coord_systems.OSGB()) @@ -119,7 +119,7 @@ def test_dim_mapping(self): y = np.linspace(-23.6, 24.8, 3) u, v = uv_cubes(x, y) v.transpose() - with self.assertRaisesRegexp(ValueError, 'Dimension mapping'): + with self.assertRaisesRegex(ValueError, 'Dimension mapping'): rotate_winds(u, v, iris.coord_systems.OSGB()) diff --git a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py index 428a4a03a4..8033084ef5 100644 --- a/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py +++ b/lib/iris/tests/unit/analysis/interpolation/test_RectilinearInterpolator.py @@ -64,7 +64,7 @@ def test_interpolator_overspecified(self): # mapped to the same dimension. msg = 'Coordinates repeat a data dimension - '\ 'the interpolation would be over-specified' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): RectilinearInterpolator(self.cube, ['wibble', 'height'], LINEAR, EXTRAPOLATE) @@ -76,7 +76,7 @@ def test_interpolator_overspecified_scalar(self): msg = 'Coordinates repeat a data dimension - '\ 'the interpolation would be over-specified' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): RectilinearInterpolator(self.cube, ['wibble', 'scalar'], LINEAR, EXTRAPOLATE) @@ -101,7 +101,7 @@ def test_interpolate_non_monotonic(self): [0, 3, 2], long_name='non-monotonic'), 1) msg = ('Cannot interpolate over the non-monotonic coordinate ' 'non-monotonic.') - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): RectilinearInterpolator(self.cube, ['non-monotonic'], LINEAR, EXTRAPOLATE) @@ -172,12 +172,12 @@ def test_interpolate_data_error_on_extrapolation(self): msg = 'One of the requested xi is out of bounds in dimension 0' interpolator = RectilinearInterpolator(self.cube, ['latitude'], LINEAR, extrapolation_mode='error') - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): interpolator([[-1]]) def test_interpolate_data_unsupported_extrapolation(self): msg = "Extrapolation mode 'unsupported' not supported" - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): RectilinearInterpolator(self.cube, ['latitude'], LINEAR, extrapolation_mode='unsupported') @@ -186,7 +186,7 @@ def test_multi_points_array(self): # i.e. points given for two coordinates where there are only one # specified. msg = 'Expected sample points for 1 coordinates, got 2.' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): self.interpolator([[1, 2], [1]]) def test_interpolate_data_dtype_casting(self): @@ -223,7 +223,7 @@ def test_unsorted_datadim_mapping(self): interpolator = RectilinearInterpolator(self.cube, ['latitude'], LINEAR, EXTRAPOLATE) msg = 'Currently only increasing data_dims is supported.' - with self.assertRaisesRegexp(NotImplementedError, msg): + with self.assertRaisesRegex(NotImplementedError, msg): interpolator([0]) @@ -404,7 +404,7 @@ def test_orthogonal_points(self): def test_multi_dim_coord_interpolation(self): msg = 'Interpolation coords must be 1-d for rectilinear interpolation.' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): interpolator = RectilinearInterpolator(self.cube, ['foo', 'bar'], LINEAR, EXTRAPOLATE) interpolator([[15], [10]]) diff --git a/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py b/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py index 05d15b5d90..16977eb8d1 100644 --- a/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py +++ b/lib/iris/tests/unit/analysis/maths/test__inplace_common_checks.py @@ -67,11 +67,11 @@ def test_float_cube_uint_cube(self): self.assertIsNone(result) def test_int_cube_float_cube(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.int_cube, self.float_cube, self.op) def test_uint_cube_float_cube(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.uint_cube, self.float_cube, self.op) def test_float_cube__scalar_int(self): @@ -110,11 +110,11 @@ def test_uint_cube_uint_cube(self): self.assertIsNone(result) def test_uint_cube_int_cube(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.uint_cube, self.int_cube, self.op) def test_int_cube__scalar_float(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.int_cube, self.scalar_float, self.op) def test_int_cube__int_array(self): @@ -122,19 +122,19 @@ def test_int_cube__int_array(self): self.assertIsNone(result) def test_int_cube__float_array(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.int_cube, self.float_data, self.op) def test_uint_cube__scalar_float(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.uint_cube, self.scalar_float, self.op) def test_uint_cube__int_array(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.uint_cube, self.int_cube, self.op) def test_uint_cube__float_array(self): - with self.assertRaisesRegexp(ArithmeticError, self.emsg): + with self.assertRaisesRegex(ArithmeticError, self.emsg): _inplace_common_checks(self.uint_cube, self.float_data, self.op) diff --git a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py index 6a8035c1b8..1a013a8643 100644 --- a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py @@ -312,7 +312,7 @@ def test_error_ndarray(self): data = np.arange(12, dtype=np.float).reshape(3, 4) data[0, 0] = np.nan for method in self.methods: - with self.assertRaisesRegexp(ValueError, 'out of bounds'): + with self.assertRaisesRegex(ValueError, 'out of bounds'): self._regrid(data, method, 'error') def test_error_maskedarray(self): @@ -321,7 +321,7 @@ def test_error_maskedarray(self): data[0, 0] = np.nan data[2, 3] = ma.masked for method in self.methods: - with self.assertRaisesRegexp(ValueError, 'out of bounds'): + with self.assertRaisesRegex(ValueError, 'out of bounds'): self._regrid(data, method, 'error') def test_mask_ndarray(self): @@ -389,7 +389,7 @@ def test_invalid(self): data = np.arange(12, dtype=np.float).reshape(3, 4) emsg = 'Invalid extrapolation mode' for method in self.methods: - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): self._regrid(data, method, 'BOGUS') def test_method_result_types(self): @@ -731,7 +731,7 @@ def test_different_units(self): for method in self.methods: regridder = Regridder(src, grid, method, self.mode) emsg = 'matching coordinate metadata' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): regridder(src) def test_coord_metadata_mismatch(self): @@ -895,14 +895,14 @@ def test_error_ndarray(self): # Values irrelevant - the function raises an error. for method in self.methods: src = self._ndarray_cube(method) - with self.assertRaisesRegexp(ValueError, 'out of bounds'): + with self.assertRaisesRegex(ValueError, 'out of bounds'): self._regrid(src, method, 'error') def test_error_maskedarray(self): # Values irrelevant - the function raises an error. for method in self.methods: src = self._masked_cube(method) - with self.assertRaisesRegexp(ValueError, 'out of bounds'): + with self.assertRaisesRegex(ValueError, 'out of bounds'): self._regrid(src, method, 'error') def test_mask_ndarray(self): @@ -960,7 +960,7 @@ def test_invalid(self): src = uk_cube() emsg = 'Invalid extrapolation mode' for method in self.methods: - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): self._regrid(src, method, 'BOGUS') diff --git a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py index d54327bb9d..4c8f2d58c0 100644 --- a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py @@ -34,11 +34,11 @@ def setUp(self): self.weights = np.ones(self.src_grid.shape, self.src_grid.dtype) def test_bad_src_type(self): - with self.assertRaisesRegexp(TypeError, "'src_grid_cube'"): + with self.assertRaisesRegex(TypeError, "'src_grid_cube'"): Regridder(self.bad, self.src_grid, self.weights) def test_bad_grid_type(self): - with self.assertRaisesRegexp(TypeError, "'target_grid_cube'"): + with self.assertRaisesRegex(TypeError, "'target_grid_cube'"): Regridder(self.src_grid, self.bad, self.weights) @@ -170,11 +170,11 @@ def setUp(self): self.regridder = Regridder(self.src_grid, self.src_grid, weights) def test_bad_src_type(self): - with self.assertRaisesRegexp(TypeError, 'must be a Cube'): + with self.assertRaisesRegex(TypeError, 'must be a Cube'): self.regridder(np.ones((3, 4))) def test_bad_src_shape(self): - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'not defined on the same source grid'): self.regridder(self.src_grid[::2, ::2]) diff --git a/lib/iris/tests/unit/analysis/test_Aggregator.py b/lib/iris/tests/unit/analysis/test_Aggregator.py index 5ef7b3b88c..5e716b40fa 100644 --- a/lib/iris/tests/unit/analysis/test_Aggregator.py +++ b/lib/iris/tests/unit/analysis/test_Aggregator.py @@ -239,7 +239,7 @@ def test_mdtol_intercept(self): def test_no_lazy_func(self): dummy_agg = Aggregator('custom_op', lambda x: 1) expected = 'custom_op aggregator does not support lazy operation' - with self.assertRaisesRegexp(LazyAggregatorError, expected): + with self.assertRaisesRegex(LazyAggregatorError, expected): dummy_agg.lazy_aggregate(np.arange(10), axis=0) diff --git a/lib/iris/tests/unit/analysis/test_AreaWeighted.py b/lib/iris/tests/unit/analysis/test_AreaWeighted.py index caeb5298ca..e770d72571 100644 --- a/lib/iris/tests/unit/analysis/test_AreaWeighted.py +++ b/lib/iris/tests/unit/analysis/test_AreaWeighted.py @@ -43,12 +43,12 @@ def test_specified_mdtol(self): def test_invalid_high_mdtol(self): msg = 'mdtol must be in range 0 - 1' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): AreaWeighted(mdtol=1.2) def test_invalid_low_mdtol(self): msg = 'mdtol must be in range 0 - 1' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): AreaWeighted(mdtol=-0.2) diff --git a/lib/iris/tests/unit/analysis/test_COUNT.py b/lib/iris/tests/unit/analysis/test_COUNT.py index 8d1aec76f2..bdd5a146e7 100644 --- a/lib/iris/tests/unit/analysis/test_COUNT.py +++ b/lib/iris/tests/unit/analysis/test_COUNT.py @@ -33,15 +33,15 @@ def test_name(self): def test_no_function(self): exp_emsg = r"function must be a callable. Got <.* 'NoneType'>" - with self.assertRaisesRegexp(TypeError, exp_emsg): + with self.assertRaisesRegex(TypeError, exp_emsg): COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0) def test_not_callable(self): - with self.assertRaisesRegexp(TypeError, 'function must be a callable'): + with self.assertRaisesRegex(TypeError, 'function must be a callable'): COUNT.aggregate(self.cube.data, axis=0, function='wibble') def test_lazy_not_callable(self): - with self.assertRaisesRegexp(TypeError, 'function must be a callable'): + with self.assertRaisesRegex(TypeError, 'function must be a callable'): COUNT.lazy_aggregate(self.lazy_cube.lazy_data(), axis=0, function='wibble') diff --git a/lib/iris/tests/unit/analysis/test_Linear.py b/lib/iris/tests/unit/analysis/test_Linear.py index 373dfd0286..cbc964c7d4 100644 --- a/lib/iris/tests/unit/analysis/test_Linear.py +++ b/lib/iris/tests/unit/analysis/test_Linear.py @@ -49,7 +49,7 @@ def test_nanmask(self): self.check_mode('nanmask') def test_invalid(self): - with self.assertRaisesRegexp(ValueError, 'Extrapolation mode'): + with self.assertRaisesRegex(ValueError, 'Extrapolation mode'): Linear('bogus') diff --git a/lib/iris/tests/unit/analysis/test_Nearest.py b/lib/iris/tests/unit/analysis/test_Nearest.py index 09313c2d6c..2765e76e4c 100644 --- a/lib/iris/tests/unit/analysis/test_Nearest.py +++ b/lib/iris/tests/unit/analysis/test_Nearest.py @@ -23,7 +23,7 @@ def create_scheme(mode=None): class Test___init__(tests.IrisTest): def test_invalid(self): - with self.assertRaisesRegexp(ValueError, 'Extrapolation mode'): + with self.assertRaisesRegex(ValueError, 'Extrapolation mode'): Nearest('bogus') diff --git a/lib/iris/tests/unit/analysis/test_PERCENTILE.py b/lib/iris/tests/unit/analysis/test_PERCENTILE.py index 75c9fb23d3..1e4f2ac52d 100644 --- a/lib/iris/tests/unit/analysis/test_PERCENTILE.py +++ b/lib/iris/tests/unit/analysis/test_PERCENTILE.py @@ -20,7 +20,7 @@ class Test_aggregate(tests.IrisTest): def test_missing_mandatory_kwarg(self): emsg = "percentile aggregator requires .* keyword argument 'percent'" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): PERCENTILE.aggregate('dummy', axis=0) def test_1d_single(self): @@ -107,12 +107,12 @@ def test(self): class Test_aggregate_shape(tests.IrisTest): def test_missing_mandatory_kwarg(self): emsg = "percentile aggregator requires .* keyword argument 'percent'" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): PERCENTILE.aggregate_shape() - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): kwargs = dict() PERCENTILE.aggregate_shape(**kwargs) - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): kwargs = dict(point=10) PERCENTILE.aggregate_shape(**kwargs) diff --git a/lib/iris/tests/unit/analysis/test_PercentileAggregator.py b/lib/iris/tests/unit/analysis/test_PercentileAggregator.py index 2711c3601f..1998695817 100644 --- a/lib/iris/tests/unit/analysis/test_PercentileAggregator.py +++ b/lib/iris/tests/unit/analysis/test_PercentileAggregator.py @@ -54,7 +54,7 @@ def setUp(self): def test_missing_mandatory_kwarg(self): aggregator = PercentileAggregator() emsg = "percentile aggregator requires .* keyword argument 'percent'" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): aggregator.aggregate('dummy', axis=0) def test_simple_single_point(self): diff --git a/lib/iris/tests/unit/analysis/test_RMS.py b/lib/iris/tests/unit/analysis/test_RMS.py index 1dfe6f4fb1..39ca5bc06f 100644 --- a/lib/iris/tests/unit/analysis/test_RMS.py +++ b/lib/iris/tests/unit/analysis/test_RMS.py @@ -97,7 +97,7 @@ def test_1d_weighted(self): weights = np.array([1, 4, 3, 2], dtype=np.float64) expected_rms = 8.0 # https://github.com/dask/dask/issues/3846. - with self.assertRaisesRegexp(TypeError, 'unexpected keyword argument'): + with self.assertRaisesRegex(TypeError, 'unexpected keyword argument'): rms = RMS.lazy_aggregate(data, 0, weights=weights) self.assertAlmostEqual(rms, expected_rms) @@ -107,7 +107,7 @@ def test_1d_lazy_weighted(self): weights = as_lazy_data(np.array([1, 4, 3, 2], dtype=np.float64)) expected_rms = 8.0 # https://github.com/dask/dask/issues/3846. - with self.assertRaisesRegexp(TypeError, 'unexpected keyword argument'): + with self.assertRaisesRegex(TypeError, 'unexpected keyword argument'): rms = RMS.lazy_aggregate(data, 0, weights=weights) self.assertAlmostEqual(rms, expected_rms) @@ -118,7 +118,7 @@ def test_2d_weighted(self): weights = np.array([[1, 4, 3, 2], [2, 1, 1.5, 0.5]], dtype=np.float64) expected_rms = np.array([8.0, 16.0], dtype=np.float64) # https://github.com/dask/dask/issues/3846. - with self.assertRaisesRegexp(TypeError, 'unexpected keyword argument'): + with self.assertRaisesRegex(TypeError, 'unexpected keyword argument'): rms = RMS.lazy_aggregate(data, 1, weights=weights) self.assertArrayAlmostEqual(rms, expected_rms) @@ -128,7 +128,7 @@ def test_unit_weighted(self): weights = np.ones_like(data) expected_rms = 4.5 # https://github.com/dask/dask/issues/3846. - with self.assertRaisesRegexp(TypeError, 'unexpected keyword argument'): + with self.assertRaisesRegex(TypeError, 'unexpected keyword argument'): rms = RMS.lazy_aggregate(data, 0, weights=weights) self.assertAlmostEqual(rms, expected_rms) @@ -150,7 +150,7 @@ def test_masked_weighted(self): dtype=np.float64)) weights = np.array([1, 4, 5, 3, 8, 2]) expected_rms = 8.0 - with self.assertRaisesRegexp(TypeError, 'unexpected keyword argument'): + with self.assertRaisesRegex(TypeError, 'unexpected keyword argument'): rms = RMS.lazy_aggregate(data, 0, weights=weights) self.assertAlmostEqual(rms, expected_rms) diff --git a/lib/iris/tests/unit/analysis/test_WPERCENTILE.py b/lib/iris/tests/unit/analysis/test_WPERCENTILE.py index ba417d89c9..f96e4a3e02 100644 --- a/lib/iris/tests/unit/analysis/test_WPERCENTILE.py +++ b/lib/iris/tests/unit/analysis/test_WPERCENTILE.py @@ -21,18 +21,18 @@ class Test_aggregate(tests.IrisTest): def test_missing_mandatory_kwargs(self): emsg = "weighted_percentile aggregator requires " \ ".* keyword argument 'percent'" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): WPERCENTILE.aggregate('dummy', axis=0, weights=None) emsg = "weighted_percentile aggregator requires " \ ".* keyword argument 'weights'" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): WPERCENTILE.aggregate('dummy', axis=0, percent=50) def test_wrong_weights_shape(self): data = np.arange(11) weights = np.ones(10) emsg = "_weighted_percentile: weights wrong shape." - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): WPERCENTILE.aggregate(data, axis=0, percent=50, weights=weights) def test_1d_single(self): @@ -182,20 +182,20 @@ def test_missing_mandatory_kwarg(self): ".* keyword argument 'percent'" emsg_wt = "weighted_percentile aggregator requires " \ ".* keyword argument 'weights'" - with self.assertRaisesRegexp(ValueError, emsg_pc): + with self.assertRaisesRegex(ValueError, emsg_pc): WPERCENTILE.aggregate_shape(weights=None) - with self.assertRaisesRegexp(ValueError, emsg_pc): + with self.assertRaisesRegex(ValueError, emsg_pc): kwargs = dict(weights=None) WPERCENTILE.aggregate_shape(**kwargs) - with self.assertRaisesRegexp(ValueError, emsg_pc): + with self.assertRaisesRegex(ValueError, emsg_pc): kwargs = dict(point=10) WPERCENTILE.aggregate_shape(**kwargs) - with self.assertRaisesRegexp(ValueError, emsg_wt): + with self.assertRaisesRegex(ValueError, emsg_wt): WPERCENTILE.aggregate_shape(percent=50) - with self.assertRaisesRegexp(ValueError, emsg_wt): + with self.assertRaisesRegex(ValueError, emsg_wt): kwargs = dict(percent=50) WPERCENTILE.aggregate_shape(**kwargs) - with self.assertRaisesRegexp(ValueError, emsg_wt): + with self.assertRaisesRegex(ValueError, emsg_wt): kwargs = dict(percent=50, weight=None) WPERCENTILE.aggregate_shape(**kwargs) diff --git a/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py b/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py index f6a917c05c..37a5f5b388 100644 --- a/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py +++ b/lib/iris/tests/unit/analysis/test_WeightedPercentileAggregator.py @@ -57,11 +57,11 @@ def test_missing_mandatory_kwarg(self): aggregator = WeightedPercentileAggregator() emsg = "weighted_percentile aggregator requires " \ ".* keyword argument 'percent'" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): aggregator.aggregate('dummy', axis=0, weights=None) emsg = "weighted_percentile aggregator requires " \ ".* keyword argument 'weights'" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): aggregator.aggregate('dummy', axis=0, percent=50) def test_simple_single_point(self): diff --git a/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py b/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py index 76e04d32cb..2a447b9971 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py @@ -108,31 +108,31 @@ class Test__init__(MixinExampleSetup, tests.IrisTest): def test_fail_no_src_x(self): self.src_cube.remove_coord('longitude') msg_re = 'Source cube must have X- and Y-axis coordinates' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_no_src_y(self): self.src_cube.remove_coord('latitude') msg_re = 'Source cube must have X- and Y-axis coordinates' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_bad_src_dims(self): self.src_cube = self.grid_cube msg_re = 'Source.*same cube dimensions' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_mixed_latlons(self): self.src_cube.coord('longitude').rename('projection_x_coordinate') msg_re = 'any.*latitudes/longitudes.*all must be' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_bad_latlon_units(self): self.grid_cube.coord('longitude').units = 'm' msg_re = 'does not convert to "degrees"' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_non_latlon_units_mismatch(self): @@ -146,33 +146,33 @@ def test_fail_non_latlon_units_mismatch(self): # Change one of the output units. self.grid_cube.coord(axis='x').units = '1' msg_re = 'Source and target.*must have the same units' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_no_tgt_x(self): self.grid_cube.remove_coord('longitude') msg_re = 'must contain a single 1D x coordinate' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_no_tgt_y(self): self.grid_cube.remove_coord('latitude') msg_re = 'must contain a single 1D y coordinate' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_src_cs_mismatch(self): cs = GeogCS(1000.0) self.src_cube.coord('latitude').coord_system = cs msg_re = 'must all have the same coordinate system' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_tgt_cs_mismatch(self): cs = GeogCS(1000.0) self.grid_cube.coord('latitude').coord_system = cs msg_re = 'x.*and y.*must have the same coordinate system' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) def test_fail_src_tgt_cs_mismatch(self): @@ -180,7 +180,7 @@ def test_fail_src_tgt_cs_mismatch(self): self.src_cube.coord('latitude').coord_system = cs self.src_cube.coord('longitude').coord_system = cs msg_re = 'Source and target.*same coordinate system' - with self.assertRaisesRegexp(ValueError, msg_re): + with self.assertRaisesRegex(ValueError, msg_re): unn_gridder(self.src_cube, self.grid_cube) @@ -252,7 +252,7 @@ def test_fail_incompatible_source(self): modified_src_cube.coord(axis='x').points = points gridder = unn_gridder(self.src_cube, self.grid_cube) msg = 'not defined on the same source grid' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): gridder(modified_src_cube) def test_transposed_source(self): diff --git a/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py b/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py index a557727346..7f01d05b5d 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py +++ b/lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py @@ -127,7 +127,7 @@ def test_sample_dictionary(self): cube.add_aux_coord(co_x, 1) sample_point = {'x': 2.8, 'y': 18.5} exp_emsg = 'must be a list of \(coordinate, value\) pairs' - with self.assertRaisesRegexp(TypeError, exp_emsg): + with self.assertRaisesRegex(TypeError, exp_emsg): nn_ndinds(cube, sample_point) diff --git a/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py b/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py index 2e13133e5b..6e001840a6 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_interpolate.py @@ -26,7 +26,7 @@ def test_derived_coord(self): cube = iris.tests.stock.realistic_4d() sample_pts = [('altitude', [0, 10, 50])] msg = "'altitude'.*derived coordinates are not allowed" - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): interpolate(cube, sample_pts, 'nearest') # Try to request unknown interpolation method. @@ -34,7 +34,7 @@ def test_unknown_method(self): cube = iris.tests.stock.simple_2d() sample_point = [('x', 2.8)] msg = 'Unhandled interpolation.*linekar' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): interpolate(cube, sample_point, method="linekar") @@ -149,7 +149,7 @@ def test_aux_coord_fail_mixed_dims(self): (0, 2)) msg = ('Coord aux_0x at one x-y position has the shape.*' 'instead of being a single point') - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): interpolate(cube, self.single_sample_point, method='nearest') def test_metadata(self): diff --git a/lib/iris/tests/unit/concatenate/test_concatenate.py b/lib/iris/tests/unit/concatenate/test_concatenate.py index c535cdd4e7..b5f7453e8e 100644 --- a/lib/iris/tests/unit/concatenate/test_concatenate.py +++ b/lib/iris/tests/unit/concatenate/test_concatenate.py @@ -87,7 +87,7 @@ def test_definition_difference_message(self): cube_2 = cube_1.copy() cube_2.units = '1' exc_regexp = 'Cube metadata differs for phenomenon: *' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_dimensions_difference_message(self): @@ -95,7 +95,7 @@ def test_dimensions_difference_message(self): cube_2 = cube_1.copy() cube_2.remove_coord('latitude') exc_regexp = 'Dimension coordinates differ: .* != .*' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_dimensions_metadata_difference_message(self): @@ -103,7 +103,7 @@ def test_dimensions_metadata_difference_message(self): cube_2 = cube_1.copy() cube_2.coord('latitude').long_name = 'bob' exc_regexp = 'Dimension coordinates metadata differ: .* != .*' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_aux_coords_difference_message(self): @@ -111,7 +111,7 @@ def test_aux_coords_difference_message(self): cube_2 = cube_1.copy() cube_2.remove_coord('foo') exc_regexp = 'Auxiliary coordinates differ: .* != .*' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_aux_coords_metadata_difference_message(self): @@ -119,7 +119,7 @@ def test_aux_coords_metadata_difference_message(self): cube_2 = cube_1.copy() cube_2.coord('foo').units = 'm' exc_regexp = 'Auxiliary coordinates metadata differ: .* != .*' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_scalar_coords_difference_message(self): @@ -127,7 +127,7 @@ def test_scalar_coords_difference_message(self): cube_2 = cube_1.copy() cube_2.remove_coord('height') exc_regexp = 'Scalar coordinates differ: .* != .*' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_scalar_coords_metadata_difference_message(self): @@ -135,7 +135,7 @@ def test_scalar_coords_metadata_difference_message(self): cube_2 = cube_1.copy() cube_2.coord('height').long_name = 'alice' exc_regexp = 'Scalar coordinates metadata differ: .* != .*' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_ndim_difference_message(self): @@ -148,7 +148,7 @@ def test_ndim_difference_message(self): units='degrees') cube_2.add_dim_coord(x_coord, 0) exc_regexp = 'Data dimensions differ: [0-9] != [0-9]' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) def test_datatype_difference_message(self): @@ -156,7 +156,7 @@ def test_datatype_difference_message(self): cube_2 = cube_1.copy() cube_2.data.dtype = np.float64 exc_regexp = 'Data types differ: .* != .*' - with self.assertRaisesRegexp(ConcatenateError, exc_regexp): + with self.assertRaisesRegex(ConcatenateError, exc_regexp): result = concatenate([cube_1, cube_2], True) diff --git a/lib/iris/tests/unit/coord_systems/test_Geostationary.py b/lib/iris/tests/unit/coord_systems/test_Geostationary.py index cd8b11a2b1..0e00e5da9c 100644 --- a/lib/iris/tests/unit/coord_systems/test_Geostationary.py +++ b/lib/iris/tests/unit/coord_systems/test_Geostationary.py @@ -9,8 +9,6 @@ # importing anything else. import iris.tests as tests -import six - import cartopy.crs as ccrs from iris.coord_systems import GeogCS, Geostationary @@ -58,7 +56,7 @@ def test_projection_creation(self): self.assertEqual(res, self.expected) def test_non_zero_lat(self): - with six.assertRaisesRegex(self, ValueError, 'Non-zero latitude'): + with self.assertRaisesRegex(ValueError, 'Non-zero latitude'): Geostationary(0.1, self.longitude_of_projection_origin, self.perspective_point_height, @@ -68,8 +66,8 @@ def test_non_zero_lat(self): self.ellipsoid) def test_invalid_sweep(self): - with six.assertRaisesRegex( - self, ValueError, 'Invalid sweep_angle_axis'): + with self.assertRaisesRegex( + ValueError, 'Invalid sweep_angle_axis'): Geostationary(self.latitude_of_projection_origin, self.longitude_of_projection_origin, self.perspective_point_height, diff --git a/lib/iris/tests/unit/coords/test_AncillaryVariable.py b/lib/iris/tests/unit/coords/test_AncillaryVariable.py index f6fdb1cccd..8f907f5766 100644 --- a/lib/iris/tests/unit/coords/test_AncillaryVariable.py +++ b/lib/iris/tests/unit/coords/test_AncillaryVariable.py @@ -362,7 +362,7 @@ def test_fail_bad_shape(self): # Setting real data requires matching shape. ancill_var = AncillaryVariable([1.0, 2.0]) msg = 'Require data with shape \(2,\), got \(3,\)' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): ancill_var.data = np.array([1.0, 2.0, 3.0]) def test_real_set_lazy(self): diff --git a/lib/iris/tests/unit/coords/test_AuxCoord.py b/lib/iris/tests/unit/coords/test_AuxCoord.py index c077e486f5..853b9a4e3d 100644 --- a/lib/iris/tests/unit/coords/test_AuxCoord.py +++ b/lib/iris/tests/unit/coords/test_AuxCoord.py @@ -95,7 +95,7 @@ def test_fail_bounds_shape_mismatch(self): bds_shape[0] += 1 bds_wrong = np.zeros(bds_shape) msg = 'Bounds shape must be compatible with points shape' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): AuxCoord(self.pts_real, bounds=bds_wrong) def test_no_masked_pts_real(self): @@ -573,7 +573,7 @@ def test_fail_bad_shape(self): # Setting real points requires matching shape. coord = AuxCoord([1.0, 2.0]) msg = 'Require data with shape \(2,\), got \(3,\)' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord.points = np.array([1.0, 2.0, 3.0]) def test_real_set_lazy(self): @@ -649,7 +649,7 @@ def test_fail_bad_shape(self): # Setting real points requires matching shape. coord = AuxCoord(self.pts_real, bounds=self.bds_real) msg = 'must be compatible with points shape' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord.bounds = np.array([1.0, 2.0, 3.0]) def test_set_lazy_bounds(self): diff --git a/lib/iris/tests/unit/coords/test_Cell.py b/lib/iris/tests/unit/coords/test_Cell.py index 5dd9368f84..eec25ad150 100644 --- a/lib/iris/tests/unit/coords/test_Cell.py +++ b/lib/iris/tests/unit/coords/test_Cell.py @@ -21,13 +21,13 @@ class Test___common_cmp__(tests.IrisTest): def assert_raises_on_comparison(self, cell, other, exception_type, regexp): - with self.assertRaisesRegexp(exception_type, regexp): + with self.assertRaisesRegex(exception_type, regexp): cell < other - with self.assertRaisesRegexp(exception_type, regexp): + with self.assertRaisesRegex(exception_type, regexp): cell <= other - with self.assertRaisesRegexp(exception_type, regexp): + with self.assertRaisesRegex(exception_type, regexp): cell > other - with self.assertRaisesRegexp(exception_type, regexp): + with self.assertRaisesRegex(exception_type, regexp): cell >= other def test_cftime_cell(self): @@ -102,7 +102,7 @@ def test_datetimelike_bounded_cell(self): cell = Cell(point=object(), bound=[mock.Mock(timetuple=mock.Mock()), mock.Mock(timetuple=mock.Mock())]) - with self.assertRaisesRegexp(TypeError, 'bounded region for datetime'): + with self.assertRaisesRegex(TypeError, 'bounded region for datetime'): cell == other def test_PartialDateTime_other(self): @@ -119,13 +119,13 @@ def test_datetimelike_bounded_cell(self): cell = Cell(point=object(), bound=[mock.Mock(timetuple=mock.Mock()), mock.Mock(timetuple=mock.Mock())]) - with self.assertRaisesRegexp(TypeError, 'bounded region for datetime'): + with self.assertRaisesRegex(TypeError, 'bounded region for datetime'): cell.contains_point(point) def test_datetimelike_point(self): point = mock.Mock(timetuple=mock.Mock()) cell = Cell(point=object(), bound=[object(), object()]) - with self.assertRaisesRegexp(TypeError, 'bounded region for datetime'): + with self.assertRaisesRegex(TypeError, 'bounded region for datetime'): cell.contains_point(point) diff --git a/lib/iris/tests/unit/coords/test_CellMeasure.py b/lib/iris/tests/unit/coords/test_CellMeasure.py index 8b08226a04..49a3118a24 100644 --- a/lib/iris/tests/unit/coords/test_CellMeasure.py +++ b/lib/iris/tests/unit/coords/test_CellMeasure.py @@ -27,7 +27,7 @@ def setUp(self): def test_invalid_measure(self): msg = "measure must be 'area' or 'volume', not length" - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): self.measure.measure = 'length' def test_set_measure(self): @@ -61,7 +61,7 @@ def test_set_data__lazy(self): def test_data_different_shape(self): new_vals = np.array((1., 2., 3.)) msg = 'Require data with shape.' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): self.measure.data = new_vals def test_shape(self): diff --git a/lib/iris/tests/unit/coords/test_CellMethod.py b/lib/iris/tests/unit/coords/test_CellMethod.py index dd7ea0b990..5fb07d1002 100644 --- a/lib/iris/tests/unit/coords/test_CellMethod.py +++ b/lib/iris/tests/unit/coords/test_CellMethod.py @@ -48,7 +48,7 @@ def test_coord_var_name(self): def test_coord_var_name_fail(self): token = 'var name' # includes space emsg = 'is not a valid NetCDF variable name' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): Coord(1, var_name=token) def test_coord_stash(self): diff --git a/lib/iris/tests/unit/coords/test_Coord.py b/lib/iris/tests/unit/coords/test_Coord.py index 4bda190ca4..ddc3dd4dd2 100644 --- a/lib/iris/tests/unit/coords/test_Coord.py +++ b/lib/iris/tests/unit/coords/test_Coord.py @@ -14,7 +14,6 @@ import dask.array as da import numpy as np -import six import iris from iris.coords import DimCoord, AuxCoord, Coord @@ -426,13 +425,13 @@ def test_1d_coord_no_bounds_warning(self): with warnings.catch_warnings(): # Cause all warnings to raise Exceptions warnings.simplefilter("error") - with self.assertRaisesRegexp(Warning, msg): + with self.assertRaisesRegex(Warning, msg): coord.contiguous_bounds() def test_2d_coord_no_bounds_error(self): coord = AuxCoord(np.array([[0, 0], [5, 5]]), standard_name='latitude') emsg = 'Guessing bounds of 2D coords is not currently supported' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): coord.contiguous_bounds() def test__sanity_check_bounds_call(self): @@ -677,7 +676,7 @@ def test_coord_1d_no_bounds(self): coord = iris.coords.DimCoord([0, 1], standard_name='latitude') emsg = "Contiguous bounds are only defined for 1D coordinates with " \ "2 bounds." - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): coord._sanity_check_bounds() def test_coord_1d_1_bounds(self): @@ -685,7 +684,7 @@ def test_coord_1d_1_bounds(self): bounds=np.array([[0], [1]])) emsg = "Contiguous bounds are only defined for 1D coordinates with " \ "2 bounds." - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): coord._sanity_check_bounds() def test_coord_2d_4_bounds(self): @@ -700,7 +699,7 @@ def test_coord_2d_no_bounds(self): standard_name='latitude') emsg = "Contiguous bounds are only defined for 2D coordinates with " \ "4 bounds." - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): coord._sanity_check_bounds() def test_coord_2d_2_bounds(self): @@ -709,7 +708,7 @@ def test_coord_2d_2_bounds(self): bounds=np.array([[[0, 1], [0, 1]], [[1, 2], [1, 2]]])) emsg = "Contiguous bounds are only defined for 2D coordinates with " \ "4 bounds." - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): coord._sanity_check_bounds() def test_coord_3d(self): @@ -717,7 +716,7 @@ def test_coord_3d(self): standard_name='height') emsg = "Contiguous bounds are not defined for coordinates with more " \ "than 2 dimensions." - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): coord._sanity_check_bounds() @@ -726,7 +725,7 @@ def test_convert_unknown_units(self): coord = iris.coords.AuxCoord(1, units='unknown') emsg = ('Cannot convert from unknown units. ' 'The "units" attribute may be set directly.') - with self.assertRaisesRegexp(UnitConversionError, emsg): + with self.assertRaisesRegex(UnitConversionError, emsg): coord.convert_units('degrees') @@ -786,14 +785,14 @@ def test_create(self): self.assertTrue(coord.climatological) def test_create_no_bounds_no_set(self): - with six.assertRaisesRegex(self, ValueError, + with self.assertRaisesRegex(ValueError, 'Cannot set.*no bounds exist'): AuxCoord(points=[0, 1], units='days since 1970-01-01', climatological=True) def test_create_no_time_no_set(self): emsg = 'Cannot set climatological .* valid time reference units.*' - with six.assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): AuxCoord(points=[0, 1], bounds=[[0, 1], [1, 2]], climatological=True) @@ -803,14 +802,14 @@ def test_absent(self): def test_absent_no_bounds_no_set(self): coord = AuxCoord(points=[0, 1], units='days since 1970-01-01') - with six.assertRaisesRegex(self, ValueError, + with self.assertRaisesRegex(ValueError, 'Cannot set.*no bounds exist'): coord.climatological = True def test_absent_no_time_no_set(self): coord = AuxCoord(points=[0, 1], bounds=[[0, 1], [1, 2]]) emsg = 'Cannot set climatological .* valid time reference units.*' - with six.assertRaisesRegex(self, TypeError, emsg): + with self .assertRaisesRegex(self, TypeError, emsg): coord.climatological = True def test_absent_no_bounds_unset(self): diff --git a/lib/iris/tests/unit/coords/test_DimCoord.py b/lib/iris/tests/unit/coords/test_DimCoord.py index d16d380f2d..31a2e82847 100644 --- a/lib/iris/tests/unit/coords/test_DimCoord.py +++ b/lib/iris/tests/unit/coords/test_DimCoord.py @@ -10,7 +10,6 @@ but can only be tested on concrete instances (DimCoord or AuxCoord). """ -import six # Import iris.tests first so that some things can be initialised before # importing anything else. @@ -67,12 +66,12 @@ def test_fail_bounds_shape_mismatch(self): bds_shape[0] += 1 bds_wrong = np.zeros(bds_shape) msg = "The shape of the 'unknown' DimCoord bounds array should be" - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): DimCoord(self.pts_real, bounds=bds_wrong) def test_fail_nonmonotonic(self): msg = 'must be strictly monotonic' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): DimCoord([1, 2, 0, 3]) def test_no_masked_pts_real(self): @@ -99,7 +98,7 @@ def test_masked_pts_real(self): self.assertTrue(ma.isMaskedArray(data)) self.assertTrue(ma.count_masked(data)) emsg = 'points array must not be masked' - with six.assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): DimCoord(data) def test_masked_pts_lazy(self): @@ -108,7 +107,7 @@ def test_masked_pts_lazy(self): self.assertTrue(ma.isMaskedArray(computed)) self.assertTrue(ma.count_masked(computed)) emsg = 'points array must not be masked' - with six.assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): DimCoord(data) def test_no_masked_bds_real(self): @@ -135,7 +134,7 @@ def test_masked_bds_real(self): self.assertTrue(ma.isMaskedArray(data)) self.assertTrue(ma.count_masked(data)) emsg = 'bounds array must not be masked' - with six.assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): DimCoord(self.pts_real, bounds=data) def test_masked_bds_lazy(self): @@ -144,7 +143,7 @@ def test_masked_bds_lazy(self): self.assertTrue(ma.isMaskedArray(computed)) self.assertTrue(ma.count_masked(computed)) emsg = 'bounds array must not be masked' - with six.assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): DimCoord(self.pts_real, bounds=data) @@ -391,16 +390,16 @@ def test_writable_points(self): coord2 = coord1.copy() msg = 'destination is read-only' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord1.points[:] = 0 - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord2.points[:] = 0 - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord1.bounds[:] = 0 - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord2.bounds[:] = 0 def test_realdata_readonly(self): @@ -413,12 +412,12 @@ def test_realdata_readonly(self): copied_points = copied_coord.core_points() expected_error_msg = 'output array is read-only' - with self.assertRaisesRegexp(ValueError, expected_error_msg): + with self.assertRaisesRegex(ValueError, expected_error_msg): copied_points[:1] += 33 if bounds_type_name != 'no': copied_bounds = copied_coord.core_bounds() - with self.assertRaisesRegexp(ValueError, expected_error_msg): + with self.assertRaisesRegex(ValueError, expected_error_msg): copied_bounds[:1] += 33 @@ -454,7 +453,7 @@ def test_fail_bad_shape(self): points = [1.0, 2.0] coord = DimCoord(points) msg = 'Require data with shape \(2,\), got \(3,\)' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord.points = np.array([1.0, 2.0, 3.0]) self.assertArrayEqual(coord.points, points) @@ -462,7 +461,7 @@ def test_fail_not_monotonic(self): # Setting real points requires that they are monotonic. coord = DimCoord(self.pts_real, bounds=self.bds_real) msg = 'strictly monotonic' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord.points = np.array([3.0, 1.0, 2.0]) self.assertArrayEqual(coord.points, self.pts_real) @@ -513,7 +512,7 @@ def test_fail_bad_shape(self): # Setting real points requires matching shape. coord = DimCoord(self.pts_real, bounds=self.bds_real) msg = "The shape of the 'unknown' DimCoord bounds array should be" - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord.bounds = np.array([1.0, 2.0, 3.0]) self.assertArrayEqual(coord.bounds, self.bds_real) @@ -521,7 +520,7 @@ def test_fail_not_monotonic(self): # Setting real bounds requires that they are monotonic. coord = DimCoord(self.pts_real, bounds=self.bds_real) msg = 'strictly monotonic' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): coord.bounds = np.array([[3.0, 2.0], [1.0, 0.0], [2.0, 1.0]]) self.assertArrayEqual(coord.bounds, self.bds_real) diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index a0cb33e214..c0d18173b1 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -784,7 +784,7 @@ def test_1d_slice_dimension_given(self): self.assertEqual(res_cube, expected) def test_1d_slice_nonexistent_dimension_given(self): - with self.assertRaisesRegexp(ValueError, 'iterator over a dimension'): + with self.assertRaisesRegex(ValueError, 'iterator over a dimension'): res = self.cube.slices_over(self.cube.ndim + 1) def test_2d_slice_coord_given(self): @@ -842,7 +842,7 @@ def test_2d_slice_reversed_dimension_given(self): self.assertEqual(next(res), expected) def test_2d_slice_nonexistent_dimension_given(self): - with self.assertRaisesRegexp(ValueError, 'iterator over a dimension'): + with self.assertRaisesRegex(ValueError, 'iterator over a dimension'): res = self.cube.slices_over([0, self.cube.ndim + 1]) def test_multidim_slice_coord_given(self): @@ -1698,7 +1698,7 @@ def test_error_for_add_invalid_aux_factory(self): factory = HybridHeightFactory(delta=delta, sigma=sigma, orography=orog) expected_error = ("foo coordinate for factory is not present on cube " "bar") - with self.assertRaisesRegexp(ValueError, expected_error): + with self.assertRaisesRegex(ValueError, expected_error): cube.add_aux_factory(factory) @@ -1919,7 +1919,7 @@ def test_lazy_data__transpose_order_ndarray(self): def test_bad_transpose_order(self): exp_emsg = 'Incorrect number of dimensions' - with self.assertRaisesRegexp(ValueError, exp_emsg): + with self.assertRaisesRegex(ValueError, exp_emsg): self.cube.transpose([1]) def test_dim_coords(self): @@ -1959,7 +1959,7 @@ def test_convert_unknown_units(self): cube = iris.cube.Cube(1) emsg = ('Cannot convert from unknown units. ' 'The "cube.units" attribute may be set directly.') - with self.assertRaisesRegexp(UnitConversionError, emsg): + with self.assertRaisesRegex(UnitConversionError, emsg): cube.convert_units('mm day-1') def test_preserves_lazy(self): diff --git a/lib/iris/tests/unit/cube/test_CubeList.py b/lib/iris/tests/unit/cube/test_CubeList.py index bee5c4be2f..dc39a339fb 100644 --- a/lib/iris/tests/unit/cube/test_CubeList.py +++ b/lib/iris/tests/unit/cube/test_CubeList.py @@ -49,7 +49,7 @@ def test_fail(self): def test_empty(self): exc_regexp = "can't concatenate an empty CubeList" - with self.assertRaisesRegexp(ValueError, exc_regexp): + with self.assertRaisesRegex(ValueError, exc_regexp): CubeList([]).concatenate_cube() diff --git a/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py b/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py index f095afaf41..632906eb92 100644 --- a/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py +++ b/lib/iris/tests/unit/cube_coord_common/test_CFVariableMixin.py @@ -127,7 +127,7 @@ def test_token_default(self): def test_fail_token_default(self): emsg = 'Cannot retrieve a valid name token' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): self.cf_var.name(default='_nope', token=True) @@ -140,7 +140,7 @@ def test_valid_standard_name(self): def test_invalid_standard_name(self): cf_var = CFVariableMixin() emsg = "'not_a_standard_name' is not a valid standard_name" - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): cf_var.standard_name = 'not_a_standard_name' def test_none_standard_name(self): diff --git a/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py b/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py index 87aca5ddef..fe3fd3f8dc 100644 --- a/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py +++ b/lib/iris/tests/unit/cube_coord_common/test_get_valid_standard_name.py @@ -25,7 +25,7 @@ def test_valid_standard_name(self): def test_invalid_standard_name(self): name = 'not_a_standard_name' - with self.assertRaisesRegexp(ValueError, self.emsg.format(name)): + with self.assertRaisesRegex(ValueError, self.emsg.format(name)): get_valid_standard_name(name) def test_valid_standard_name_valid_modifier(self): @@ -38,17 +38,17 @@ def test_valid_standard_name_valid_modifier_extra_spaces(self): def test_invalid_standard_name_valid_modifier(self): name = 'not_a_standard_name standard_error' - with self.assertRaisesRegexp(ValueError, self.emsg.format(name)): + with self.assertRaisesRegex(ValueError, self.emsg.format(name)): get_valid_standard_name(name) def test_valid_standard_invalid_name_modifier(self): name = 'air_temperature extra_names standard_error' - with self.assertRaisesRegexp(ValueError, self.emsg.format(name)): + with self.assertRaisesRegex(ValueError, self.emsg.format(name)): get_valid_standard_name(name) def test_valid_standard_valid_name_modifier_extra_names(self): name = 'air_temperature standard_error extra words' - with self.assertRaisesRegexp(ValueError, self.emsg.format(name)): + with self.assertRaisesRegex(ValueError, self.emsg.format(name)): get_valid_standard_name(name) diff --git a/lib/iris/tests/unit/data_manager/test_DataManager.py b/lib/iris/tests/unit/data_manager/test_DataManager.py index 3617674228..1fd426c659 100644 --- a/lib/iris/tests/unit/data_manager/test_DataManager.py +++ b/lib/iris/tests/unit/data_manager/test_DataManager.py @@ -28,7 +28,7 @@ def test(self): dm = DataManager(np.array(0)) emsg = 'Shallow-copy of {!r} is not permitted.' name = type(dm).__name__ - with self.assertRaisesRegexp(copy.Error, emsg.format(name)): + with self.assertRaisesRegex(copy.Error, emsg.format(name)): copy.copy(dm) @@ -173,13 +173,13 @@ def setUp(self): def test_array_none(self): self.dm._real_array = None emsg = 'Unexpected data state, got no lazy and no real data' - with self.assertRaisesRegexp(AssertionError, emsg): + with self.assertRaisesRegex(AssertionError, emsg): self.dm._assert_axioms() def test_array_all(self): self.dm._lazy_array = self.lazy_array emsg = 'Unexpected data state, got lazy and real data' - with self.assertRaisesRegexp(AssertionError, emsg): + with self.assertRaisesRegex(AssertionError, emsg): self.dm._assert_axioms() @@ -235,25 +235,25 @@ def test_lazy_with_lazy(self): def test_real_with_real_failure(self): dm = DataManager(self.real_array) emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): dm._deepcopy(self.memo, data=np.array(0)) def test_real_with_lazy_failure(self): dm = DataManager(self.real_array) emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): dm._deepcopy(self.memo, data=as_lazy_data(np.array(0))) def test_lazy_with_real_failure(self): dm = DataManager(as_lazy_data(self.real_array)) emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): dm._deepcopy(self.memo, data=np.array(0)) def test_lazy_with_lazy_failure(self): dm = DataManager(as_lazy_data(self.real_array)) emsg = 'Cannot copy' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): dm._deepcopy(self.memo, data=as_lazy_data(np.array(0))) @@ -411,7 +411,7 @@ def test_zero_ndim_lazy_to_scalar_1d_lazy_promote(self): def test_scalar_1d_to_zero_ndim_fail(self): dm = DataManager(np.array([123])) emsg = 'Require data with shape \(1,\), got \(\).' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): dm.data = 456 def test_nd_real_to_nd_real(self): diff --git a/lib/iris/tests/unit/experimental/stratify/test_relevel.py b/lib/iris/tests/unit/experimental/stratify/test_relevel.py index ec51cdd8c6..634bea771e 100644 --- a/lib/iris/tests/unit/experimental/stratify/test_relevel.py +++ b/lib/iris/tests/unit/experimental/stratify/test_relevel.py @@ -44,13 +44,13 @@ def setUp(self): def test_broadcast_fail_src_levels(self): emsg = 'Cannot broadcast the cube and src_levels' data = np.arange(60).reshape(3, 4, 5) - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): relevel(self.cube, AuxCoord(data), [1, 2, 3]) def test_broadcast_fail_tgt_levels(self): emsg = 'Cannot broadcast the cube and tgt_levels' data = np.arange(60).reshape(3, 4, 5) - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): relevel(self.cube, self.coord, data) def test_standard_input(self): diff --git a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py index 39e65d18d6..18546c91c4 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py +++ b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py @@ -301,7 +301,7 @@ def test_lbpack_unsupported(self): mock_field = _DummyField(lbext=10, lblrec=200, lbnrec=-1, raw_lbpack=1239, lbuser=[_INTEGER], boundary_packing=None) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( NotYetImplementedError, 'PP fields with LBPACK of 1239 are not supported.'): self._test(mock_field, None, None) @@ -322,7 +322,7 @@ def test_lbc_wgdos_unsupported(self): lbuser=[_REAL], # Anything not None will do here. boundary_packing=0) - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'packed LBC data is not supported'): self._test(mock_field, None, None) @@ -414,14 +414,14 @@ def test__basic(self): def test__bad_lbtim(self): self.mock_field.lbtim = 717 ff2pp = FF2PP('dummy_filename') - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'LBTIM of 717, expected only 0 or 11'): ff2pp._adjust_field_for_lbc(self.mock_field) def test__bad_lbvc(self): self.mock_field.lbvc = 312 ff2pp = FF2PP('dummy_filename') - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'LBVC of 312, expected only 0 or 65'): ff2pp._adjust_field_for_lbc(self.mock_field) @@ -465,7 +465,7 @@ def test__lbhem_too_small(self): ff2pp = FF2PP('dummy_filename') field = self.mock_field field.lbhem = 100 - with self.assertRaisesRegexp( + with self.assertRaisesRegex( ValueError, 'hence >= 101'): _ = list(ff2pp._fields_over_all_levels(field)) @@ -474,7 +474,7 @@ def test__lbhem_too_large(self): ff2pp = FF2PP('dummy_filename') field = self.mock_field field.lbhem = 105 - with self.assertRaisesRegexp( + with self.assertRaisesRegex( ValueError, 'more than the total number of levels in the file = 3'): _ = list(ff2pp._fields_over_all_levels(field)) diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py index e37086abbb..c284742b8d 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py @@ -595,7 +595,7 @@ def test_valid_range_unsigned_int8_data_signed_range(self): def test_valid_range_cannot_coerce(self): value = np.array([1.5, 2.5], dtype='float64') msg = '"valid_range" is not of a suitable value' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): self.check_attribute_compliance_call(value) def test_valid_range_not_numpy_array(self): @@ -627,7 +627,7 @@ def test_valid_range_unsigned_int8_data_signed_range(self): def test_valid_range_cannot_coerce(self): value = np.array(1.5, dtype='float64') msg = '"valid_min" is not of a suitable value' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): self.check_attribute_compliance_call(value) def test_valid_range_not_numpy_array(self): @@ -659,7 +659,7 @@ def test_valid_range_unsigned_int8_data_signed_range(self): def test_valid_range_cannot_coerce(self): value = np.array(2.5, dtype='float64') msg = '"valid_max" is not of a suitable value' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): self.check_attribute_compliance_call(value) def test_valid_range_not_numpy_array(self): @@ -680,7 +680,7 @@ def test_valid_range_and_valid_min_valid_max_provided(self): self.container.attributes['valid_min'] = [1] msg = 'Both "valid_range" and "valid_min"' with Saver(mock.Mock(), 'NETCDF4') as saver: - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): saver.check_attribute_compliance(self.container, self.data) @@ -938,7 +938,7 @@ def test_masked_data__insitu(self): # Test that the error is raised in the right place. with self.temp_filename('.nc') as nc_path: saver = Saver(nc_path, 'NETCDF4') - with self.assertRaisesRegexp(ValueError, self.exp_emsg): + with self.assertRaisesRegex(ValueError, self.exp_emsg): saver._create_cf_cell_measure_variable(self.cube, self.names_map, self.cm) @@ -947,7 +947,7 @@ def test_masked_data__save_pipeline(self): # Test that the right error is raised by the saver pipeline. with self.temp_filename('.nc') as nc_path: with Saver(nc_path, 'NETCDF4') as saver: - with self.assertRaisesRegexp(ValueError, self.exp_emsg): + with self.assertRaisesRegex(ValueError, self.exp_emsg): saver.write(self.cube) diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py index b088ecd528..81fba69603 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py @@ -128,7 +128,7 @@ def test_bad_calendar(self): # Test against a date with year=0, which requires calendar correction. test_date = nc_datetime(0, 1, 1) # Check that this causes an error. - with self.assertRaisesRegexp(ValueError, 'unrecognised calendar'): + with self.assertRaisesRegex(ValueError, 'unrecognised calendar'): epoch_hours_call(hrs_unit, test_date) diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py index f94a487c21..06a62d3720 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py @@ -40,7 +40,7 @@ def test_nochange(self): def test_bad_dimensions(self): points = np.array([[1, 2, 3], [4, 5, 6]]) - with self.assertRaisesRegexp(ValueError, 'Length'): + with self.assertRaisesRegex(ValueError, 'Length'): _reshape_vector_args([(points, (0, 1, 2))]) def test_scalar(self): diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py index 3d7ddcb253..7d74d37929 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_reorder_bounds_data.py @@ -47,7 +47,7 @@ def test_different_dim_names(self): cf_bounds_var = mock.Mock(dimensions=('foo', 'bar', 'nv'), cf_name='wibble_bnds') cf_coord_var = mock.Mock(dimensions=('x', 'y'), cf_name='wibble') - with self.assertRaisesRegexp(ValueError, 'dimension names'): + with self.assertRaisesRegex(ValueError, 'dimension names'): reorder_bounds_data(bounds_data, cf_bounds_var, cf_coord_var) diff --git a/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py b/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py index c02ddd6925..0156401af3 100644 --- a/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py +++ b/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py @@ -179,7 +179,7 @@ def test_orig_array_and_target_shape_inconsistent(self): orig = np.array([1, 1, 2, 2, 3, 3]) msg = 'Original array and target shape do not match up.' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): struct.nd_array_and_dims(orig, (2, 3, 2), order=self.order) def test_array_bigger_than_expected(self): diff --git a/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py b/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py index 68f0e90a45..f425249cb0 100644 --- a/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py +++ b/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py @@ -37,7 +37,7 @@ class TestGroupStructure_from_component_arrays(tests.IrisTest): def test_different_sizes(self): arrays = {'a': np.arange(6), 'b': np.arange(5)} msg = 'All array elements must have the same size.' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): GroupStructure.from_component_arrays(arrays) def test_structure_creation(self): diff --git a/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py b/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py index 3d06739999..392c7c83fe 100644 --- a/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py +++ b/lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py @@ -72,7 +72,7 @@ def test_1d_actuals(self): def test_actuals_mismatch_fail(self): elements = [('a', np.array([1, 2, 4]))] actual_values = [('b', np.array([7, 3, 9]))] - with self.assertRaisesRegexp(ValueError, 'Names.* do not match.*'): + with self.assertRaisesRegex(ValueError, 'Names.* do not match.*'): shape, primaries, elems_and_dims = optimal_array_structure( elements, actual_values) diff --git a/lib/iris/tests/unit/io/test_expand_filespecs.py b/lib/iris/tests/unit/io/test_expand_filespecs.py index d2b3f5c27d..d1f1c16219 100644 --- a/lib/iris/tests/unit/io/test_expand_filespecs.py +++ b/lib/iris/tests/unit/io/test_expand_filespecs.py @@ -67,7 +67,7 @@ def test_return_order(self): def test_no_files_found(self): msg = r'\/no_exist.txt\" didn\'t match any files' - with self.assertRaisesRegexp(IOError, msg): + with self.assertRaisesRegex(IOError, msg): iio.expand_filespecs([os.path.join(self.tmpdir, 'no_exist.txt')]) def test_files_and_none(self): diff --git a/lib/iris/tests/unit/io/test_run_callback.py b/lib/iris/tests/unit/io/test_run_callback.py index 3ff61499f3..75451fe5e0 100644 --- a/lib/iris/tests/unit/io/test_run_callback.py +++ b/lib/iris/tests/unit/io/test_run_callback.py @@ -47,7 +47,7 @@ def test_bad_callback_return_type(self): # Check that a TypeError is raised with a bad callback return value. def callback(cube, field, fname): return iris.cube.CubeList() - with self.assertRaisesRegexp(TypeError, + with self.assertRaisesRegex(TypeError, 'Callback function returned an ' 'unhandled data type.'): iris.io.run_callback(callback, None, None, None) @@ -57,7 +57,7 @@ def test_bad_signature(self): # signature. def callback(cube): pass - with self.assertRaisesRegexp(TypeError, + with self.assertRaisesRegex(TypeError, # exactly == Py2, positional == Py3 'takes (exactly )?1 (positional )?' 'argument '): diff --git a/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py b/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py index 7d7b95933f..5a5055c3d8 100644 --- a/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py +++ b/lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py @@ -55,7 +55,7 @@ def test_1d_discontigous_unmasked(self): data = ma.array(np.array([278, 300, 282]), mask=[1, 0, 0]) msg = 'coordinate are not contiguous and data is not masked where ' \ 'the discontiguity occurs' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): _check_bounds_contiguity_and_mask(coord, data, atol=1e-3) def test_2d_contiguous(self): @@ -90,7 +90,7 @@ def test_2d_discontigous_unmasked(self): make_bounds_discontiguous_at_point(cube, 3, 4) msg = 'coordinate are not contiguous' cube.data[3, 4] = ma.nomask - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): _check_bounds_contiguity_and_mask(cube.coord('longitude'), cube.data) diff --git a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py index cc72650af5..d81bd8f548 100644 --- a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py +++ b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py @@ -70,7 +70,7 @@ def test_2d_coords_as_integers(self): def test_span_check(self): cube = hybrid_height() emsg = 'don\'t span the 2 data dimensions' - with self.assertRaisesRegexp(ValueError, emsg): + with self.assertRaisesRegex(ValueError, emsg): iplt._get_plot_defn_custom_coords_picked( cube, ('sigma', 'level_height'), POINT_MODE) diff --git a/lib/iris/tests/unit/test_Future.py b/lib/iris/tests/unit/test_Future.py index 1b99257a74..b47f75989c 100644 --- a/lib/iris/tests/unit/test_Future.py +++ b/lib/iris/tests/unit/test_Future.py @@ -54,7 +54,7 @@ def test_deprecated_error(self): future = patched_future(deprecated=True, error=True) exp_emsg = \ "'Future' property 'example_future_flag' has been deprecated" - with self.assertRaisesRegexp(AttributeError, exp_emsg): + with self.assertRaisesRegex(AttributeError, exp_emsg): future.example_future_flag = False def test_invalid_attribute(self): diff --git a/lib/iris/tests/unit/test_sample_data_path.py b/lib/iris/tests/unit/test_sample_data_path.py index 21578ebeba..1ee8a74ce7 100644 --- a/lib/iris/tests/unit/test_sample_data_path.py +++ b/lib/iris/tests/unit/test_sample_data_path.py @@ -47,13 +47,13 @@ def test_call(self): def test_file_not_found(self): with mock.patch('iris_sample_data.path', self.sample_dir): - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'Sample data .* not found'): sample_data_path('foo') def test_file_absolute(self): with mock.patch('iris_sample_data.path', self.sample_dir): - with self.assertRaisesRegexp(ValueError, 'Absolute path'): + with self.assertRaisesRegex(ValueError, 'Absolute path'): sample_data_path(os.path.abspath('foo')) def test_glob_ok(self): @@ -66,20 +66,20 @@ def test_glob_ok(self): def test_glob_not_found(self): with mock.patch('iris_sample_data.path', self.sample_dir): - with self.assertRaisesRegexp(ValueError, + with self.assertRaisesRegex(ValueError, 'Sample data .* not found'): sample_data_path('foo.*') def test_glob_absolute(self): with mock.patch('iris_sample_data.path', self.sample_dir): - with self.assertRaisesRegexp(ValueError, 'Absolute path'): + with self.assertRaisesRegex(ValueError, 'Absolute path'): sample_data_path(os.path.abspath('foo.*')) class TestIrisSampleDataMissing(tests.IrisTest): def test_no_iris_sample_data(self): self.patch('iris.iris_sample_data', None) - with self.assertRaisesRegexp(ImportError, 'Please install'): + with self.assertRaisesRegex(ImportError, 'Please install'): sample_data_path('') diff --git a/lib/iris/tests/unit/tests/test_IrisTest.py b/lib/iris/tests/unit/tests/test_IrisTest.py index 30b1ca83f9..edec773a54 100644 --- a/lib/iris/tests/unit/tests/test_IrisTest.py +++ b/lib/iris/tests/unit/tests/test_IrisTest.py @@ -90,7 +90,7 @@ def test_masked_nonmasked_same(self): def test_masked_nonmasked_different(self): arr1 = np.ma.masked_array([1, 2]) arr2 = np.array([1, 3]) - with self.assertRaisesRegexp(AssertionError, 'Arrays are not equal'): + with self.assertRaisesRegex(AssertionError, 'Arrays are not equal'): self.assertMaskedArrayEqual(arr1, arr2) def test_nonmasked_masked_same(self): diff --git a/lib/iris/tests/unit/util/test__coord_regular.py b/lib/iris/tests/unit/util/test__coord_regular.py index 8efd5cc748..ae33df53d8 100644 --- a/lib/iris/tests/unit/util/test__coord_regular.py +++ b/lib/iris/tests/unit/util/test__coord_regular.py @@ -65,20 +65,20 @@ def test_basic(self): def test_2d_coord(self): coord = AuxCoord(np.arange(8).reshape(2, 4)) exp_emsg = 'Expected 1D coord' - with self.assertRaisesRegexp(CoordinateMultiDimError, exp_emsg): + with self.assertRaisesRegex(CoordinateMultiDimError, exp_emsg): regular_step(coord) def test_scalar_coord(self): coord = DimCoord(5) exp_emsg = 'non-scalar coord' - with self.assertRaisesRegexp(ValueError, exp_emsg): + with self.assertRaisesRegex(ValueError, exp_emsg): regular_step(coord) def test_coord_with_irregular_step(self): name = 'latitude' coord = AuxCoord(np.array([2, 5, 1, 4]), standard_name=name) exp_emsg = '{} is not regular'.format(name) - with self.assertRaisesRegexp(CoordinateNotRegularError, exp_emsg): + with self.assertRaisesRegex(CoordinateNotRegularError, exp_emsg): regular_step(coord) diff --git a/lib/iris/tests/unit/util/test__slice_data_with_keys.py b/lib/iris/tests/unit/util/test__slice_data_with_keys.py index 2c8844109e..d4fffe23e9 100644 --- a/lib/iris/tests/unit/util/test__slice_data_with_keys.py +++ b/lib/iris/tests/unit/util/test__slice_data_with_keys.py @@ -111,12 +111,12 @@ def test_1d_tuple(self): def test_fail_1d_2keys(self): msg = 'More slices .* than dimensions' - with self.assertRaisesRegexp(IndexError, msg): + with self.assertRaisesRegex(IndexError, msg): self.check((3,), Index[1, 2]) def test_fail_empty_slice(self): msg = 'Cannot index with zero length slice' - with self.assertRaisesRegexp(IndexError, msg): + with self.assertRaisesRegex(IndexError, msg): self.check((3,), Index[1:1]) def test_2d_tuple(self): @@ -269,12 +269,12 @@ def test_1d_tuple(self): def test_fail_1d_2keys(self): msg = 'More slices .* than dimensions' - with self.assertRaisesRegexp(IndexError, msg): + with self.assertRaisesRegex(IndexError, msg): self.check([1, 2, 3], Index[1, 2], None, None) def test_fail_empty_slice(self): msg = 'Cannot index with zero length slice' - with self.assertRaisesRegexp(IndexError, msg): + with self.assertRaisesRegex(IndexError, msg): self.check([1, 2, 3], Index[1:1], None, None) def test_2d_tuple(self): diff --git a/lib/iris/tests/unit/util/test_reverse.py b/lib/iris/tests/unit/util/test_reverse.py index bfe0a8eded..43719088fd 100644 --- a/lib/iris/tests/unit/util/test_reverse.py +++ b/lib/iris/tests/unit/util/test_reverse.py @@ -25,21 +25,21 @@ def test_simple_array(self): self.assertArrayEqual(a[:, ::-1], reverse(a, [1])) msg = 'Reverse was expecting a single axis or a 1d array *' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, []) msg = 'An axis value out of range for the number of dimensions *' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, -1) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, 10) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, [-1]) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, [0, -1]) msg = 'To reverse an array, provide an int *' - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaisesRegex(TypeError, msg): reverse(a, 'latitude') def test_single_array(self): @@ -50,20 +50,20 @@ def test_single_array(self): self.assertArrayEqual(a[..., ::-1], reverse(a, 2)) msg = 'Reverse was expecting a single axis or a 1d array *' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, []) msg = 'An axis value out of range for the number of dimensions *' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, -1) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, 10) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, [-1]) - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(a, [0, -1]) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( TypeError, 'To reverse an array, provide an int *'): reverse(a, 'latitude') @@ -148,22 +148,22 @@ def test_cube_coord(self): cube1_reverse_spanning.coord('spanning').points) msg = 'Expected to find exactly 1 latitude coordinate, but found none.' - with self.assertRaisesRegexp( + with self.assertRaisesRegex( iris.exceptions.CoordinateNotFoundError, msg): reverse(self.cube1, 'latitude') msg = 'Reverse was expecting a single axis or a 1d array *' - with self.assertRaisesRegexp(ValueError, msg): + with self.assertRaisesRegex(ValueError, msg): reverse(self.cube1, []) msg = ('coords_or_dims must be int, str, coordinate or sequence of ' 'these. Got cube.') - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaisesRegex(TypeError, msg): reverse(self.cube1, self.cube1) msg = ('coords_or_dims must be int, str, coordinate or sequence of ' 'these.') - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaisesRegex(TypeError, msg): reverse(self.cube1, 3.) From 4375d2595d799de62efe1b53b99734c748a4623b Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 11:40:32 +0000 Subject: [PATCH 05/35] Removed uses of six.assertRaisesRegex. --- lib/iris/tests/unit/config/test_NetCDF.py | 3 +-- lib/iris/tests/unit/fileformats/pp/test__field_gen.py | 2 +- .../test_has_supported_mercator_parameters.py | 9 ++++----- .../test_has_supported_stereographic_parameters.py | 3 +-- lib/iris/tests/unit/fileformats/rules/test__make_cube.py | 3 +-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/iris/tests/unit/config/test_NetCDF.py b/lib/iris/tests/unit/config/test_NetCDF.py index 3d2e445f83..07482bc90c 100644 --- a/lib/iris/tests/unit/config/test_NetCDF.py +++ b/lib/iris/tests/unit/config/test_NetCDF.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.config.NetCDF` class.""" -import six # Import iris.tests first so that some things can be initialised before # importing anything else. @@ -34,7 +33,7 @@ def test_bad_value(self): self.options.conventions_override = bad_value self.assertFalse(self.options.conventions_override) exp_wmsg = 'Attempting to set invalid value {!r}'.format(bad_value) - six.assertRegex(self, str(w[0].message), exp_wmsg) + self.assertRegex(str(w[0].message), exp_wmsg) def test__contextmgr(self): with self.options.context(conventions_override=True): diff --git a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py index 034a5cecd7..aa529fbd7c 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py +++ b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py @@ -59,7 +59,7 @@ def test_lblrec_invalid(self): self.assertEqual(len(warn), 1) wmsg = ('LBLREC has a different value to the .* the header in the ' 'file \(8 and 4\)\. Skipping .*') - six.assertRegex(self, str(warn[0].message), wmsg) + self.assertRegex(str(warn[0].message), wmsg) def test_read_headers_call(self): # Checks that the two calls to np.fromfile are called in the diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py index 74a2643246..acd79415fa 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py @@ -17,7 +17,6 @@ from unittest import mock import numpy as np -import six from iris.fileformats._pyke_rules.compiled_krb.fc_rules_cf_fc import \ has_supported_mercator_parameters @@ -67,7 +66,7 @@ def test_invalid_scale_factor(self): self.assertFalse(is_valid) self.assertEqual(len(warns), 1) - six.assertRegex(self, str(warns[0]), 'Scale factor') + self.assertRegex(str(warns[0]), 'Scale factor') def test_invalid_standard_parallel(self): # Iris does not yet support standard parallels other than zero for @@ -89,7 +88,7 @@ def test_invalid_standard_parallel(self): self.assertFalse(is_valid) self.assertEqual(len(warns), 1) - six.assertRegex(self, str(warns[0]), 'Standard parallel') + self.assertRegex(str(warns[0]), 'Standard parallel') def test_invalid_false_easting(self): # Iris does not yet support false eastings other than zero for @@ -111,7 +110,7 @@ def test_invalid_false_easting(self): self.assertFalse(is_valid) self.assertEqual(len(warns), 1) - six.assertRegex(self, str(warns[0]), 'False easting') + self.assertRegex(str(warns[0]), 'False easting') def test_invalid_false_northing(self): # Iris does not yet support false northings other than zero for @@ -133,7 +132,7 @@ def test_invalid_false_northing(self): self.assertFalse(is_valid) self.assertEqual(len(warns), 1) - six.assertRegex(self, str(warns[0]), 'False northing') + self.assertRegex(str(warns[0]), 'False northing') if __name__ == "__main__": tests.main() diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py index 7e075abdab..18e7d83dd2 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py @@ -17,7 +17,6 @@ from unittest import mock import numpy as np -import six from iris.coord_systems import Stereographic from iris.fileformats._pyke_rules.compiled_krb.fc_rules_cf_fc import \ @@ -69,7 +68,7 @@ def test_invalid_scale_factor(self): self.assertFalse(is_valid) self.assertEqual(len(warns), 1) - six.assertRegex(self, str(warns[0]), 'Scale factor') + self.assertRegex(str(warns[0]), 'Scale factor') if __name__ == "__main__": diff --git a/lib/iris/tests/unit/fileformats/rules/test__make_cube.py b/lib/iris/tests/unit/fileformats/rules/test__make_cube.py index 156e585bc3..40086b0c71 100644 --- a/lib/iris/tests/unit/fileformats/rules/test__make_cube.py +++ b/lib/iris/tests/unit/fileformats/rules/test__make_cube.py @@ -9,7 +9,6 @@ # importing anything else. import iris.tests as tests -import six from unittest import mock import warnings @@ -54,7 +53,7 @@ def test_invalid_units(self): # Check warning was raised. self.assertEqual(len(warn), 1) exp_emsg = 'invalid units {!r}'.format(units) - six.assertRegex(self, str(warn[0]), exp_emsg) + self.assertRegex(str(warn[0]), exp_emsg) if __name__ == "__main__": From ee9ad7c91e22af1235cec7f55a31460bc0b0e06c Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 11:56:12 +0000 Subject: [PATCH 06/35] Fixed formatting errors. --- lib/iris/tests/test_coord_api.py | 2 +- .../analysis/cartography/test__quadrant_area.py | 2 +- .../unit/analysis/cartography/test_area_weights.py | 4 ++-- .../analysis/cartography/test_gridcell_angles.py | 14 +++++++------- .../analysis/regrid/test__CurvilinearRegridder.py | 2 +- lib/iris/tests/unit/coords/test_Coord.py | 6 +++--- lib/iris/tests/unit/fileformats/ff/test_FF2PP.py | 6 +++--- lib/iris/tests/unit/io/test_run_callback.py | 10 +++++----- lib/iris/tests/unit/test_sample_data_path.py | 4 ++-- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/iris/tests/test_coord_api.py b/lib/iris/tests/test_coord_api.py index ad964bec51..fb2bebe2d6 100644 --- a/lib/iris/tests/test_coord_api.py +++ b/lib/iris/tests/test_coord_api.py @@ -346,7 +346,7 @@ def test_dim_coord_restrictions(self): iris.coords.DimCoord([1, 2, 99, 4, 5]) # monotonic bounds with self.assertRaisesRegex(ValueError, - 'direction of monotonicity'): + 'direction of monotonicity'): iris.coords.DimCoord([1, 2, 3], bounds=[[1, 12], [2, 9], [3, 6]]) # masked points emsg = 'points array must not be masked' diff --git a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py index 78f3f0b97b..5a4e1d470f 100644 --- a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py +++ b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py @@ -111,7 +111,7 @@ def test_too_many_lon_bounds_error(self): def _assert_error_on_malformed_bounds(self, lat_bnds, lon_bnds): with self.assertRaisesRegex(ValueError, - 'Bounds must be \[n,2\] array'): + 'Bounds must be \[n,2\] array'): _quadrant_area(np.array(lat_bnds), np.array(lon_bnds), 1.) diff --git a/lib/iris/tests/unit/analysis/cartography/test_area_weights.py b/lib/iris/tests/unit/analysis/cartography/test_area_weights.py index a8f6e70b50..5064dc2fea 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_area_weights.py +++ b/lib/iris/tests/unit/analysis/cartography/test_area_weights.py @@ -20,7 +20,7 @@ def test_latitude_no_units(self): cube.coord('latitude').guess_bounds() cube.coord('latitude').units = None with self.assertRaisesRegex(ValueError, 'Units of degrees or ' - 'radians required'): + 'radians required'): iris.analysis.cartography.area_weights(cube) def test_longitude_no_units(self): @@ -29,7 +29,7 @@ def test_longitude_no_units(self): cube.coord('longitude').guess_bounds() cube.coord('longitude').units = None with self.assertRaisesRegex(ValueError, 'Units of degrees or ' - 'radians required'): + 'radians required'): iris.analysis.cartography.area_weights(cube) if __name__ == "__main__": diff --git a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py index 91879a2584..8123e5fad5 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py +++ b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py @@ -245,14 +245,14 @@ def test_fail_nonarraylike(self): # Check error with bad args. co_x, co_y = 1, 2 with self.assertRaisesRegex(ValueError, - 'must have array shape property'): + 'must have array shape property'): gridcell_angles(co_x, co_y) def test_fail_non2d_coords(self): # Check error with bad args. cube = lat_lon_cube() with self.assertRaisesRegex(ValueError, - 'inputs must have 2-dimensional shape'): + 'inputs must have 2-dimensional shape'): gridcell_angles(cube) def test_fail_different_shapes(self): @@ -268,7 +268,7 @@ def test_fail_different_coord_system(self): cube = sample_2d_latlons(regional=True, rotated=True) cube.coord(axis='x').coord_system = None with self.assertRaisesRegex(ValueError, - 'must have same coordinate system'): + 'must have same coordinate system'): gridcell_angles(cube) def test_fail_cube_dims(self): @@ -283,7 +283,7 @@ def test_fail_cube_dims(self): cube.remove_coord(co_x) cube.add_aux_coord(co_new_x, (1, 0)) with self.assertRaisesRegex(ValueError, - 'must have the same cube dimensions'): + 'must have the same cube dimensions'): gridcell_angles(cube) def test_fail_coord_noncoord(self): @@ -291,7 +291,7 @@ def test_fail_coord_noncoord(self): co_x, co_y = (self.standard_regional_cube.coord(axis=ax) for ax in ('x', 'y')) with self.assertRaisesRegex(ValueError, - 'is a Coordinate, but .* is not'): + 'is a Coordinate, but .* is not'): gridcell_angles(co_x, co_y.bounds) def test_fail_noncoord_coord(self): @@ -299,12 +299,12 @@ def test_fail_noncoord_coord(self): co_x, co_y = (self.standard_regional_cube.coord(axis=ax) for ax in ('x', 'y')) with self.assertRaisesRegex(ValueError, - 'is a Coordinate, but .* is not'): + 'is a Coordinate, but .* is not'): gridcell_angles(co_x.points, co_y) def test_fail_bad_method(self): with self.assertRaisesRegex(ValueError, - 'unrecognised cell_angle_boundpoints'): + 'unrecognised cell_angle_boundpoints'): self._check_multiple_orientations_and_latitudes( method='something_unknown') diff --git a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py index 4c8f2d58c0..4374b53c18 100644 --- a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py @@ -175,7 +175,7 @@ def test_bad_src_type(self): def test_bad_src_shape(self): with self.assertRaisesRegex(ValueError, - 'not defined on the same source grid'): + 'not defined on the same source grid'): self.regridder(self.src_grid[::2, ::2]) diff --git a/lib/iris/tests/unit/coords/test_Coord.py b/lib/iris/tests/unit/coords/test_Coord.py index ddc3dd4dd2..54976c0a1c 100644 --- a/lib/iris/tests/unit/coords/test_Coord.py +++ b/lib/iris/tests/unit/coords/test_Coord.py @@ -786,7 +786,7 @@ def test_create(self): def test_create_no_bounds_no_set(self): with self.assertRaisesRegex(ValueError, - 'Cannot set.*no bounds exist'): + 'Cannot set.*no bounds exist'): AuxCoord(points=[0, 1], units='days since 1970-01-01', climatological=True) @@ -803,13 +803,13 @@ def test_absent(self): def test_absent_no_bounds_no_set(self): coord = AuxCoord(points=[0, 1], units='days since 1970-01-01') with self.assertRaisesRegex(ValueError, - 'Cannot set.*no bounds exist'): + 'Cannot set.*no bounds exist'): coord.climatological = True def test_absent_no_time_no_set(self): coord = AuxCoord(points=[0, 1], bounds=[[0, 1], [1, 2]]) emsg = 'Cannot set climatological .* valid time reference units.*' - with self .assertRaisesRegex(self, TypeError, emsg): + with self.assertRaisesRegex(TypeError, emsg): coord.climatological = True def test_absent_no_bounds_unset(self): diff --git a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py index 18546c91c4..8029284969 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py +++ b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py @@ -323,7 +323,7 @@ def test_lbc_wgdos_unsupported(self): # Anything not None will do here. boundary_packing=0) with self.assertRaisesRegex(ValueError, - 'packed LBC data is not supported'): + 'packed LBC data is not supported'): self._test(mock_field, None, None) def test_lbc_cray(self): @@ -415,14 +415,14 @@ def test__bad_lbtim(self): self.mock_field.lbtim = 717 ff2pp = FF2PP('dummy_filename') with self.assertRaisesRegex(ValueError, - 'LBTIM of 717, expected only 0 or 11'): + 'LBTIM of 717, expected only 0 or 11'): ff2pp._adjust_field_for_lbc(self.mock_field) def test__bad_lbvc(self): self.mock_field.lbvc = 312 ff2pp = FF2PP('dummy_filename') with self.assertRaisesRegex(ValueError, - 'LBVC of 312, expected only 0 or 65'): + 'LBVC of 312, expected only 0 or 65'): ff2pp._adjust_field_for_lbc(self.mock_field) diff --git a/lib/iris/tests/unit/io/test_run_callback.py b/lib/iris/tests/unit/io/test_run_callback.py index 75451fe5e0..c752e81ee0 100644 --- a/lib/iris/tests/unit/io/test_run_callback.py +++ b/lib/iris/tests/unit/io/test_run_callback.py @@ -48,8 +48,8 @@ def test_bad_callback_return_type(self): def callback(cube, field, fname): return iris.cube.CubeList() with self.assertRaisesRegex(TypeError, - 'Callback function returned an ' - 'unhandled data type.'): + 'Callback function returned an ' + 'unhandled data type.'): iris.io.run_callback(callback, None, None, None) def test_bad_signature(self): @@ -58,9 +58,9 @@ def test_bad_signature(self): def callback(cube): pass with self.assertRaisesRegex(TypeError, - # exactly == Py2, positional == Py3 - 'takes (exactly )?1 (positional )?' - 'argument '): + # exactly == Py2, positional == Py3 + 'takes (exactly )?1 (positional )?' + 'argument '): iris.io.run_callback(callback, None, None, None) def test_callback_args(self): diff --git a/lib/iris/tests/unit/test_sample_data_path.py b/lib/iris/tests/unit/test_sample_data_path.py index 1ee8a74ce7..5bff0f4647 100644 --- a/lib/iris/tests/unit/test_sample_data_path.py +++ b/lib/iris/tests/unit/test_sample_data_path.py @@ -48,7 +48,7 @@ def test_call(self): def test_file_not_found(self): with mock.patch('iris_sample_data.path', self.sample_dir): with self.assertRaisesRegex(ValueError, - 'Sample data .* not found'): + 'Sample data .* not found'): sample_data_path('foo') def test_file_absolute(self): @@ -67,7 +67,7 @@ def test_glob_ok(self): def test_glob_not_found(self): with mock.patch('iris_sample_data.path', self.sample_dir): with self.assertRaisesRegex(ValueError, - 'Sample data .* not found'): + 'Sample data .* not found'): sample_data_path('foo.*') def test_glob_absolute(self): From 98dcd1d76e7562b9500c726a9f534e90a66c3266 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 11:57:53 +0000 Subject: [PATCH 07/35] Removed uses of six.assertCountEqual. --- lib/iris/tests/test_hybrid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/iris/tests/test_hybrid.py b/lib/iris/tests/test_hybrid.py index 99f010cf02..9188a1077a 100644 --- a/lib/iris/tests/test_hybrid.py +++ b/lib/iris/tests/test_hybrid.py @@ -62,7 +62,7 @@ def test_removing_sigma(self): t = [key for key, coord in six.iteritems(factory.dependencies) if coord is not None] - six.assertCountEqual(self, t, ['orography', 'delta']) + self.assertCountEqual(t, ['orography', 'delta']) def test_removing_orography(self): # Check the cube remains OK when the orography is removed. @@ -76,7 +76,7 @@ def test_removing_orography(self): t = [key for key, coord in six.iteritems(factory.dependencies) if coord is not None] - six.assertCountEqual(self, t, ['sigma', 'delta']) + self.assertCountEqual(t, ['sigma', 'delta']) def test_derived_coords(self): derived_coords = self.cube.derived_coords From 7b3e9807a554a046fccf210fcef314180b2e1b37 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 12:38:13 +0000 Subject: [PATCH 08/35] Removed uses of six iterators. --- lib/iris/__init__.py | 4 +- lib/iris/_concatenate.py | 3 +- lib/iris/_constraints.py | 3 +- lib/iris/_cube_coord_common.py | 4 +- lib/iris/_merge.py | 8 ++-- lib/iris/analysis/__init__.py | 13 +++---- lib/iris/analysis/_regrid.py | 3 +- lib/iris/aux_factory.py | 12 +++--- lib/iris/config.py | 5 +-- lib/iris/coords.py | 2 +- lib/iris/cube.py | 16 ++++---- lib/iris/experimental/regrid.py | 3 +- lib/iris/fileformats/cf.py | 38 +++++++++---------- lib/iris/fileformats/dot.py | 7 ++-- lib/iris/fileformats/name_loaders.py | 8 ++-- lib/iris/fileformats/netcdf.py | 22 +++++------ lib/iris/fileformats/pp.py | 2 +- lib/iris/fileformats/pp_load_rules.py | 3 +- lib/iris/fileformats/rules.py | 3 +- .../um/_optimal_array_structuring.py | 2 +- lib/iris/io/__init__.py | 3 +- lib/iris/io/format_picker.py | 2 +- lib/iris/palette.py | 3 +- lib/iris/symbols.py | 3 +- lib/iris/tests/integration/test_trajectory.py | 3 +- lib/iris/tests/stock/__init__.py | 3 +- lib/iris/tests/test_cube_to_pp.py | 2 +- lib/iris/tests/test_hybrid.py | 5 +-- lib/iris/tests/test_image_json.py | 4 +- lib/iris/tests/test_netcdf.py | 9 ++--- .../unit/data_manager/test_DataManager.py | 3 +- .../unit/fileformats/netcdf/test_Saver.py | 2 +- .../tests/unit/time/test_PartialDateTime.py | 2 +- lib/iris/tests/unit/util/test_new_axis.py | 4 +- lib/iris/util.py | 2 +- tools/generate_std_names.py | 2 +- 36 files changed, 95 insertions(+), 118 deletions(-) diff --git a/lib/iris/__init__.py b/lib/iris/__init__.py index bd75f7dca8..9618db7336 100644 --- a/lib/iris/__init__.py +++ b/lib/iris/__init__.py @@ -84,8 +84,6 @@ def callback(cube, field, filename): cube.add_aux_coord(experiment_coord) """ -import six - import contextlib import glob import itertools @@ -201,7 +199,7 @@ def context(self, **kwargs): # Save the current context current_state = self.__dict__.copy() # Update the state - for name, value in six.iteritems(kwargs): + for name, value in kwargs.items(): setattr(self, name, value) try: yield diff --git a/lib/iris/_concatenate.py b/lib/iris/_concatenate.py index 5fd3e26378..e6f070bba5 100644 --- a/lib/iris/_concatenate.py +++ b/lib/iris/_concatenate.py @@ -9,7 +9,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six from collections import defaultdict, namedtuple from copy import deepcopy @@ -384,7 +383,7 @@ def _coordinate_differences(self, other, attr): result = ('', ', '.join(self_names), ', '.join(other_names)) else: diff_names = [] - for self_key, self_value in six.iteritems(self_dict): + for self_key, self_value in self_dict.items(): other_value = other_dict[self_key] if self_value != other_value: diff_names.append(self_key) diff --git a/lib/iris/_constraints.py b/lib/iris/_constraints.py index 92063b34cc..d272b319e0 100644 --- a/lib/iris/_constraints.py +++ b/lib/iris/_constraints.py @@ -9,7 +9,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six try: # Python 3 from collections.abc import Iterable, Mapping @@ -446,7 +445,7 @@ def __init__(self, **attributes): def _cube_func(self, cube): match = True - for name, value in six.iteritems(self._attributes): + for name, value in self._attributes.items(): if name in cube.attributes: cube_attr = cube.attributes.get(name) # if we have a callable, then call it with the value, diff --git a/lib/iris/_cube_coord_common.py b/lib/iris/_cube_coord_common.py index 00eecc6858..d600890494 100644 --- a/lib/iris/_cube_coord_common.py +++ b/lib/iris/_cube_coord_common.py @@ -57,7 +57,7 @@ class LimitedAttributeDict(dict): def __init__(self, *args, **kwargs): dict.__init__(self, *args, **kwargs) # Check validity of keys - for key in six.iterkeys(self): + for key in self.keys(): if key in self._forbidden_keys: raise ValueError('%r is not a permitted attribute' % key) @@ -65,7 +65,7 @@ def __eq__(self, other): # Extend equality to allow for NumPy arrays. match = set(self.keys()) == set(other.keys()) if match: - for key, value in six.iteritems(self): + for key, value in self.items(): match = value == other[key] try: match = bool(match) diff --git a/lib/iris/_merge.py b/lib/iris/_merge.py index f81a6be0e7..63c2152a6e 100644 --- a/lib/iris/_merge.py +++ b/lib/iris/_merge.py @@ -529,7 +529,7 @@ def build_indexes(positions): scalar_index_by_name = {name: {} for name in names} for position in positions: - for name, value in six.iteritems(position): + for name, value in position.items(): name_index_by_scalar = scalar_index_by_name[name] if value in name_index_by_scalar: @@ -569,7 +569,7 @@ def _separable_pair(name, index): Boolean. """ - items = six.itervalues(index) + items = index.values() reference = next(items)[name] return all([item[name] == reference for item in items]) @@ -1375,7 +1375,7 @@ def axis_and_name(name): def name_in_independents(): return any(name in independents - for independents in six.itervalues(space) + for independents in space.values() if independents is not None) if len(cells) == 1 and not name_in_independents(): # A scalar coordinate not participating in a @@ -1419,7 +1419,7 @@ def name_in_independents(): # Populate the points and bounds based on the appropriate # function mapping. - temp = six.iteritems(function_matrix[name]) + temp = function_matrix[name].items() for function_independents, name_value in temp: # Build the index (and cache it) for the auxiliary # coordinate based on the associated independent diff --git a/lib/iris/analysis/__init__.py b/lib/iris/analysis/__init__.py index 279a673f5d..952dd91120 100644 --- a/lib/iris/analysis/__init__.py +++ b/lib/iris/analysis/__init__.py @@ -36,7 +36,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six from collections import OrderedDict try: # Python 3 @@ -349,7 +348,7 @@ def no_data_dim_fn(cube, coord): # for convenience, turn all of the sets in the dictionary into lists, # sorted by the name of the group - for key, groups in six.iteritems(result): + for key, groups in result.items(): result[key] = sorted(groups, key=lambda group: group.name()) return result @@ -1971,7 +1970,7 @@ def group(self): # Calculate the new shared coordinates. self._compute_shared_coords() # Generate the group-by slices/groups. - for groupby_slice in six.itervalues(self._slices_by_key): + for groupby_slice in self._slices_by_key.values(): yield groupby_slice return @@ -1985,7 +1984,7 @@ def _slice_merge(self): # Iterate over the ordered dictionary in order to reduce # multiple slices into a single tuple and collapse # all items from containing list. - for key, groupby_slices in six.iteritems(self._slices_by_key): + for key, groupby_slices in self._slices_by_key.items(): if len(groupby_slices) > 1: # Compress multiple slices into tuple representation. groupby_indicies = [] @@ -2006,7 +2005,7 @@ def _compute_groupby_coords(self): # Iterate over the ordered dictionary in order to construct # a group-by slice that samples the first element from each group. - for key_slice in six.itervalues(self._slices_by_key): + for key_slice in self._slices_by_key.values(): if isinstance(key_slice, tuple): groupby_slice.append(key_slice[0]) else: @@ -2024,7 +2023,7 @@ def _compute_shared_coords(self): # Iterate over the ordered dictionary in order to construct # a list of tuple group boundary indexes. - for key_slice in six.itervalues(self._slices_by_key): + for key_slice in self._slices_by_key.values(): if isinstance(key_slice, tuple): groupby_bounds.append((key_slice[0], key_slice[-1])) else: @@ -2047,7 +2046,7 @@ def _compute_shared_coords(self): new_shape += shape[:-1] work_arr = work_arr.reshape(work_shape) - for key_slice in six.itervalues(self._slices_by_key): + for key_slice in self._slices_by_key.values(): if isinstance(key_slice, slice): indices = key_slice.indices( coord.points.shape[dim]) diff --git a/lib/iris/analysis/_regrid.py b/lib/iris/analysis/_regrid.py index 4fefae5527..bd4ad8926c 100644 --- a/lib/iris/analysis/_regrid.py +++ b/lib/iris/analysis/_regrid.py @@ -5,7 +5,6 @@ # licensing details. from six.moves import (filter, input, map, range, zip) # noqa -import six import copy import functools @@ -848,7 +847,7 @@ def regrid_reference_surface(src_surface_coord, surface_dims, # Copy across any AuxFactory instances, and regrid their reference # surfaces where required. for factory in src.aux_factories: - for coord in six.itervalues(factory.dependencies): + for coord in factory.dependencies.values(): if coord is None: continue dims = src.coord_dims(coord) diff --git a/lib/iris/aux_factory.py b/lib/iris/aux_factory.py index d834736da3..e3216cff0f 100644 --- a/lib/iris/aux_factory.py +++ b/lib/iris/aux_factory.py @@ -121,7 +121,7 @@ def derived_dims(self, coord_dims_func): # Which dimensions are relevant? # e.g. If sigma -> [1] and orog -> [2, 3] then result = [1, 2, 3] derived_dims = set() - for coord in six.itervalues(self.dependencies): + for coord in self.dependencies.values(): if coord: derived_dims.update(coord_dims_func(coord)) @@ -144,7 +144,7 @@ def updated(self, new_coord_mapping): """ new_dependencies = {} - for key, coord in six.iteritems(self.dependencies): + for key, coord in self.dependencies.items(): if coord: coord = new_coord_mapping[id(coord)] new_dependencies[key] = coord @@ -156,14 +156,14 @@ def xml_element(self, doc): """ element = doc.createElement('coordFactory') - for key, coord in six.iteritems(self.dependencies): + for key, coord in self.dependencies.items(): element.setAttribute(key, coord._xml_id()) element.appendChild(self.make_coord().xml_element(doc)) return element def _dependency_dims(self, coord_dims_func): dependency_dims = {} - for key, coord in six.iteritems(self.dependencies): + for key, coord in self.dependencies.items(): if coord: dependency_dims[key] = coord_dims_func(coord) return dependency_dims @@ -261,7 +261,7 @@ def _remap(self, dependency_dims, derived_dims): ndim = 1 nd_points_by_key = {} - for key, coord in six.iteritems(self.dependencies): + for key, coord in self.dependencies.items(): if coord: # Get the points as consistent with the Cube. nd_points = self._nd_points(coord, dependency_dims[key], ndim) @@ -303,7 +303,7 @@ def _remap_with_bounds(self, dependency_dims, derived_dims): ndim = 1 nd_values_by_key = {} - for key, coord in six.iteritems(self.dependencies): + for key, coord in self.dependencies.items(): if coord: # Get the bounds or points as consistent with the Cube. if coord.nbounds: diff --git a/lib/iris/config.py b/lib/iris/config.py index ed18a175ed..747a721c63 100644 --- a/lib/iris/config.py +++ b/lib/iris/config.py @@ -29,7 +29,6 @@ ---------- """ -import six from six.moves import configparser import contextlib @@ -154,7 +153,7 @@ def __repr__(self): msg = 'NetCDF options: {}.' # Automatically populate with all currently accepted kwargs. options = ['{}={}'.format(k, v) - for k, v in six.iteritems(self.__dict__)] + for k, v in self.__dict__.items()] joined = ', '.join(options) return msg.format(joined) @@ -196,7 +195,7 @@ def context(self, **kwargs): # contextmanager block. starting_state = self.__dict__.copy() # Update the state to reflect the requested changes. - for name, value in six.iteritems(kwargs): + for name, value in kwargs.items(): setattr(self, name, value) try: yield diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 6548c56f62..865216dc48 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -561,7 +561,7 @@ def xml_element(self, doc): if self.attributes: attributes_element = doc.createElement('attributes') - for name in sorted(six.iterkeys(self.attributes)): + for name in sorted(self.attributes.keys()): attribute_element = doc.createElement('attribute') attribute_element.setAttribute('name', name) attribute_element.setAttribute('value', diff --git a/lib/iris/cube.py b/lib/iris/cube.py index ca562f8ec4..c669eb1ef3 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -293,13 +293,13 @@ def _extract_and_merge(cubes, constraints, strict, merge_unique=False): constraint_groups = dict([(constraint, CubeList()) for constraint in constraints]) for cube in cubes: - for constraint, cube_list in six.iteritems(constraint_groups): + for constraint, cube_list in constraint_groups.items(): sub_cube = constraint.extract(cube) if sub_cube is not None: cube_list.append(sub_cube) if merge_unique is not None: - for constraint, cubelist in six.iteritems(constraint_groups): + for constraint, cubelist in constraint_groups.items(): constraint_groups[constraint] = cubelist.merge(merge_unique) result = CubeList() @@ -1469,7 +1469,7 @@ def coords(self, name_or_coord=None, standard_name=None, def attr_filter(coord_): return all(k in coord_.attributes and coord_.attributes[k] == v - for k, v in six.iteritems(attributes)) + for k, v in attributes.items()) coords_and_factories = [coord_ for coord_ in coords_and_factories if attr_filter(coord_)] @@ -1934,7 +1934,7 @@ def _summary_coord_extra(self, coord, indent): # Find all the attribute keys keys = set() for similar_coord in similar_coords: - keys.update(six.iterkeys(similar_coord.attributes)) + keys.update(similar_coord.attributes.keys()) # Look for any attributes that vary vary = set() attributes = {} @@ -2275,7 +2275,7 @@ def vector_summary(vector_coords, cube_header, max_line_offset, # if self.attributes: attribute_lines = [] - for name, value in sorted(six.iteritems(self.attributes)): + for name, value in sorted(self.attributes.items()): value = iris.util.clip_string(six.text_type(value)) line = u'{pad:{width}}{name}: {value}'.format(pad=' ', width=indent, @@ -2546,7 +2546,7 @@ def intersection(self, *args, **kwargs): ignore_bounds = kwargs.pop('ignore_bounds', False) for arg in args: result = result._intersect(*arg, ignore_bounds=ignore_bounds) - for name, value in six.iteritems(kwargs): + for name, value in kwargs.items(): result = result._intersect(name, *value, ignore_bounds=ignore_bounds) return result @@ -3044,7 +3044,7 @@ def _xml_element(self, doc, checksum=False, order=True, byteorder=True): if self.attributes: attributes_element = doc.createElement('attributes') - for name in sorted(six.iterkeys(self.attributes)): + for name in sorted(self.attributes.keys()): attribute_element = doc.createElement('attribute') attribute_element.setAttribute('name', name) @@ -4032,7 +4032,7 @@ def __setitem__(self, key, value): def __delitem__(self, class_): cs = self[class_] - keys = [k for k, v in six.iteritems(self._retrieval_map) if v == cs] + keys = [k for k, v in self._retrieval_map.items() if v == cs] for key in keys: del self._retrieval_map[key] del self._basic_map[type(cs)] diff --git a/lib/iris/experimental/regrid.py b/lib/iris/experimental/regrid.py index 878515f66d..b32a8e3e36 100644 --- a/lib/iris/experimental/regrid.py +++ b/lib/iris/experimental/regrid.py @@ -19,7 +19,6 @@ import numpy as np import numpy.ma as ma import scipy.interpolate -import six import iris.analysis.cartography from iris.analysis._interpolation import (get_xy_dim_coords, get_xy_coords, @@ -1076,7 +1075,7 @@ def regrid_reference_surface(src_surface_coord, surface_dims, # Copy across any AuxFactory instances, and regrid their reference # surfaces where required. for factory in src.aux_factories: - for coord in six.itervalues(factory.dependencies): + for coord in factory.dependencies.values(): if coord is None: continue dims = src.coord_dims(coord) diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index 7b1dfa366c..fea5a90493 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -257,7 +257,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF ancillary data variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for ancillary data variable references. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -297,7 +297,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF auxiliary coordinate variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for auxiliary coordinate variable references. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -339,7 +339,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF boundary variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for a boundary variable reference. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -407,7 +407,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF climatology variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for a climatology variable reference. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -471,7 +471,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True, monotonic=Fals ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF coordinate variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): if nc_var_name in ignore: continue # String variables can't be coordinates @@ -529,7 +529,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF formula terms variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for formula terms variable references. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -585,7 +585,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all grid mapping variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for a grid mapping variable reference. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -622,7 +622,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF label variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for label variable references. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -771,7 +771,7 @@ def identify(cls, variables, ignore=None, target=None, warn=True): ignore, target = cls._identify_common(variables, ignore, target) # Identify all CF measure variables. - for nc_var_name, nc_var in six.iteritems(target): + for nc_var_name, nc_var in target.items(): # Check for measure variable references. nc_var_att = getattr(nc_var, cls.cf_identity, None) @@ -811,7 +811,7 @@ def __init__(self): def _cf_getter(self, cls): # Generate dictionary with dictionary comprehension. return {cf_name: cf_var - for cf_name, cf_var in six.iteritems(self._cf_variables) + for cf_name, cf_var in self._cf_variables.items() if isinstance(cf_var, cls)} @property @@ -848,7 +848,7 @@ def data_variables(self): def formula_terms(self): """Collection of CF-netCDF variables that participate in a CF-netCDF formula term.""" return {cf_name: cf_var - for cf_name, cf_var in six.iteritems(self._cf_variables) + for cf_name, cf_var in self._cf_variables.items() if cf_var.has_formula_terms()} @property @@ -969,8 +969,8 @@ def _translate(self): # Identify and register all CF formula terms. formula_terms = _CFFormulaTermsVariable.identify(self._dataset.variables) - for cf_var in six.itervalues(formula_terms): - for cf_root, cf_term in six.iteritems(cf_var.cf_terms_by_root): + for cf_var in formula_terms.values(): + for cf_root, cf_term in cf_var.cf_terms_by_root.items(): # Ignore formula terms owned by a bounds variable. if cf_root not in self.cf_group.bounds: cf_name = cf_var.cf_name @@ -1008,7 +1008,7 @@ def _build(cf_variable): target=cf_variable.cf_name, warn=False) # Sanity check dimensionality coverage. - for cf_name, cf_var in six.iteritems(match): + for cf_name, cf_var in match.items(): if cf_var.spans(cf_variable): cf_group[cf_name] = self.cf_group[cf_name] else: @@ -1038,7 +1038,7 @@ def _build(cf_variable): in coordinates_attr.split() if cf_name in self.cf_group.coordinates}) # Add appropriate formula terms. - for cf_var in six.itervalues(self.cf_group.formula_terms): + for cf_var in self.cf_group.formula_terms.values(): for cf_root in cf_var.cf_terms_by_root: if (cf_root in cf_group and cf_var.cf_name not in cf_group): @@ -1067,14 +1067,14 @@ def _build(cf_variable): # a subset of the dimensionality of the data variable. ignored = set() - for cf_variable in six.itervalues(self.cf_group): + for cf_variable in self.cf_group.values(): _build(cf_variable) # Determine whether there are any formula terms that # may be promoted to a CFDataVariable and restrict promotion to only # those formula terms that are reference surface/phenomenon. - for cf_var in six.itervalues(self.cf_group.formula_terms): - for cf_root, cf_term in six.iteritems(cf_var.cf_terms_by_root): + for cf_var in self.cf_group.formula_terms.values(): + for cf_root, cf_term in cf_var.cf_terms_by_root.items(): cf_root_var = self.cf_group[cf_root] name = cf_root_var.standard_name or cf_root_var.long_name terms = reference_terms.get(name, []) @@ -1107,7 +1107,7 @@ def _build(cf_variable): def _reset(self): """Reset the attribute touch history of each variable.""" - for nc_var_name in six.iterkeys(self._dataset.variables): + for nc_var_name in self._dataset.variables.keys(): self.cf_group[nc_var_name].cf_attrs_reset() def __del__(self): diff --git a/lib/iris/fileformats/dot.py b/lib/iris/fileformats/dot.py index 8402d92ff9..56985450da 100644 --- a/lib/iris/fileformats/dot.py +++ b/lib/iris/fileformats/dot.py @@ -7,7 +7,6 @@ Provides Creation and saving of DOT graphs for a :class:`iris.cube.Cube`. """ -import six import os import subprocess @@ -241,7 +240,7 @@ def cube_text(cube): %(associations)s } ''' - cube_attributes = list(sorted(six.iteritems(cube.attributes), + cube_attributes = list(sorted(cube.attributes.items(), key=lambda item: item[0])) cube_node = _dot_node(_GRAPH_INDENT, ':Cube', 'Cube', cube_attributes) res_string = template % { @@ -278,7 +277,7 @@ def _coord_text(label, coord): attrs = [(name, getattr(coord, name)) for name in _dot_attrs] if coord.attributes: - custom_attrs = sorted(six.iteritems(coord.attributes), key=lambda item: item[0]) + custom_attrs = sorted(coord.attributes.items(), key=lambda item: item[0]) attrs.extend(custom_attrs) node = _dot_node(_SUBGRAPH_INDENT, label, coord.__class__.__name__, attrs) @@ -298,7 +297,7 @@ def _coord_system_text(cs, uid): """ attrs = [] - for k, v in six.iteritems(cs.__dict__): + for k, v in cs.__dict__.items(): if isinstance(v, iris.cube.Cube): attrs.append((k, 'defined')) else: diff --git a/lib/iris/fileformats/name_loaders.py b/lib/iris/fileformats/name_loaders.py index dbf8f18da8..cb59713bb0 100644 --- a/lib/iris/fileformats/name_loaders.py +++ b/lib/iris/fileformats/name_loaders.py @@ -376,7 +376,7 @@ def _generate_cubes(header, column_headings, coords, data_arrays, # Turn the dictionary of column headings with a list of header # information for each field into a dictionary of headings for # just this field. - field_headings = {k: v[i] for k, v in six.iteritems(column_headings)} + field_headings = {k: v[i] for k, v in column_headings.items()} # Make a cube. cube = iris.cube.Cube(data_array) @@ -492,13 +492,13 @@ def _generate_cubes(header, column_headings, coords, data_arrays, 'Output format', ] # Add the Main Headings as attributes. - for key, value in six.iteritems(header): + for key, value in header.items(): if value is not None and value != '' and \ key not in headings: cube.attributes[key] = value # Add the Column Headings as attributes - for key, value in six.iteritems(field_headings): + for key, value in field_headings.items(): if value is not None and value != '' and \ key not in headings: cube.attributes[key] = value @@ -1169,7 +1169,7 @@ def load_NAMEIII_trajectory(filename): cube = iris.cube.Cube(values, units=units) cube.rename(name) # Add the Main Headings as attributes. - for key, value in six.iteritems(header): + for key, value in header.items(): if value is not None and value != '' and \ key not in headings: cube.attributes[key] = value diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index af147c46a7..b67ff59ed6 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -395,7 +395,7 @@ def __getstate__(self): return {attr: getattr(self, attr) for attr in self.__slots__} def __setstate__(self, state): - for key, value in six.iteritems(state): + for key, value in state.items(): setattr(self, key, value) @@ -404,35 +404,35 @@ def _assert_case_specific_facts(engine, cf, cf_group): engine.provides['coordinates'] = [] # Assert facts for CF coordinates. - for cf_name in six.iterkeys(cf_group.coordinates): + for cf_name in cf_group.coordinates.keys(): engine.add_case_specific_fact(_PYKE_FACT_BASE, 'coordinate', (cf_name,)) # Assert facts for CF auxiliary coordinates. - for cf_name in six.iterkeys(cf_group.auxiliary_coordinates): + for cf_name in cf_group.auxiliary_coordinates.keys(): engine.add_case_specific_fact(_PYKE_FACT_BASE, 'auxiliary_coordinate', (cf_name,)) # Assert facts for CF cell measures. - for cf_name in six.iterkeys(cf_group.cell_measures): + for cf_name in cf_group.cell_measures.keys(): engine.add_case_specific_fact(_PYKE_FACT_BASE, 'cell_measure', (cf_name,)) # Assert facts for CF grid_mappings. - for cf_name in six.iterkeys(cf_group.grid_mappings): + for cf_name in cf_group.grid_mappings.keys(): engine.add_case_specific_fact(_PYKE_FACT_BASE, 'grid_mapping', (cf_name,)) # Assert facts for CF labels. - for cf_name in six.iterkeys(cf_group.labels): + for cf_name in cf_group.labels.keys(): engine.add_case_specific_fact(_PYKE_FACT_BASE, 'label', (cf_name,)) # Assert facts for CF formula terms associated with the cf_group # of the CF data variable. formula_root = set() - for cf_var in six.itervalues(cf.cf_group.formula_terms): - for cf_root, cf_term in six.iteritems(cf_var.cf_terms_by_root): + for cf_var in cf.cf_group.formula_terms.values(): + for cf_root, cf_term in cf_var.cf_terms_by_root.items(): # Only assert this fact if the formula root variable is # defined in the CF group of the CF data variable. if cf_root in cf_group: @@ -461,7 +461,7 @@ def _pyke_stats(engine, cf_name): print('Case Specific Facts:') kb_facts = engine.get_kb(_PYKE_FACT_BASE) - for key in six.iterkeys(kb_facts.entity_lists): + for key in kb_facts.entity_lists.keys(): for arg in kb_facts.entity_lists[key].case_specific_facts: print('\t%s%s' % (key, arg)) @@ -998,7 +998,7 @@ def write(self, cube, local_keys=None, unlimited_dimensions=None, local_keys.update(_CF_DATA_ATTRS, _UKMO_DATA_ATTRS) # Add global attributes taking into account local_keys. - global_attributes = {k: v for k, v in six.iteritems(cube.attributes) + global_attributes = {k: v for k, v in cube.attributes.items() if (k not in local_keys and k.lower() != 'conventions')} self.update_global_attributes(global_attributes) @@ -1235,7 +1235,7 @@ def _add_aux_factories(self, cube, cf_var_cube, dimension_names): cf_var = self._dataset.variables[cf_name] names = {key: self._name_coord_map.name(coord) for - key, coord in six.iteritems(factory.dependencies)} + key, coord in factory.dependencies.items()} formula_terms = factory_defn.formula_terms_format.format( **names) std_name = factory_defn.std_name diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 8ac6928897..7d2bdd947a 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -1111,7 +1111,7 @@ def save(self, file_handle): # at the end of the data extra_items = [] # iterate through all of the possible extra data fields - for ib, extra_data_attr_name in six.iteritems(EXTRA_DATA): + for ib, extra_data_attr_name in EXTRA_DATA.items(): # try to get the extra data field, returning None if it doesn't # exist extra_elem = getattr(self, extra_data_attr_name, None) diff --git a/lib/iris/fileformats/pp_load_rules.py b/lib/iris/fileformats/pp_load_rules.py index 0ab9dd7703..389a153eb0 100644 --- a/lib/iris/fileformats/pp_load_rules.py +++ b/lib/iris/fileformats/pp_load_rules.py @@ -5,7 +5,6 @@ # licensing details. from six.moves import (filter, input, map, range, zip) # noqa -import six # Historically this was auto-generated from # SciTools/iris-code-generators:tools/gen_rules.py @@ -1085,7 +1084,7 @@ def _all_other_rules(f): if unhandled_lbproc: attributes["ukmo__process_flags"] = tuple(sorted( [name - for value, name in six.iteritems(LBPROC_MAP) + for value, name in LBPROC_MAP.items() if isinstance(value, int) and f.lbproc & value])) if (f.lbsrce % 10000) == 1111: diff --git a/lib/iris/fileformats/rules.py b/lib/iris/fileformats/rules.py index 99063cf7c2..f581591cba 100644 --- a/lib/iris/fileformats/rules.py +++ b/lib/iris/fileformats/rules.py @@ -9,7 +9,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six import collections import warnings @@ -57,7 +56,7 @@ def as_cube(self): else: final_cube = src_cube.copy() attributes = self.transform(final_cube) - for name, value in six.iteritems(attributes): + for name, value in attributes.items(): setattr(final_cube, name, value) self._final_cube = final_cube diff --git a/lib/iris/fileformats/um/_optimal_array_structuring.py b/lib/iris/fileformats/um/_optimal_array_structuring.py index 297984ac31..fe7f3c984c 100644 --- a/lib/iris/fileformats/um/_optimal_array_structuring.py +++ b/lib/iris/fileformats/um/_optimal_array_structuring.py @@ -151,7 +151,7 @@ def optimal_array_structure(ordering_elements, actual_values_elements=None): # Filter out the trivial (scalar) ones. elements_and_dimensions = { name: (array, dims) - for name, (array, dims) in six.iteritems(elements_and_dimensions) + for name, (array, dims) in elements_and_dimensions.items() if len(dims)} # Make a list of 'primary' elements; i.e. those in the target structure. diff --git a/lib/iris/io/__init__.py b/lib/iris/io/__init__.py index ebbdd60f63..ca160457dc 100644 --- a/lib/iris/io/__init__.py +++ b/lib/iris/io/__init__.py @@ -9,7 +9,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six from collections import OrderedDict import glob @@ -155,7 +154,7 @@ def expand_filespecs(file_specs): if not all(all_expanded): msg = "One or more of the files specified did not exist:" - for pattern, expanded in six.iteritems(glob_expanded): + for pattern, expanded in glob_expanded.items(): if expanded: msg += '\n - "{}" matched {} file(s)'.format(pattern, len(expanded)) diff --git a/lib/iris/io/format_picker.py b/lib/iris/io/format_picker.py index f39f0146e6..51ce58b29e 100644 --- a/lib/iris/io/format_picker.py +++ b/lib/iris/io/format_picker.py @@ -131,7 +131,7 @@ def get_spec(self, basename, buffer_obj): return format_spec printable_values = {} - for key, value in six.iteritems(element_cache): + for key, value in element_cache.items(): value = str(value) if len(value) > 50: value = value[:50] + '...' diff --git a/lib/iris/palette.py b/lib/iris/palette.py index 8c8cef1d6d..e9484b43a6 100644 --- a/lib/iris/palette.py +++ b/lib/iris/palette.py @@ -10,7 +10,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six from functools import wraps import os @@ -89,7 +88,7 @@ def _default_cmap_norm(args, kwargs): if len(cmaps) == 0: # Check for a fuzzy match against a keyword. - for keyword in six.iterkeys(_CMAP_BY_KEYWORD): + for keyword in _CMAP_BY_KEYWORD.keys(): if keyword in std_name: cmaps.update(_CMAP_BY_KEYWORD[keyword]) diff --git a/lib/iris/symbols.py b/lib/iris/symbols.py index 54cb88f7b0..ecbcb7725e 100644 --- a/lib/iris/symbols.py +++ b/lib/iris/symbols.py @@ -7,7 +7,6 @@ Contains symbol definitions for use with :func:`iris.plot.symbols`. """ -import six import itertools import math @@ -209,7 +208,7 @@ def _wedge_fix(wedge_path): def _convert_paths_to_patches(): # Convert the symbols defined as lists-of-paths into patches. - for code, symbol in six.iteritems(CLOUD_COVER): + for code, symbol in CLOUD_COVER.items(): CLOUD_COVER[code] = _make_merged_patch(symbol) diff --git a/lib/iris/tests/integration/test_trajectory.py b/lib/iris/tests/integration/test_trajectory.py index d39ac74854..acbdc44794 100644 --- a/lib/iris/tests/integration/test_trajectory.py +++ b/lib/iris/tests/integration/test_trajectory.py @@ -6,7 +6,6 @@ """Integration tests for :mod:`iris.analysis.trajectory`.""" from six.moves import (filter, input, map, range, zip) # noqa -import six # import iris tests first so that some things can be initialised before # importing anything else @@ -63,7 +62,7 @@ def test_trajectory_extraction_calc(self): def _traj_to_sample_points(self, trajectory): sample_points = [] src_points = trajectory.sampled_points - for name in six.iterkeys(src_points[0]): + for name in src_points[0].keys(): values = [point[name] for point in src_points] sample_points.append((name, values)) return sample_points diff --git a/lib/iris/tests/stock/__init__.py b/lib/iris/tests/stock/__init__.py index 3a245b6d49..a83a10c14c 100644 --- a/lib/iris/tests/stock/__init__.py +++ b/lib/iris/tests/stock/__init__.py @@ -9,7 +9,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six from datetime import datetime import os.path @@ -467,7 +466,7 @@ def realistic_4d(): # sort the arrays based on the order they were originally given. # The names given are of the form 'arr_1' or 'arr_10' _, arrays = zip( - *sorted(six.iteritems(r), key=lambda item: int(item[0][4:]))) + *sorted(r.items(), key=lambda item: int(item[0][4:]))) lat_pts, lat_bnds, lon_pts, lon_bnds, level_height_pts, \ level_height_bnds, model_level_pts, sigma_pts, sigma_bnds, time_pts, \ diff --git a/lib/iris/tests/test_cube_to_pp.py b/lib/iris/tests/test_cube_to_pp.py index cd2b2aed83..7206affefc 100644 --- a/lib/iris/tests/test_cube_to_pp.py +++ b/lib/iris/tests/test_cube_to_pp.py @@ -248,7 +248,7 @@ def test_pp_save_rules(self): # Maps lbproc value to the process flags that should be created multiple_map = {sum(bits) : [iris.fileformats.pp.lbproc_map[bit] for bit in bits] for bits in multiple_bit_values} - for lbproc, descriptions in six.iteritems(multiple_map): + for lbproc, descriptions in multiple_map.items(): ll_cube = stock.lat_lon_cube() ll_cube.attributes["ukmo__process_flags"] = descriptions diff --git a/lib/iris/tests/test_hybrid.py b/lib/iris/tests/test_hybrid.py index 9188a1077a..a39108df84 100644 --- a/lib/iris/tests/test_hybrid.py +++ b/lib/iris/tests/test_hybrid.py @@ -7,7 +7,6 @@ Test the hybrid vertical coordinate representations. """ -import six # import iris tests first so that some things can be initialised before # importing anything else @@ -60,7 +59,7 @@ def test_removing_sigma(self): # Check the factory now only has surface_altitude and delta dependencies. factory = cube.aux_factory(name='altitude') t = [key - for key, coord in six.iteritems(factory.dependencies) + for key, coord in factory.dependencies.items() if coord is not None] self.assertCountEqual(t, ['orography', 'delta']) @@ -74,7 +73,7 @@ def test_removing_orography(self): # Check the factory now only has sigma and delta dependencies. factory = cube.aux_factory(name='altitude') t = [key - for key, coord in six.iteritems(factory.dependencies) + for key, coord in factory.dependencies.items() if coord is not None] self.assertCountEqual(t, ['sigma', 'delta']) diff --git a/lib/iris/tests/test_image_json.py b/lib/iris/tests/test_image_json.py index 775e0644f6..aaecfa05c0 100644 --- a/lib/iris/tests/test_image_json.py +++ b/lib/iris/tests/test_image_json.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -import six - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests @@ -42,7 +40,7 @@ def test_resolve(self): # "imagerepo" maps key: list-of-uris. Put all the uris in one big set. tests_uris = set(itertools.chain.from_iterable( - six.itervalues(imagerepo))) + imagerepo.values())) missing_refs = list(tests_uris - reference_image_uris) n_missing_refs = len(missing_refs) diff --git a/lib/iris/tests/test_netcdf.py b/lib/iris/tests/test_netcdf.py index 97e5fd38ff..09deb53ba3 100644 --- a/lib/iris/tests/test_netcdf.py +++ b/lib/iris/tests/test_netcdf.py @@ -7,7 +7,6 @@ Test CF-NetCDF file loading and saving. """ -import six # Import iris tests first so that some things can be initialised before # importing anything else. @@ -694,11 +693,11 @@ def test_attributes(self): aglobals = {'history': 'A long time ago...', 'title': 'Attribute test', 'foo': 'bar'} - for k, v in six.iteritems(aglobals): + for k, v in aglobals.items(): self.cube.attributes[k] = v # Should be overriden. aover = {'Conventions': 'TEST'} - for k, v in six.iteritems(aover): + for k, v in aover.items(): self.cube.attributes[k] = v # Should be data varible attributes. avars = {'standard_error_multiplier': 23, @@ -707,7 +706,7 @@ def test_attributes(self): 'flag_values': 'c', 'missing_value': 1.e20, 'STASH': iris.fileformats.pp.STASH(1, 2, 3)} - for k, v in six.iteritems(avars): + for k, v in avars.items(): self.cube.attributes[k] = v with self.temp_filename(suffix='.nc') as filename: iris.save(self.cube, filename) @@ -931,7 +930,7 @@ def test_process_flags(self): multiple_map = {bits: [iris.fileformats.pp.lbproc_map[bit] for bit in bits] for bits in multiple_bit_values} - for bits, descriptions in six.iteritems(multiple_map): + for bits, descriptions in multiple_map.items(): ll_cube = stock.lat_lon_cube() ll_cube.attributes["ukmo__process_flags"] = descriptions diff --git a/lib/iris/tests/unit/data_manager/test_DataManager.py b/lib/iris/tests/unit/data_manager/test_DataManager.py index 1fd426c659..c0852afe67 100644 --- a/lib/iris/tests/unit/data_manager/test_DataManager.py +++ b/lib/iris/tests/unit/data_manager/test_DataManager.py @@ -17,7 +17,6 @@ import numpy as np import numpy.ma as ma -import six from iris._data_manager import DataManager from iris._lazy_data import as_lazy_data @@ -45,7 +44,7 @@ def test(self): self.assertEqual(kwargs, dict()) self.assertEqual(len(args), 2) expected = [return_value, [dm]] - for item in six.itervalues(args): + for item in args.values(): self.assertIn(item, expected) self.assertIs(result, return_value) diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py index c284742b8d..0be26e5400 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py @@ -194,7 +194,7 @@ def test_no_unlimited_dimensions(self): with Saver(nc_path, 'NETCDF4') as saver: saver.write(cube, unlimited_dimensions=None) ds = nc.Dataset(nc_path) - for dim in six.itervalues(ds.dimensions): + for dim in ds.dimensions.values(): self.assertFalse(dim.isunlimited()) ds.close() diff --git a/lib/iris/tests/unit/time/test_PartialDateTime.py b/lib/iris/tests/unit/time/test_PartialDateTime.py index d52cd91a25..bc18bbe3fa 100644 --- a/lib/iris/tests/unit/time/test_PartialDateTime.py +++ b/lib/iris/tests/unit/time/test_PartialDateTime.py @@ -147,7 +147,7 @@ def negate(expected): expected = not expected return expected - return {name: negate(value) for name, value in six.iteritems(expectations)} + return {name: negate(value) for name, value in expectations.items()} EQ_EXPECTATIONS = {'no_difference': True, 'item1_lo': False, 'item1_hi': False, diff --git a/lib/iris/tests/unit/util/test_new_axis.py b/lib/iris/tests/unit/util/test_new_axis.py index be0f3dfa9e..b3a82596fb 100644 --- a/lib/iris/tests/unit/util/test_new_axis.py +++ b/lib/iris/tests/unit/util/test_new_axis.py @@ -16,8 +16,6 @@ import numpy as np import unittest -import six - import iris from iris._lazy_data import as_lazy_data @@ -131,7 +129,7 @@ def test_maint_factory(self): # Addresses a former bug : https://github.com/SciTools/iris/pull/3263 factory, = list(res.aux_factories) deps = factory.dependencies - for dep_name, dep_coord in six.iteritems(deps): + for dep_name, dep_coord in deps.items(): coord_name = dep_coord.name() msg = ('Factory dependency {!r} is a coord named {!r}, ' 'but it is *not* the coord of that name in the new cube.') diff --git a/lib/iris/util.py b/lib/iris/util.py index 11f19bd016..0dc1f2622a 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -1135,7 +1135,7 @@ def as_compatible_shape(src_cube, target_cube): 'to restore cube dimensions.') new_shape = [1] * target_cube.ndim - for dim_from, dim_to in six.iteritems(dim_mapping): + for dim_from, dim_to in dim_mapping.items(): if dim_to is not None: new_shape[dim_from] = src_cube.shape[dim_to] diff --git a/tools/generate_std_names.py b/tools/generate_std_names.py index 2eefbd30d8..77171485b1 100644 --- a/tools/generate_std_names.py +++ b/tools/generate_std_names.py @@ -81,7 +81,7 @@ def to_dict(infile, outfile): for section in process_name_table(tree, 'alias', 'entry_id'): aliases.update(section) - for key, valued in six.iteritems(aliases): + for key, valued in aliases.items(): values.update({ key : {'canonical_units' : values.get(valued['entry_id']).get('canonical_units')} }) From be890398ea7ecdacbba0e02f553844cf9d9b6916 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 13:49:27 +0000 Subject: [PATCH 09/35] Continuation line for Stickler. --- lib/iris/fileformats/dot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/iris/fileformats/dot.py b/lib/iris/fileformats/dot.py index 56985450da..2da65d62fb 100644 --- a/lib/iris/fileformats/dot.py +++ b/lib/iris/fileformats/dot.py @@ -277,7 +277,8 @@ def _coord_text(label, coord): attrs = [(name, getattr(coord, name)) for name in _dot_attrs] if coord.attributes: - custom_attrs = sorted(coord.attributes.items(), key=lambda item: item[0]) + custom_attrs = sorted( + coord.attributes.items(), key=lambda item: item[0]) attrs.extend(custom_attrs) node = _dot_node(_SUBGRAPH_INDENT, label, coord.__class__.__name__, attrs) From 1076175ad31d99439a6682d4acec04275d6b9bab Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 14:22:31 +0000 Subject: [PATCH 10/35] iter() warpper for index.values() in _separable_pair. --- lib/iris/_merge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/_merge.py b/lib/iris/_merge.py index 63c2152a6e..4ce313ccf3 100644 --- a/lib/iris/_merge.py +++ b/lib/iris/_merge.py @@ -569,7 +569,7 @@ def _separable_pair(name, index): Boolean. """ - items = index.values() + items = iter(index.values()) reference = next(items)[name] return all([item[name] == reference for item in items]) From 8ac98275b3a933c8371e8fd43fcd77f614e5d84c Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 15:03:39 +0000 Subject: [PATCH 11/35] Removed uses of six.with_metaclass. --- lib/iris/aux_factory.py | 2 +- lib/iris/coord_systems.py | 2 +- lib/iris/coords.py | 2 +- lib/iris/fileformats/cf.py | 2 +- lib/iris/fileformats/pp.py | 2 +- lib/iris/tests/__init__.py | 3 +-- lib/iris/tests/test_plot.py | 12 ++++++------ lib/iris/tests/unit/analysis/maths/__init__.py | 7 +++---- lib/iris/tests/unit/merge/test_ProtoCube.py | 2 +- lib/iris/tests/unit/tests/test_IrisTest.py | 2 +- lib/iris/util.py | 3 +-- tools/translator/__init__.py | 2 +- 12 files changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/iris/aux_factory.py b/lib/iris/aux_factory.py index e3216cff0f..6bcdce1948 100644 --- a/lib/iris/aux_factory.py +++ b/lib/iris/aux_factory.py @@ -21,7 +21,7 @@ import iris.coords -class AuxCoordFactory(six.with_metaclass(ABCMeta, CFVariableMixin)): +class AuxCoordFactory(ABCMeta, CFVariableMixin): """ Represents a "factory" which can manufacture an additional auxiliary coordinate on demand, by combining the values of other coordinates. diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index 720835eff5..7a5ded2e04 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -17,7 +17,7 @@ import cartopy.crs as ccrs -class CoordSystem(six.with_metaclass(ABCMeta, object)): +class CoordSystem(ABCMeta, object): """ Abstract base class for coordinate systems. diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 865216dc48..c9b0c27894 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -40,7 +40,7 @@ from iris.util import points_step -class _DimensionalMetadata(six.with_metaclass(ABCMeta, CFVariableMixin)): +class _DimensionalMetadata(ABCMeta, CFVariableMixin): """ Superclass for dimensional metadata. diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index fea5a90493..afbfd6950e 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -68,7 +68,7 @@ def _is_str_dtype(var): ################################################################################ -class CFVariable(six.with_metaclass(ABCMeta, object)): +class CFVariable(ABCMeta, object): """Abstract base class wrapper for a CF-netCDF variable.""" #: Name of the netCDF variable attribute that identifies this diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 7d2bdd947a..b25880c11b 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -753,7 +753,7 @@ def _pp_attribute_names(header_defn): return normal_headers + special_headers + extra_data + special_attributes -class PPField(six.with_metaclass(abc.ABCMeta, object)): +class PPField(abc.ABCMeta, object): """ A generic class for PP fields - not specific to a particular header release number. diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index c4afa353a5..9ae1916ad8 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -20,7 +20,6 @@ """ from six.moves import (filter, input, map, range, zip) # noqa -import six import codecs import collections @@ -973,7 +972,7 @@ def __new__(cls, clsname, base_classes, attrs): return result -class IrisTest(six.with_metaclass(_TestTimingsMetaclass, IrisTest_nometa)): +class IrisTest(_TestTimingsMetaclass, IrisTest_nometa): # Derive the 'ordinary' IrisTest from IrisTest_nometa, but add the # metaclass that enables test timings output. # This means that all subclasses also get the timing behaviour. diff --git a/lib/iris/tests/test_plot.py b/lib/iris/tests/test_plot.py index f08acc172d..625754d764 100644 --- a/lib/iris/tests/test_plot.py +++ b/lib/iris/tests/test_plot.py @@ -570,9 +570,9 @@ def override_with_decorated_methods(attr_dict, target_dict, @tests.skip_data @tests.iristest_timing_decorator -class TestPcolorNoBounds(six.with_metaclass(CheckForWarningsMetaclass, - tests.GraphicsTest_nometa, - SliceMixin)): +class TestPcolorNoBounds(CheckForWarningsMetaclass, + tests.GraphicsTest_nometa, + SliceMixin): """ Test the iris.plot.pcolor routine on a cube with coordinates that have no bounds. @@ -586,9 +586,9 @@ def setUp(self): @tests.skip_data @tests.iristest_timing_decorator -class TestPcolormeshNoBounds(six.with_metaclass(CheckForWarningsMetaclass, - tests.GraphicsTest_nometa, - SliceMixin)): +class TestPcolormeshNoBounds(CheckForWarningsMetaclass, + tests.GraphicsTest_nometa, + SliceMixin): """ Test the iris.plot.pcolormesh routine on a cube with coordinates that have no bounds. diff --git a/lib/iris/tests/unit/analysis/maths/__init__.py b/lib/iris/tests/unit/analysis/maths/__init__.py index 9ceedb826b..908c53d048 100644 --- a/lib/iris/tests/unit/analysis/maths/__init__.py +++ b/lib/iris/tests/unit/analysis/maths/__init__.py @@ -21,7 +21,7 @@ import iris.tests as tests -class CubeArithmeticBroadcastingTestMixin(six.with_metaclass(ABCMeta, object)): +class CubeArithmeticBroadcastingTestMixin(ABCMeta, object): # A framework for testing the broadcasting behaviour of the various cube # arithmetic operations. (A test for each operation inherits this). @abstractproperty @@ -110,7 +110,7 @@ def test_slice(self): err_msg=msg.format(dim)) -class CubeArithmeticMaskingTestMixin(six.with_metaclass(ABCMeta, object)): +class CubeArithmeticMaskingTestMixin(ABCMeta, object): # A framework for testing the mask handling behaviour of the various cube # arithmetic operations. (A test for each operation inherits this). @abstractproperty @@ -185,8 +185,7 @@ def SetUpReversed(self): return reversed1, reversed2 -class CubeArithmeticMaskedConstantTestMixin( - six.with_metaclass(ABCMeta, object)): +class CubeArithmeticMaskedConstantTestMixin(ABCMeta, object): def test_masked_constant_in_place(self): # Cube in_place arithmetic operation. diff --git a/lib/iris/tests/unit/merge/test_ProtoCube.py b/lib/iris/tests/unit/merge/test_ProtoCube.py index 26aab8ef75..89b5eb72b9 100644 --- a/lib/iris/tests/unit/merge/test_ProtoCube.py +++ b/lib/iris/tests/unit/merge/test_ProtoCube.py @@ -30,7 +30,7 @@ def example_cube(): units='K', attributes={'mint': 'thin'}) -class Mixin_register(six.with_metaclass(abc.ABCMeta, object)): +class Mixin_register(abc.ABCMeta, object): @property def cube1(self): return example_cube() diff --git a/lib/iris/tests/unit/tests/test_IrisTest.py b/lib/iris/tests/unit/tests/test_IrisTest.py index edec773a54..5f2d42fcd6 100644 --- a/lib/iris/tests/unit/tests/test_IrisTest.py +++ b/lib/iris/tests/unit/tests/test_IrisTest.py @@ -15,7 +15,7 @@ import numpy as np -class _MaskedArrayEquality(six.with_metaclass(ABCMeta, object)): +class _MaskedArrayEquality(ABCMeta, object): def setUp(self): self.arr1 = np.ma.array([1, 2, 3, 4], mask=[False, True, True, False]) self.arr2 = np.ma.array([1, 3, 2, 4], mask=[False, True, True, False]) diff --git a/lib/iris/util.py b/lib/iris/util.py index 0dc1f2622a..0aefbbd3c4 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -825,8 +825,7 @@ def __new__(cls, name, bases, namespace): @functools.total_ordering -class _OrderedHashable(six.with_metaclass(_MetaOrderedHashable, - Hashable)): +class _OrderedHashable(_MetaOrderedHashable, Hashable): """ Convenience class for creating "immutable", hashable, and ordered classes. diff --git a/tools/translator/__init__.py b/tools/translator/__init__.py index a9afd0bcec..7a44b71310 100644 --- a/tools/translator/__init__.py +++ b/tools/translator/__init__.py @@ -88,7 +88,7 @@ def encode(self, fuseki_process): self.targetmsg.format(**self.targetid)) -class Mappings(six.with_metaclass(ABCMeta, object)): +class Mappings(ABCMeta, object): """ Abstract base class to support the encoding of specific metarelate mapping translations. From c5d3a925d6749c35c257d1fe1f8a42ba5c635ad1 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 15:06:28 +0000 Subject: [PATCH 12/35] Removed uses of six.text_type. --- lib/iris/_cube_coord_common.py | 2 +- lib/iris/cube.py | 2 +- lib/iris/fileformats/netcdf.py | 4 ++-- lib/iris/tests/test_cdm.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/iris/_cube_coord_common.py b/lib/iris/_cube_coord_common.py index d600890494..248a4fff71 100644 --- a/lib/iris/_cube_coord_common.py +++ b/lib/iris/_cube_coord_common.py @@ -177,7 +177,7 @@ def rename(self, name): self.long_name = None except ValueError: self.standard_name = None - self.long_name = six.text_type(name) + self.long_name = str(name) # Always clear var_name when renaming. self.var_name = None diff --git a/lib/iris/cube.py b/lib/iris/cube.py index c669eb1ef3..b8314d814f 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -2276,7 +2276,7 @@ def vector_summary(vector_coords, cube_header, max_line_offset, if self.attributes: attribute_lines = [] for name, value in sorted(self.attributes.items()): - value = iris.util.clip_string(six.text_type(value)) + value = iris.util.clip_string(str(value)) line = u'{pad:{width}}{name}: {value}'.format(pad=' ', width=indent, name=name, diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index b67ff59ed6..9b02ba70db 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -469,7 +469,7 @@ def _pyke_stats(engine, cf_name): def _set_attributes(attributes, key, value): """Set attributes dictionary, converting unicode strings appropriately.""" - if isinstance(value, six.text_type): + if isinstance(value, str): try: attributes[str(key)] = str(value) except UnicodeEncodeError: @@ -2327,7 +2327,7 @@ def is_valid_packspec(p): else: msg = "The argument to packing must contain the key 'dtype'." raise ValueError(msg) - elif (isinstance(p, six.text_type) or isinstance(p, type) or + elif (isinstance(p, str) or isinstance(p, type) or isinstance(p, str)): pdtype = np.dtype(p) # Does nothing if it's already a numpy dtype if pdtype.kind != 'i' and pdtype.kind != 'u': diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index da2d4d6029..e07886382e 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -288,7 +288,7 @@ def test_cubelist_string(self): def test_basic_0d_cube(self): self.assertString(repr(self.cube_2d[0, 0]), ('cdm', 'str_repr', '0d_cube.__repr__.txt')) - self.assertString(six.text_type(self.cube_2d[0, 0]), + self.assertString(str(self.cube_2d[0, 0]), ('cdm', 'str_repr', '0d_cube.__unicode__.txt')) self.assertString(str(self.cube_2d[0, 0]), ('cdm', 'str_repr', '0d_cube.__str__.txt')) @@ -371,7 +371,7 @@ def test_adjusted_default_encoding(self): def test_unicode_attribute(self): self.assertString( - six.text_type(self.unicode_cube), + str(self.unicode_cube), ('cdm', 'str_repr', 'unicode_attribute.__unicode__.txt')) From c07e9d13266fcc92461b59d0ae3a6258c4bfcfd4 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 15:19:50 +0000 Subject: [PATCH 13/35] Removed uses of six.PY2 and PY3. --- lib/iris/analysis/maths.py | 15 +++++---------- lib/iris/coords.py | 11 ++--------- lib/iris/cube.py | 6 +----- lib/iris/fileformats/cf.py | 11 ++++------- lib/iris/fileformats/nimrod.py | 4 +--- lib/iris/tests/integration/test_netcdf.py | 8 ++++---- lib/iris/tests/test_basic_maths.py | 8 -------- lib/iris/tests/test_cdm.py | 18 ------------------ lib/iris/tests/test_constraints.py | 2 +- lib/iris/tests/test_cube_to_pp.py | 5 +---- .../tests/unit/fileformats/ff/test_FF2PP.py | 5 +---- .../unit/fileformats/pp/test__field_gen.py | 5 +---- .../unit/fileformats/pp/test_save_fields.py | 10 ++-------- tools/generate_std_names.py | 5 +---- 14 files changed, 24 insertions(+), 89 deletions(-) diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index 1f55f2c90f..5956710b23 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -906,16 +906,11 @@ def ws_units_func(u_cube, v_cube): if hasattr(data_func, 'nin'): self.nin = data_func.nin else: - if six.PY2: - (args, _, _, defaults) = inspect.getargspec(data_func) - self.nin = len(args) - ( - len(defaults) if defaults is not None else 0) - else: - sig = inspect.signature(data_func) - args = [param for param in sig.parameters.values() - if (param.kind != param.KEYWORD_ONLY and - param.default is param.empty)] - self.nin = len(args) + sig = inspect.signature(data_func) + args = [param for param in sig.parameters.values() + if (param.kind != param.KEYWORD_ONLY and + param.default is param.empty)] + self.nin = len(args) if self.nin not in [1, 2]: msg = ('{} requires {} input data arrays, the IFunc class ' diff --git a/lib/iris/coords.py b/lib/iris/coords.py index c9b0c27894..8d8141bcfe 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -622,16 +622,9 @@ def _value_type_name(self): kind = dtype.kind if kind in 'SU': # Establish the basic type name for 'string' type data. - # N.B. this means "unicode" in Python3, and "str" in Python2. value_type_name = 'string' - - # Override this if not the 'native' string type. - if six.PY3: - if kind == 'S': - value_type_name = 'bytes' - else: - if kind == 'U': - value_type_name = 'unicode' + if kind == 'S': + value_type_name = 'bytes' else: value_type_name = dtype.name diff --git a/lib/iris/cube.py b/lib/iris/cube.py index b8314d814f..da4119ecfd 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -2301,11 +2301,7 @@ def vector_summary(vector_coords, cube_header, max_line_offset, return summary def __str__(self): - # six has a decorator for this bit, but it doesn't do errors='replace'. - if six.PY3: - return self.summary() - else: - return self.summary().encode(errors='replace') + return self.summary() def __unicode__(self): return self.summary() diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index afbfd6950e..f75029eb3c 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -63,8 +63,7 @@ # NetCDF returns a different type for strings depending on Python version. def _is_str_dtype(var): - return ((six.PY2 and np.issubdtype(var.dtype, np.str_)) or - (six.PY3 and np.issubdtype(var.dtype, np.bytes_))) + return np.issubdtype(var.dtype, np.bytes_) ################################################################################ @@ -675,8 +674,7 @@ def cf_label_data(self, cf_data_var): # i.e. a character variable that only has one dimension (the length of the string). if self.ndim == 1: label_string = b''.join(label_data).strip() - if six.PY3: - label_string = label_string.decode('utf8') + label_string = label_string.decode('utf8') data = np.array([label_string]) else: # Determine the index of the string dimension. @@ -684,7 +682,7 @@ def cf_label_data(self, cf_data_var): # Calculate new label data shape (without string dimension) and create payload array. new_shape = tuple(dim_len for i, dim_len in enumerate(self.shape) if i != str_dim) - string_basetype = '|S%d' if six.PY2 else '|U%d' + string_basetype = '|U%d' string_dtype = string_basetype % self.shape[str_dim] data = np.empty(new_shape, dtype=string_dtype) @@ -696,8 +694,7 @@ def cf_label_data(self, cf_data_var): label_index = index + (slice(None, None),) label_string = b''.join(label_data[label_index]).strip() - if six.PY3: - label_string = label_string.decode('utf8') + label_string = label_string.decode('utf8') data[index] = label_string return data diff --git a/lib/iris/fileformats/nimrod.py b/lib/iris/fileformats/nimrod.py index 39468572f6..e4b6b915d3 100644 --- a/lib/iris/fileformats/nimrod.py +++ b/lib/iris/fileformats/nimrod.py @@ -68,9 +68,7 @@ def _read_chars(infile, num): """Read characters from the (big-endian) file.""" instr = infile.read(num) result = struct.unpack(">%ds" % num, instr)[0] - if six.PY3: - # For Python 3, convert raw bytes into a string. - result = result.decode() + result = result.decode() return result diff --git a/lib/iris/tests/integration/test_netcdf.py b/lib/iris/tests/integration/test_netcdf.py index 1338b5b7a2..2c007be911 100644 --- a/lib/iris/tests/integration/test_netcdf.py +++ b/lib/iris/tests/integration/test_netcdf.py @@ -275,8 +275,8 @@ def test_cmip6_volcello_load_issue_3367(self): # still receive a warning about other variables mentioned in # `cell_measures` i.e. a warning should be raised about missing # areacello. - areacello_str = "areacello" if six.PY3 else u"areacello" - volcello_str = "volcello" if six.PY3 else u"volcello" + areacello_str = "areacello" + volcello_str = "volcello" expected_msg = "Missing CF-netCDF measure variable %r, " \ "referenced by netCDF variable %r" \ % (areacello_str, volcello_str) @@ -339,8 +339,8 @@ def test_self_referencing_load_issue_3367(self): # still receive a warning about other variables mentioned in # `cell_measures` i.e. a warning should be raised about missing # areacello. - areacello_str = "areacello" if six.PY3 else u"areacello" - volcello_str = "volcello" if six.PY3 else u"volcello" + areacello_str = "areacello" + volcello_str = "volcello" expected_msg = "Missing CF-netCDF measure variable %r, " \ "referenced by netCDF variable %r" \ % (areacello_str, volcello_str) diff --git a/lib/iris/tests/test_basic_maths.py b/lib/iris/tests/test_basic_maths.py index 0c4185b0a7..4b9d9abf78 100644 --- a/lib/iris/tests/test_basic_maths.py +++ b/lib/iris/tests/test_basic_maths.py @@ -277,18 +277,10 @@ def vec_mag(u, v): self.assertCMLApproxData(b, ('analysis', 'apply_ifunc_frompyfunc.cml')) def test_ifunc_init_fail(self): - import six - # should fail because 'blah' is a string not a python function self.assertRaises(TypeError, iris.analysis.maths.IFunc, 'blah', lambda cube: cf_units.Unit('1')) - if six.PY2: - # should fail because math.sqrt is built-in function, which cannot - # be used in inspect.getargspec - self.assertRaises(TypeError, iris.analysis.maths.IFunc, math.sqrt, - lambda cube: cf_units.Unit('1')) - # should fail because np.frexp gives 2 arrays as output self.assertRaises(ValueError, iris.analysis.maths.IFunc, np.frexp, lambda cube: cf_units.Unit('1')) diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index e07886382e..2ba3e81abd 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -351,24 +351,6 @@ def unicode_encoding_change(self, new_encoding): sys.setdefaultencoding(default_encoding) del sys.setdefaultencoding - @unittest.skipIf(six.PY3, 'Encodings are sane in Python 3.') - def test_adjusted_default_encoding(self): - # Test cube str representation on non-system-default encodings. - # Doing this requires access to a sys method that is removed by default - # so reload sys to restore access. - # Note this does not currently work with utf-16 or utf-32. - - # Run assertions inside 'with' statement to ensure test file is - # accurately re-created. - with self.unicode_encoding_change('utf-8'): - self.assertString(str(self.unicode_cube), - ('cdm', 'str_repr', - 'unicode_attribute.__str__.utf8.txt')) - with self.unicode_encoding_change('ascii'): - self.assertString(str(self.unicode_cube), - ('cdm', 'str_repr', - 'unicode_attribute.__str__.ascii.txt')) - def test_unicode_attribute(self): self.assertString( str(self.unicode_cube), diff --git a/lib/iris/tests/test_constraints.py b/lib/iris/tests/test_constraints.py index 715a27c284..b39642a25c 100644 --- a/lib/iris/tests/test_constraints.py +++ b/lib/iris/tests/test_constraints.py @@ -332,7 +332,7 @@ def test_constraint_expressions(self): rt_l10 = repr(self.theta & self.level_10) expr = 'ConstraintCombination(%s, %s, )' % ( - rt, rl10, '__and__' if six.PY2 else 'and_') + rt, rl10, 'and_') self.assertEqual(expr, rt_l10) def test_string_repr(self): diff --git a/lib/iris/tests/test_cube_to_pp.py b/lib/iris/tests/test_cube_to_pp.py index 7206affefc..55d2355880 100644 --- a/lib/iris/tests/test_cube_to_pp.py +++ b/lib/iris/tests/test_cube_to_pp.py @@ -290,10 +290,7 @@ def fields_from_cube(cubes): to a temporary file, and then subsequently loading them again """ with tempfile.NamedTemporaryFile('w+b', suffix='.pp') as tmp_file: - if six.PY2: - fh = tmp_file.file - else: - fh = tmp_file + fh = tmp_file iris.save(cubes, fh, saver='pp') # make sure the fh is written to disk, and move it back to the diff --git a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py index 8029284969..0a278c3898 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py +++ b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py @@ -83,10 +83,7 @@ def mock_for_extract_field(self, fields, x=None, y=None): grid.vectors = mock.Mock(return_value=(x, y)) ff2pp._ff_header.grid = mock.Mock(return_value=grid) - if six.PY3: - open_func = 'builtins.open' - else: - open_func = '__builtin__.open' + open_func = 'builtins.open' with mock.patch('numpy.fromfile', return_value=[0]), \ mock.patch(open_func), \ mock.patch('struct.unpack_from', return_value=[4]), \ diff --git a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py index aa529fbd7c..8860779f3f 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py +++ b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py @@ -35,10 +35,7 @@ def make_pp_field_override(*args): np.fromfile.return_value = [] return result - if six.PY3: - open_func = 'builtins.open' - else: - open_func = '__builtin__.open' + open_func = 'builtins.open' with mock.patch('numpy.fromfile', return_value=[0]), \ mock.patch(open_func), \ mock.patch('struct.unpack_from', return_value=[4]), \ diff --git a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py index a9df529e2e..5e0661f356 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py +++ b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py @@ -31,10 +31,7 @@ def setUp(self): self.pp_field.save = asave def test_save(self): - if six.PY3: - open_func = 'builtins.open' - else: - open_func = '__builtin__.open' + open_func = 'builtins.open' m = mock.mock_open() with mock.patch(open_func, m, create=True): pp.save_fields([self.pp_field], 'foo.pp') @@ -42,10 +39,7 @@ def test_save(self): self.assertTrue(mock.call().write('saved') in m.mock_calls) def test_save_append(self): - if six.PY3: - open_func = 'builtins.open' - else: - open_func = '__builtin__.open' + open_func = 'builtins.open' m = mock.mock_open() with mock.patch(open_func, m, create=True): pp.save_fields([self.pp_field], 'foo.pp', append=True) diff --git a/tools/generate_std_names.py b/tools/generate_std_names.py index 77171485b1..a36c7af27d 100644 --- a/tools/generate_std_names.py +++ b/tools/generate_std_names.py @@ -98,10 +98,7 @@ def to_dict(infile, outfile): help='Path to resulting Python code') args = parser.parse_args() - if six.PY2: - encoding = {} - else: - encoding = {'encoding': 'utf-8'} + encoding = {'encoding': 'utf-8'} with open(args.input, 'r', **encoding) as in_fh: with open(args.output, 'w', **encoding) as out_fh: From 92c015a2dbd1e4d68845e0fe751621fb04c1a8f6 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 15:21:07 +0000 Subject: [PATCH 14/35] Removed the single use of six.integer_types. --- lib/iris/_merge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/_merge.py b/lib/iris/_merge.py index 4ce313ccf3..80ceaaf5eb 100644 --- a/lib/iris/_merge.py +++ b/lib/iris/_merge.py @@ -1328,7 +1328,7 @@ def axis_and_name(name): axis_dict = {'T': 1, 'Z': 2, 'Y': 3, 'X': 4} axis_index = axis_dict.get(self._guess_axis(name), 0) # The middle element ensures sorting is the same as Python 2. - return (axis_index, not isinstance(name, six.integer_types), name) + return (axis_index, not isinstance(name, int), name) names = sorted(space, key=axis_and_name) dim_by_name = {} From c52a3e9fbb68f87d63ab425acfae1636aefa8169 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 15:23:31 +0000 Subject: [PATCH 15/35] Removed uses of six.StringIO(). --- lib/iris/tests/test_file_save.py | 2 +- lib/iris/tests/test_util.py | 11 ++++++----- lib/iris/tests/unit/util/test_describe_diff.py | 4 +++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/iris/tests/test_file_save.py b/lib/iris/tests/test_file_save.py index 0f62975757..02f2fd2f37 100644 --- a/lib/iris/tests/test_file_save.py +++ b/lib/iris/tests/test_file_save.py @@ -122,7 +122,7 @@ def test_filehandle(self): save_by_filehandle(self.temp_filename1, self.temp_filename2, self.cube1, dot.save, binary_mode = True) def test_bytesio(self): - sio = six.StringIO() + sio = io.StringIO # Save from dot direct dot.save(self.cube1, self.temp_filename1) diff --git a/lib/iris/tests/test_util.py b/lib/iris/tests/test_util.py index 2df4778e7b..3d8b2908f8 100644 --- a/lib/iris/tests/test_util.py +++ b/lib/iris/tests/test_util.py @@ -16,6 +16,7 @@ import iris.tests as tests import inspect +import io import cf_units import numpy as np @@ -152,7 +153,7 @@ def test_identical(self): test_cube_a = stock.realistic_4d() test_cube_b = stock.realistic_4d() - return_sio = six.StringIO() + return_sio = io.StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -166,7 +167,7 @@ def test_different(self): test_cube_a.attributes['Conventions'] = 'CF-1.5' test_cube_b.attributes['Conventions'] = 'CF-1.6' - return_sio = six.StringIO() + return_sio = io.StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -178,7 +179,7 @@ def test_different(self): test_cube_a.standard_name = "relative_humidity" - return_sio = six.StringIO() + return_sio = io.StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -190,7 +191,7 @@ def test_different(self): test_cube_a.units = cf_units.Unit('m') - return_sio = six.StringIO() + return_sio = io.StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -200,7 +201,7 @@ def test_different(self): test_cube_a = stock.realistic_4d() test_cube_b = stock.realistic_4d().collapsed('model_level_number', iris.analysis.MEAN) - return_sio = six.StringIO() + return_sio = io.StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() diff --git a/lib/iris/tests/unit/util/test_describe_diff.py b/lib/iris/tests/unit/util/test_describe_diff.py index a50886873d..c0a263ebbf 100644 --- a/lib/iris/tests/unit/util/test_describe_diff.py +++ b/lib/iris/tests/unit/util/test_describe_diff.py @@ -10,6 +10,8 @@ # importing anything else import iris.tests as tests +import io + import numpy as np import iris.cube @@ -22,7 +24,7 @@ def setUp(self): self.cube_b = self.cube_a.copy() def _compare_result(self, cube_a, cube_b): - result_sio = six.StringIO() + result_sio = io.StringIO() describe_diff(cube_a, cube_b, output_file=result_sio) return result_sio.getvalue() From b9eb7069d0286cb5c82e39cb4e8423d20e257740 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 15:33:40 +0000 Subject: [PATCH 16/35] Improved StringIO import. --- lib/iris/tests/test_file_save.py | 5 +++-- lib/iris/tests/test_util.py | 13 +++++++------ lib/iris/tests/unit/util/test_describe_diff.py | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/iris/tests/test_file_save.py b/lib/iris/tests/test_file_save.py index 02f2fd2f37..c4b644dbc0 100644 --- a/lib/iris/tests/test_file_save.py +++ b/lib/iris/tests/test_file_save.py @@ -12,7 +12,6 @@ # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests -import io import os import unittest @@ -22,6 +21,8 @@ import iris.fileformats.pp as pp import iris.fileformats.dot as dot +from io import StringIO + # Make a test skip decorator, for when DOT not available skip_dotpng = unittest.skipIf( not dot.DOT_AVAILABLE, @@ -122,7 +123,7 @@ def test_filehandle(self): save_by_filehandle(self.temp_filename1, self.temp_filename2, self.cube1, dot.save, binary_mode = True) def test_bytesio(self): - sio = io.StringIO + sio = StringIO() # Save from dot direct dot.save(self.cube1, self.temp_filename1) diff --git a/lib/iris/tests/test_util.py b/lib/iris/tests/test_util.py index 3d8b2908f8..e8ce7e9c96 100644 --- a/lib/iris/tests/test_util.py +++ b/lib/iris/tests/test_util.py @@ -16,11 +16,12 @@ import iris.tests as tests import inspect -import io import cf_units import numpy as np +from io import StringIO + import iris.analysis import iris.coords import iris.tests.stock as stock @@ -153,7 +154,7 @@ def test_identical(self): test_cube_a = stock.realistic_4d() test_cube_b = stock.realistic_4d() - return_sio = io.StringIO() + return_sio = StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -167,7 +168,7 @@ def test_different(self): test_cube_a.attributes['Conventions'] = 'CF-1.5' test_cube_b.attributes['Conventions'] = 'CF-1.6' - return_sio = io.StringIO() + return_sio = StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -179,7 +180,7 @@ def test_different(self): test_cube_a.standard_name = "relative_humidity" - return_sio = io.StringIO() + return_sio = StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -191,7 +192,7 @@ def test_different(self): test_cube_a.units = cf_units.Unit('m') - return_sio = io.StringIO() + return_sio = StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() @@ -201,7 +202,7 @@ def test_different(self): test_cube_a = stock.realistic_4d() test_cube_b = stock.realistic_4d().collapsed('model_level_number', iris.analysis.MEAN) - return_sio = io.StringIO() + return_sio = StringIO() iris.util.describe_diff(test_cube_a, test_cube_b, output_file=return_sio) return_str = return_sio.getvalue() diff --git a/lib/iris/tests/unit/util/test_describe_diff.py b/lib/iris/tests/unit/util/test_describe_diff.py index c0a263ebbf..989b144f53 100644 --- a/lib/iris/tests/unit/util/test_describe_diff.py +++ b/lib/iris/tests/unit/util/test_describe_diff.py @@ -10,10 +10,10 @@ # importing anything else import iris.tests as tests -import io - import numpy as np +from io import StringIO + import iris.cube from iris.util import describe_diff @@ -24,7 +24,7 @@ def setUp(self): self.cube_b = self.cube_a.copy() def _compare_result(self, cube_a, cube_b): - result_sio = io.StringIO() + result_sio = StringIO() describe_diff(cube_a, cube_b, output_file=result_sio) return result_sio.getvalue() From b102fe4fc445f8e77f2d4a103fd4d9e3a70bcaab Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 16:33:02 +0000 Subject: [PATCH 17/35] Fixed incorrect argument order for metclasses. --- lib/iris/aux_factory.py | 2 +- lib/iris/coord_systems.py | 2 +- lib/iris/coords.py | 2 +- lib/iris/fileformats/cf.py | 2 +- lib/iris/fileformats/pp.py | 2 +- lib/iris/tests/__init__.py | 2 +- lib/iris/tests/test_plot.py | 12 ++++++------ lib/iris/tests/unit/analysis/maths/__init__.py | 6 +++--- lib/iris/tests/unit/merge/test_ProtoCube.py | 2 +- lib/iris/tests/unit/tests/test_IrisTest.py | 2 +- lib/iris/util.py | 2 +- tools/translator/__init__.py | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/iris/aux_factory.py b/lib/iris/aux_factory.py index 6bcdce1948..db74b7fef1 100644 --- a/lib/iris/aux_factory.py +++ b/lib/iris/aux_factory.py @@ -21,7 +21,7 @@ import iris.coords -class AuxCoordFactory(ABCMeta, CFVariableMixin): +class AuxCoordFactory(CFVariableMixin, metaclass=ABCMeta): """ Represents a "factory" which can manufacture an additional auxiliary coordinate on demand, by combining the values of other coordinates. diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index 7a5ded2e04..4c2c2b86af 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -17,7 +17,7 @@ import cartopy.crs as ccrs -class CoordSystem(ABCMeta, object): +class CoordSystem(object, metaclass=ABCMeta): """ Abstract base class for coordinate systems. diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 8d8141bcfe..358d04ebac 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -40,7 +40,7 @@ from iris.util import points_step -class _DimensionalMetadata(ABCMeta, CFVariableMixin): +class _DimensionalMetadata(CFVariableMixin, metaclass=ABCMeta): """ Superclass for dimensional metadata. diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index f75029eb3c..f4cb0fe9b4 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -67,7 +67,7 @@ def _is_str_dtype(var): ################################################################################ -class CFVariable(ABCMeta, object): +class CFVariable(object, metaclass=ABCMeta): """Abstract base class wrapper for a CF-netCDF variable.""" #: Name of the netCDF variable attribute that identifies this diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index b25880c11b..c2a9e28b88 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -753,7 +753,7 @@ def _pp_attribute_names(header_defn): return normal_headers + special_headers + extra_data + special_attributes -class PPField(abc.ABCMeta, object): +class PPField(object, metaclass=abc.ABCMeta): """ A generic class for PP fields - not specific to a particular header release number. diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 9ae1916ad8..553fb39676 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -972,7 +972,7 @@ def __new__(cls, clsname, base_classes, attrs): return result -class IrisTest(_TestTimingsMetaclass, IrisTest_nometa): +class IrisTest(IrisTest_nometa, metaclass=_TestTimingsMetaclass): # Derive the 'ordinary' IrisTest from IrisTest_nometa, but add the # metaclass that enables test timings output. # This means that all subclasses also get the timing behaviour. diff --git a/lib/iris/tests/test_plot.py b/lib/iris/tests/test_plot.py index 625754d764..c14b8d7b60 100644 --- a/lib/iris/tests/test_plot.py +++ b/lib/iris/tests/test_plot.py @@ -570,9 +570,9 @@ def override_with_decorated_methods(attr_dict, target_dict, @tests.skip_data @tests.iristest_timing_decorator -class TestPcolorNoBounds(CheckForWarningsMetaclass, - tests.GraphicsTest_nometa, - SliceMixin): +class TestPcolorNoBounds(tests.GraphicsTest_nometa, + SliceMixin, + metaclass=CheckForWarningsMetaclass): """ Test the iris.plot.pcolor routine on a cube with coordinates that have no bounds. @@ -586,9 +586,9 @@ def setUp(self): @tests.skip_data @tests.iristest_timing_decorator -class TestPcolormeshNoBounds(CheckForWarningsMetaclass, - tests.GraphicsTest_nometa, - SliceMixin): +class TestPcolormeshNoBounds(tests.GraphicsTest_nometa, + SliceMixin, + metaclass=CheckForWarningsMetaclass): """ Test the iris.plot.pcolormesh routine on a cube with coordinates that have no bounds. diff --git a/lib/iris/tests/unit/analysis/maths/__init__.py b/lib/iris/tests/unit/analysis/maths/__init__.py index 908c53d048..b3b92be350 100644 --- a/lib/iris/tests/unit/analysis/maths/__init__.py +++ b/lib/iris/tests/unit/analysis/maths/__init__.py @@ -21,7 +21,7 @@ import iris.tests as tests -class CubeArithmeticBroadcastingTestMixin(ABCMeta, object): +class CubeArithmeticBroadcastingTestMixin(object, metaclass=ABCMeta): # A framework for testing the broadcasting behaviour of the various cube # arithmetic operations. (A test for each operation inherits this). @abstractproperty @@ -110,7 +110,7 @@ def test_slice(self): err_msg=msg.format(dim)) -class CubeArithmeticMaskingTestMixin(ABCMeta, object): +class CubeArithmeticMaskingTestMixin(object, metaclass=ABCMeta): # A framework for testing the mask handling behaviour of the various cube # arithmetic operations. (A test for each operation inherits this). @abstractproperty @@ -185,7 +185,7 @@ def SetUpReversed(self): return reversed1, reversed2 -class CubeArithmeticMaskedConstantTestMixin(ABCMeta, object): +class CubeArithmeticMaskedConstantTestMixin(object, metaclass=ABCMeta): def test_masked_constant_in_place(self): # Cube in_place arithmetic operation. diff --git a/lib/iris/tests/unit/merge/test_ProtoCube.py b/lib/iris/tests/unit/merge/test_ProtoCube.py index 89b5eb72b9..c8e620224a 100644 --- a/lib/iris/tests/unit/merge/test_ProtoCube.py +++ b/lib/iris/tests/unit/merge/test_ProtoCube.py @@ -30,7 +30,7 @@ def example_cube(): units='K', attributes={'mint': 'thin'}) -class Mixin_register(abc.ABCMeta, object): +class Mixin_register(object, metaclass=abc.ABCMeta): @property def cube1(self): return example_cube() diff --git a/lib/iris/tests/unit/tests/test_IrisTest.py b/lib/iris/tests/unit/tests/test_IrisTest.py index 5f2d42fcd6..aeb1510f12 100644 --- a/lib/iris/tests/unit/tests/test_IrisTest.py +++ b/lib/iris/tests/unit/tests/test_IrisTest.py @@ -15,7 +15,7 @@ import numpy as np -class _MaskedArrayEquality(ABCMeta, object): +class _MaskedArrayEquality(object, metaclass=ABCMeta): def setUp(self): self.arr1 = np.ma.array([1, 2, 3, 4], mask=[False, True, True, False]) self.arr2 = np.ma.array([1, 3, 2, 4], mask=[False, True, True, False]) diff --git a/lib/iris/util.py b/lib/iris/util.py index 0aefbbd3c4..78da4dce53 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -825,7 +825,7 @@ def __new__(cls, name, bases, namespace): @functools.total_ordering -class _OrderedHashable(_MetaOrderedHashable, Hashable): +class _OrderedHashable(Hashable, metaclass=_MetaOrderedHashable): """ Convenience class for creating "immutable", hashable, and ordered classes. diff --git a/tools/translator/__init__.py b/tools/translator/__init__.py index 7a44b71310..50ca9cc87b 100644 --- a/tools/translator/__init__.py +++ b/tools/translator/__init__.py @@ -88,7 +88,7 @@ def encode(self, fuseki_process): self.targetmsg.format(**self.targetid)) -class Mappings(ABCMeta, object): +class Mappings(object, metaclass=ABCMeta): """ Abstract base class to support the encoding of specific metarelate mapping translations. From 2b69987269105f758ff96c1edd8b29c6c9bd7b0e Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 16:42:38 +0000 Subject: [PATCH 18/35] Set Stickler flake8 option to python3 specifically. --- .stickler.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.stickler.yml b/.stickler.yml index 31d097914e..357daa6741 100644 --- a/.stickler.yml +++ b/.stickler.yml @@ -1,5 +1,6 @@ linters: flake8: + python: 3 files: ignore: From a2a61c147c9ff9c85bf746f1cf7e194564ebf5fc Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 16:45:44 +0000 Subject: [PATCH 19/35] W605 r string for escape characters. --- lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py index 5a4e1d470f..c9d7e215a7 100644 --- a/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py +++ b/lib/iris/tests/unit/analysis/cartography/test__quadrant_area.py @@ -111,7 +111,7 @@ def test_too_many_lon_bounds_error(self): def _assert_error_on_malformed_bounds(self, lat_bnds, lon_bnds): with self.assertRaisesRegex(ValueError, - 'Bounds must be \[n,2\] array'): + r'Bounds must be \[n,2\] array'): _quadrant_area(np.array(lat_bnds), np.array(lon_bnds), 1.) From 38456837ef3bc94b6a6ebf32e51a6cfe3a532956 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 16:54:03 +0000 Subject: [PATCH 20/35] Removed use of six.create_bound_method. --- lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py index c88239c7cb..893d914eca 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py @@ -17,6 +17,7 @@ import cf_units import numpy as np +from types import MethodType from iris.fileformats.pp_load_rules import convert from iris.util import guess_coord_axis @@ -167,7 +168,7 @@ def test_365_calendar(self): t1=cftime.datetime(2013, 1, 1, 12, 0, 0), t2=cftime.datetime(2013, 1, 2, 12, 0, 0), spec=PPField3) - f.time_unit = six.create_bound_method(PPField3.time_unit, f) + f.time_unit = MethodType(PPField3.time_unit, f) f.calendar = cf_units.CALENDAR_365_DAY (factories, references, standard_name, long_name, units, attributes, cell_methods, dim_coords_and_dims, From 73d81b651ed35778cf86574f9acba18a64045cd9 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 16:58:02 +0000 Subject: [PATCH 21/35] Removed uses of six.moves.cPickle. --- lib/iris/tests/integration/test_pickle.py | 2 +- lib/iris/tests/test_pickling.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/iris/tests/integration/test_pickle.py b/lib/iris/tests/integration/test_pickle.py index a8e2aad20d..7e9b696b8e 100644 --- a/lib/iris/tests/integration/test_pickle.py +++ b/lib/iris/tests/integration/test_pickle.py @@ -9,8 +9,8 @@ # importing anything else. import iris.tests as tests +import pickle import unittest -import six.moves.cPickle as pickle import iris if tests.GRIB_AVAILABLE: diff --git a/lib/iris/tests/test_pickling.py b/lib/iris/tests/test_pickling.py index 97e86da90a..dab1be25e7 100644 --- a/lib/iris/tests/test_pickling.py +++ b/lib/iris/tests/test_pickling.py @@ -14,8 +14,8 @@ # before importing anything else. import iris.tests as tests -import six.moves.cPickle as pickle import io +import pickle import cf_units @@ -26,7 +26,7 @@ class TestPickle(tests.IrisTest): def pickle_then_unpickle(self, obj): """ - Returns a generator of ("cpickle protocol number", object) tuples. + Returns a generator of ("pickle protocol number", object) tuples. """ for protocol in range(1 + pickle.HIGHEST_PROTOCOL): From de82eeee20a9f969b021efcd19bc6d674644d476 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 17:00:07 +0000 Subject: [PATCH 22/35] Removed use of six.unichr. --- lib/iris/tests/test_cdm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 2ba3e81abd..1b1142b16d 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -242,7 +242,7 @@ def setUp(self): path = tests.get_data_path(('PP', 'simple_pp', 'global.pp')) self.cube_2d = iris.load_cube(path) # Generate the unicode cube up here now it's used in two tests. - unicode_str = six.unichr(40960) + u'abcd' + six.unichr(1972) + unicode_str = chr(40960) + u'abcd' + chr(1972) self.unicode_cube = iris.tests.stock.simple_1d() self.unicode_cube.attributes['source'] = unicode_str From a93430bc8f774b298106ec5e584f3bc31a098409 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 17:13:42 +0000 Subject: [PATCH 23/35] Revert "Removed use of six.unichr." This reverts commit 92eb188ece495d497ae8bfaeed9e3e4b1a26c0dd. --- lib/iris/tests/test_cdm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 1b1142b16d..2ba3e81abd 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -242,7 +242,7 @@ def setUp(self): path = tests.get_data_path(('PP', 'simple_pp', 'global.pp')) self.cube_2d = iris.load_cube(path) # Generate the unicode cube up here now it's used in two tests. - unicode_str = chr(40960) + u'abcd' + chr(1972) + unicode_str = six.unichr(40960) + u'abcd' + six.unichr(1972) self.unicode_cube = iris.tests.stock.simple_1d() self.unicode_cube.attributes['source'] = unicode_str From 29963408a5ba166ea12a40890b4a927e12bb4856 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 17:16:36 +0000 Subject: [PATCH 24/35] Removed use of six.unichr. --- lib/iris/tests/test_cdm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 2ba3e81abd..1b1142b16d 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -242,7 +242,7 @@ def setUp(self): path = tests.get_data_path(('PP', 'simple_pp', 'global.pp')) self.cube_2d = iris.load_cube(path) # Generate the unicode cube up here now it's used in two tests. - unicode_str = six.unichr(40960) + u'abcd' + six.unichr(1972) + unicode_str = chr(40960) + u'abcd' + chr(1972) self.unicode_cube = iris.tests.stock.simple_1d() self.unicode_cube.attributes['source'] = unicode_str From fc4ecce4901de3963eb079a82fda1d2c39b3cafd Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 17:20:07 +0000 Subject: [PATCH 25/35] Removed uses of six.moves. --- docs/iris/example_code/Meteorology/COP_maps.py | 2 -- docs/iris/src/sphinxext/generate_package_rst.py | 1 - .../regridding_plots/regridded_to_global_area_weighted.py | 1 - lib/iris/_concatenate.py | 1 - lib/iris/_constraints.py | 1 - lib/iris/_lazy_data.py | 1 - lib/iris/_merge.py | 1 - lib/iris/analysis/__init__.py | 1 - lib/iris/analysis/_interpolation.py | 1 - lib/iris/analysis/_regrid.py | 1 - lib/iris/analysis/_scipy_interpolate.py | 1 - lib/iris/analysis/calculus.py | 1 - lib/iris/analysis/cartography.py | 1 - lib/iris/analysis/geometry.py | 1 - lib/iris/analysis/maths.py | 1 - lib/iris/analysis/stats.py | 1 - lib/iris/analysis/trajectory.py | 1 - lib/iris/aux_factory.py | 1 - lib/iris/config.py | 5 +++++ lib/iris/coord_categorisation.py | 1 - lib/iris/coords.py | 2 -- lib/iris/cube.py | 1 - lib/iris/experimental/animate.py | 1 - lib/iris/experimental/regrid.py | 1 - lib/iris/experimental/regrid_conservative.py | 1 - lib/iris/experimental/representation.py | 1 - lib/iris/experimental/stratify.py | 1 - lib/iris/fileformats/_ff.py | 1 - lib/iris/fileformats/_ff_cross_references.py | 1 - lib/iris/fileformats/_structured_array_identification.py | 1 - lib/iris/fileformats/name_loaders.py | 1 - lib/iris/fileformats/netcdf.py | 4 ++++ lib/iris/fileformats/pp.py | 1 - lib/iris/fileformats/pp_load_rules.py | 1 - lib/iris/fileformats/rules.py | 1 - lib/iris/fileformats/um/_fast_load.py | 1 - lib/iris/fileformats/um/_fast_load_structured_fields.py | 1 - lib/iris/fileformats/um_cf_map.py | 1 - lib/iris/io/__init__.py | 1 - lib/iris/iterate.py | 1 - lib/iris/palette.py | 1 - lib/iris/plot.py | 1 - lib/iris/tests/__init__.py | 1 - .../test_regrid_area_weighted_rectilinear_src_and_grid.py | 2 -- lib/iris/tests/experimental/test_animate.py | 2 -- .../tests/integration/aux_factory/test_OceanSigmaZFactory.py | 4 +--- lib/iris/tests/integration/concatenate/test_concatenate.py | 2 -- lib/iris/tests/integration/fast_load/test_fast_load.py | 2 -- lib/iris/tests/integration/test_netcdf.py | 1 - lib/iris/tests/integration/test_regridding.py | 4 +--- lib/iris/tests/integration/test_trajectory.py | 2 -- lib/iris/tests/stock/__init__.py | 1 - lib/iris/tests/stock/_stock_2d_latlons.py | 1 - lib/iris/tests/test_analysis.py | 1 - lib/iris/tests/test_cell.py | 1 - lib/iris/tests/test_constraints.py | 1 - lib/iris/tests/test_coord_api.py | 2 -- lib/iris/tests/test_coordsystem.py | 1 - lib/iris/tests/test_cube_to_pp.py | 1 - lib/iris/tests/test_ff.py | 2 -- lib/iris/tests/test_iterate.py | 2 -- lib/iris/tests/test_mapping.py | 1 - lib/iris/tests/test_merge.py | 2 -- lib/iris/tests/test_pandas.py | 3 +-- lib/iris/tests/test_pickling.py | 4 +--- lib/iris/tests/test_plot.py | 1 - lib/iris/tests/test_pp_module.py | 2 -- lib/iris/tests/test_pp_to_cube.py | 2 -- lib/iris/tests/test_util.py | 1 - lib/iris/tests/unit/analysis/maths/__init__.py | 1 - lib/iris/tests/unit/analysis/maths/test__output_dtype.py | 4 +--- .../tests/unit/analysis/regrid/test_RectilinearRegridder.py | 4 +--- .../tests/unit/analysis/regrid/test__CurvilinearRegridder.py | 4 +--- lib/iris/tests/unit/analysis/stats/test_pearsonr.py | 4 +--- lib/iris/tests/unit/analysis/test_PERCENTILE.py | 4 +--- lib/iris/tests/unit/analysis/test_WPERCENTILE.py | 4 +--- lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py | 4 +--- .../trajectory/test_UnstructuredNearestNeighbourRegridder.py | 1 - lib/iris/tests/unit/concatenate/test_concatenate.py | 2 -- .../unit/coord_categorisation/test_add_categorised_coord.py | 2 -- lib/iris/tests/unit/cube/test_Cube.py | 4 +--- lib/iris/tests/unit/cube/test_CubeList.py | 4 +--- .../experimental/equalise_cubes/test_equalise_attributes.py | 2 -- .../test_regrid_weighted_curvilinear_to_rectilinear.py | 2 -- .../representation/test_CubeListRepresentation.py | 1 - .../experimental/representation/test_CubeRepresentation.py | 1 - lib/iris/tests/unit/fileformats/cf/test_CFReader.py | 4 +--- lib/iris/tests/unit/fileformats/ff/test_FF2PP.py | 1 - .../unit/fileformats/name_loaders/test__generate_cubes.py | 4 +--- .../netcdf/test__FillValueMaskCheckAndStoreTarget.py | 4 +--- lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py | 4 +--- lib/iris/tests/unit/fileformats/netcdf/test_save.py | 4 +--- .../pp_load_rules/test__convert_vertical_coords.py | 4 +--- .../tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py | 4 +--- .../fileformats/pp_load_rules/test__model_level_number.py | 4 +--- .../fileformats/pp_load_rules/test__reshape_vector_args.py | 4 +--- .../tests/unit/fileformats/pp_load_rules/test_convert.py | 1 - .../structured_array_identification/test_ArrayStructure.py | 4 +--- .../structured_array_identification/test_GroupStructure.py | 4 +--- lib/iris/tests/unit/fileformats/test_rules.py | 2 -- .../test_group_structured_fields.py | 2 -- lib/iris/tests/unit/plot/__init__.py | 4 +--- .../unit/plot/test__get_plot_defn_custom_coords_picked.py | 3 +-- lib/iris/tests/unit/time/test_PartialDateTime.py | 1 - lib/iris/tests/unit/util/test__coord_regular.py | 1 - lib/iris/tests/unit/util/test__slice_data_with_keys.py | 1 - lib/iris/tests/unit/util/test_broadcast_to_shape.py | 2 -- lib/iris/tests/unit/util/test_new_axis.py | 4 +--- lib/iris/util.py | 1 - tools/gen_stash_refs.py | 5 +++++ tools/gen_translations.py | 1 - tools/generate_std_names.py | 1 - tools/translator/__init__.py | 3 +-- 113 files changed, 42 insertions(+), 183 deletions(-) diff --git a/docs/iris/example_code/Meteorology/COP_maps.py b/docs/iris/example_code/Meteorology/COP_maps.py index a84f550004..e3ec8cb4af 100644 --- a/docs/iris/example_code/Meteorology/COP_maps.py +++ b/docs/iris/example_code/Meteorology/COP_maps.py @@ -21,8 +21,6 @@ doi:10.1029/2009EO210001. """ -from six.moves import zip - import os.path import matplotlib.pyplot as plt import numpy as np diff --git a/docs/iris/src/sphinxext/generate_package_rst.py b/docs/iris/src/sphinxext/generate_package_rst.py index 1b26e57829..cb9644c785 100644 --- a/docs/iris/src/sphinxext/generate_package_rst.py +++ b/docs/iris/src/sphinxext/generate_package_rst.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa import os import sys diff --git a/docs/iris/src/userguide/regridding_plots/regridded_to_global_area_weighted.py b/docs/iris/src/userguide/regridding_plots/regridded_to_global_area_weighted.py index b43246b758..d712f0d613 100644 --- a/docs/iris/src/userguide/regridding_plots/regridded_to_global_area_weighted.py +++ b/docs/iris/src/userguide/regridding_plots/regridded_to_global_area_weighted.py @@ -1,5 +1,4 @@ -from six.moves import (filter, input, map, range, zip) # noqa import iris import iris.analysis diff --git a/lib/iris/_concatenate.py b/lib/iris/_concatenate.py index e6f070bba5..9b7f73a182 100644 --- a/lib/iris/_concatenate.py +++ b/lib/iris/_concatenate.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import defaultdict, namedtuple from copy import deepcopy diff --git a/lib/iris/_constraints.py b/lib/iris/_constraints.py index d272b319e0..7d0abc89da 100644 --- a/lib/iris/_constraints.py +++ b/lib/iris/_constraints.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa try: # Python 3 from collections.abc import Iterable, Mapping diff --git a/lib/iris/_lazy_data.py b/lib/iris/_lazy_data.py index ab8732ea2a..64b38c994e 100644 --- a/lib/iris/_lazy_data.py +++ b/lib/iris/_lazy_data.py @@ -9,7 +9,6 @@ To avoid replicating implementation-dependent test and conversion code. """ -from six.moves import (filter, input, map, range, zip) # noqa from functools import wraps diff --git a/lib/iris/_merge.py b/lib/iris/_merge.py index 80ceaaf5eb..80f90cbf07 100644 --- a/lib/iris/_merge.py +++ b/lib/iris/_merge.py @@ -11,7 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six from collections import namedtuple, OrderedDict diff --git a/lib/iris/analysis/__init__.py b/lib/iris/analysis/__init__.py index 952dd91120..3666388092 100644 --- a/lib/iris/analysis/__init__.py +++ b/lib/iris/analysis/__init__.py @@ -35,7 +35,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import OrderedDict try: # Python 3 diff --git a/lib/iris/analysis/_interpolation.py b/lib/iris/analysis/_interpolation.py index e778e2911f..1339eaf1a8 100644 --- a/lib/iris/analysis/_interpolation.py +++ b/lib/iris/analysis/_interpolation.py @@ -5,7 +5,6 @@ # licensing details. """A collection of helpers for interpolation.""" -from six.moves import (filter, input, map, range, zip) # noqa from collections import namedtuple from itertools import product diff --git a/lib/iris/analysis/_regrid.py b/lib/iris/analysis/_regrid.py index bd4ad8926c..7bdfc46eea 100644 --- a/lib/iris/analysis/_regrid.py +++ b/lib/iris/analysis/_regrid.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa import copy import functools diff --git a/lib/iris/analysis/_scipy_interpolate.py b/lib/iris/analysis/_scipy_interpolate.py index 2f288a8dec..55f955c122 100644 --- a/lib/iris/analysis/_scipy_interpolate.py +++ b/lib/iris/analysis/_scipy_interpolate.py @@ -1,4 +1,3 @@ -from six.moves import (filter, input, map, range, zip) # noqa import itertools diff --git a/lib/iris/analysis/calculus.py b/lib/iris/analysis/calculus.py index 11473d7f2f..d25edd2a4d 100644 --- a/lib/iris/analysis/calculus.py +++ b/lib/iris/analysis/calculus.py @@ -10,7 +10,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import re import warnings diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index f9233750a1..c741fb1e7e 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import namedtuple import copy diff --git a/lib/iris/analysis/geometry.py b/lib/iris/analysis/geometry.py index 7537ce04aa..00cba19f4c 100644 --- a/lib/iris/analysis/geometry.py +++ b/lib/iris/analysis/geometry.py @@ -11,7 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import warnings diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index 5956710b23..0523dcfe9d 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import inspect import math diff --git a/lib/iris/analysis/stats.py b/lib/iris/analysis/stats.py index 5667d308d0..6fc182e0dd 100644 --- a/lib/iris/analysis/stats.py +++ b/lib/iris/analysis/stats.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import numpy as np import numpy.ma as ma diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index 76623a3a15..1d5a65b91d 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -9,7 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import math diff --git a/lib/iris/aux_factory.py b/lib/iris/aux_factory.py index db74b7fef1..3b9db8ffd3 100644 --- a/lib/iris/aux_factory.py +++ b/lib/iris/aux_factory.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six from abc import ABCMeta, abstractmethod, abstractproperty diff --git a/lib/iris/config.py b/lib/iris/config.py index 747a721c63..7bdb92ff5a 100644 --- a/lib/iris/config.py +++ b/lib/iris/config.py @@ -29,7 +29,12 @@ ---------- """ +<<<<<<< HEAD from six.moves import configparser +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed uses of six.moves. import contextlib import os.path diff --git a/lib/iris/coord_categorisation.py b/lib/iris/coord_categorisation.py index 846befd2fa..0dccb5be32 100644 --- a/lib/iris/coord_categorisation.py +++ b/lib/iris/coord_categorisation.py @@ -16,7 +16,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import calendar import collections diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 358d04ebac..3575bcb5f4 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six from abc import ABCMeta @@ -19,7 +18,6 @@ from collections import Iterator import copy from itertools import chain -from six.moves import zip_longest import operator import warnings import zlib diff --git a/lib/iris/cube.py b/lib/iris/cube.py index da4119ecfd..053d7a76a7 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -9,7 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six from collections import namedtuple, OrderedDict diff --git a/lib/iris/experimental/animate.py b/lib/iris/experimental/animate.py index 63e3b7d716..6b8027e300 100644 --- a/lib/iris/experimental/animate.py +++ b/lib/iris/experimental/animate.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import warnings diff --git a/lib/iris/experimental/regrid.py b/lib/iris/experimental/regrid.py index b32a8e3e36..78e27c1701 100644 --- a/lib/iris/experimental/regrid.py +++ b/lib/iris/experimental/regrid.py @@ -7,7 +7,6 @@ Regridding functions. """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import namedtuple import copy diff --git a/lib/iris/experimental/regrid_conservative.py b/lib/iris/experimental/regrid_conservative.py index e7520404c8..1a175ebaa7 100644 --- a/lib/iris/experimental/regrid_conservative.py +++ b/lib/iris/experimental/regrid_conservative.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import cartopy.crs as ccrs import numpy as np diff --git a/lib/iris/experimental/representation.py b/lib/iris/experimental/representation.py index 9127349754..c5d37b0436 100644 --- a/lib/iris/experimental/representation.py +++ b/lib/iris/experimental/representation.py @@ -9,7 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from html import escape import re diff --git a/lib/iris/experimental/stratify.py b/lib/iris/experimental/stratify.py index 54d2beb118..0684892d93 100644 --- a/lib/iris/experimental/stratify.py +++ b/lib/iris/experimental/stratify.py @@ -8,7 +8,6 @@ Z direction. """ -from six.moves import (filter, input, map, range, zip) # noqa from functools import partial diff --git a/lib/iris/fileformats/_ff.py b/lib/iris/fileformats/_ff.py index 59fa80c607..9c4e3e4f1f 100644 --- a/lib/iris/fileformats/_ff.py +++ b/lib/iris/fileformats/_ff.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import os import warnings diff --git a/lib/iris/fileformats/_ff_cross_references.py b/lib/iris/fileformats/_ff_cross_references.py index 3967ea6070..b7bb122a95 100644 --- a/lib/iris/fileformats/_ff_cross_references.py +++ b/lib/iris/fileformats/_ff_cross_references.py @@ -11,7 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import namedtuple diff --git a/lib/iris/fileformats/_structured_array_identification.py b/lib/iris/fileformats/_structured_array_identification.py index b3c43d5219..46567d918c 100644 --- a/lib/iris/fileformats/_structured_array_identification.py +++ b/lib/iris/fileformats/_structured_array_identification.py @@ -43,7 +43,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import namedtuple diff --git a/lib/iris/fileformats/name_loaders.py b/lib/iris/fileformats/name_loaders.py index cb59713bb0..d334b46764 100644 --- a/lib/iris/fileformats/name_loaders.py +++ b/lib/iris/fileformats/name_loaders.py @@ -5,7 +5,6 @@ # licensing details. """NAME file format loading functions.""" -from six.moves import (filter, input, map, range, zip) # noqa import six import collections diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index 9b02ba70db..1444d5500c 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -13,8 +13,12 @@ """ +<<<<<<< HEAD from six.moves import (filter, input, map, range, zip) # noqa from six.moves import zip_longest # Previous line may not be tampered with! +======= +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed uses of six.moves. import six import collections diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index c2a9e28b88..5303c4fb91 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six import abc diff --git a/lib/iris/fileformats/pp_load_rules.py b/lib/iris/fileformats/pp_load_rules.py index 389a153eb0..606cad5e92 100644 --- a/lib/iris/fileformats/pp_load_rules.py +++ b/lib/iris/fileformats/pp_load_rules.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa # Historically this was auto-generated from # SciTools/iris-code-generators:tools/gen_rules.py diff --git a/lib/iris/fileformats/rules.py b/lib/iris/fileformats/rules.py index f581591cba..8e45085e7c 100644 --- a/lib/iris/fileformats/rules.py +++ b/lib/iris/fileformats/rules.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import collections import warnings diff --git a/lib/iris/fileformats/um/_fast_load.py b/lib/iris/fileformats/um/_fast_load.py index 0f3873ccfb..ed9f530184 100644 --- a/lib/iris/fileformats/um/_fast_load.py +++ b/lib/iris/fileformats/um/_fast_load.py @@ -21,7 +21,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from contextlib import contextmanager import threading diff --git a/lib/iris/fileformats/um/_fast_load_structured_fields.py b/lib/iris/fileformats/um/_fast_load_structured_fields.py index 7f060b4a23..cfe3f7030f 100644 --- a/lib/iris/fileformats/um/_fast_load_structured_fields.py +++ b/lib/iris/fileformats/um/_fast_load_structured_fields.py @@ -12,7 +12,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import itertools diff --git a/lib/iris/fileformats/um_cf_map.py b/lib/iris/fileformats/um_cf_map.py index 006fdd6c17..e4cb6ff2ca 100644 --- a/lib/iris/fileformats/um_cf_map.py +++ b/lib/iris/fileformats/um_cf_map.py @@ -16,7 +16,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import namedtuple diff --git a/lib/iris/io/__init__.py b/lib/iris/io/__init__.py index ca160457dc..104b506c54 100644 --- a/lib/iris/io/__init__.py +++ b/lib/iris/io/__init__.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from collections import OrderedDict import glob diff --git a/lib/iris/iterate.py b/lib/iris/iterate.py index 0c14b127ce..4db86d9d6a 100644 --- a/lib/iris/iterate.py +++ b/lib/iris/iterate.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa try: # Python 3 from collections.abc import Iterator diff --git a/lib/iris/palette.py b/lib/iris/palette.py index e9484b43a6..a5a1a02363 100644 --- a/lib/iris/palette.py +++ b/lib/iris/palette.py @@ -9,7 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from functools import wraps import os diff --git a/lib/iris/plot.py b/lib/iris/plot.py index 23ed224c95..5ee2701cb2 100644 --- a/lib/iris/plot.py +++ b/lib/iris/plot.py @@ -11,7 +11,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import collections import datetime diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 553fb39676..9b7366eebf 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -19,7 +19,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import codecs import collections diff --git a/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py b/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py index c4a957e7c8..32158bbc50 100644 --- a/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py +++ b/lib/iris/tests/experimental/regrid/test_regrid_area_weighted_rectilinear_src_and_grid.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/experimental/test_animate.py b/lib/iris/tests/experimental/test_animate.py index ed36bc3f9e..ffc151a74f 100644 --- a/lib/iris/tests/experimental/test_animate.py +++ b/lib/iris/tests/experimental/test_animate.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py b/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py index 7e6edc690c..892ee43000 100644 --- a/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py +++ b/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py @@ -9,9 +9,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/concatenate/test_concatenate.py b/lib/iris/tests/integration/concatenate/test_concatenate.py index 9db9aed628..6bcf54af0e 100644 --- a/lib/iris/tests/integration/concatenate/test_concatenate.py +++ b/lib/iris/tests/integration/concatenate/test_concatenate.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/fast_load/test_fast_load.py b/lib/iris/tests/integration/fast_load/test_fast_load.py index db8001634b..a04f503dfe 100644 --- a/lib/iris/tests/integration/fast_load/test_fast_load.py +++ b/lib/iris/tests/integration/fast_load/test_fast_load.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for fast-loading FF and PP files.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_netcdf.py b/lib/iris/tests/integration/test_netcdf.py index 2c007be911..16ecd6f65a 100644 --- a/lib/iris/tests/integration/test_netcdf.py +++ b/lib/iris/tests/integration/test_netcdf.py @@ -5,7 +5,6 @@ # licensing details. """Integration tests for loading and saving netcdf files.""" -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/integration/test_regridding.py b/lib/iris/tests/integration/test_regridding.py index 0ada16c41a..76202387a3 100644 --- a/lib/iris/tests/integration/test_regridding.py +++ b/lib/iris/tests/integration/test_regridding.py @@ -5,9 +5,7 @@ # licensing details. """Integration tests for regridding.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_trajectory.py b/lib/iris/tests/integration/test_trajectory.py index acbdc44794..6ff68d8d97 100644 --- a/lib/iris/tests/integration/test_trajectory.py +++ b/lib/iris/tests/integration/test_trajectory.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for :mod:`iris.analysis.trajectory`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/stock/__init__.py b/lib/iris/tests/stock/__init__.py index a83a10c14c..26807729e5 100644 --- a/lib/iris/tests/stock/__init__.py +++ b/lib/iris/tests/stock/__init__.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa from datetime import datetime import os.path diff --git a/lib/iris/tests/stock/_stock_2d_latlons.py b/lib/iris/tests/stock/_stock_2d_latlons.py index a2d676fbc9..aadd9c4a86 100644 --- a/lib/iris/tests/stock/_stock_2d_latlons.py +++ b/lib/iris/tests/stock/_stock_2d_latlons.py @@ -8,7 +8,6 @@ to mimic ocean grid data. """ -from six.moves import (filter, input, map, range, zip) # noqa import numpy as np import numpy.ma as ma diff --git a/lib/iris/tests/test_analysis.py b/lib/iris/tests/test_analysis.py index c32ac82dc4..51c92953fd 100644 --- a/lib/iris/tests/test_analysis.py +++ b/lib/iris/tests/test_analysis.py @@ -5,7 +5,6 @@ # licensing details. - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_cell.py b/lib/iris/tests/test_cell.py index bc9f1fdc36..e9bafeff11 100644 --- a/lib/iris/tests/test_cell.py +++ b/lib/iris/tests/test_cell.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_constraints.py b/lib/iris/tests/test_constraints.py index b39642a25c..1714691b7b 100644 --- a/lib/iris/tests/test_constraints.py +++ b/lib/iris/tests/test_constraints.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before importing anything else diff --git a/lib/iris/tests/test_coord_api.py b/lib/iris/tests/test_coord_api.py index fb2bebe2d6..e0ea341b10 100644 --- a/lib/iris/tests/test_coord_api.py +++ b/lib/iris/tests/test_coord_api.py @@ -5,8 +5,6 @@ # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_coordsystem.py b/lib/iris/tests/test_coordsystem.py index fc114871d6..a032f65c2c 100644 --- a/lib/iris/tests/test_coordsystem.py +++ b/lib/iris/tests/test_coordsystem.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_cube_to_pp.py b/lib/iris/tests/test_cube_to_pp.py index 55d2355880..a9e87e46bc 100644 --- a/lib/iris/tests/test_cube_to_pp.py +++ b/lib/iris/tests/test_cube_to_pp.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before importing anything else diff --git a/lib/iris/tests/test_ff.py b/lib/iris/tests/test_ff.py index 258e4d1cda..19765720d7 100644 --- a/lib/iris/tests/test_ff.py +++ b/lib/iris/tests/test_ff.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_iterate.py b/lib/iris/tests/test_iterate.py index 8850c115f4..1730b6f275 100644 --- a/lib/iris/tests/test_iterate.py +++ b/lib/iris/tests/test_iterate.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_mapping.py b/lib/iris/tests/test_mapping.py index 9411e6e3cb..30dc09503f 100644 --- a/lib/iris/tests/test_mapping.py +++ b/lib/iris/tests/test_mapping.py @@ -7,7 +7,6 @@ Tests map creation. """ -from six.moves import (filter, input, map, range, zip) # noqa # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/test_merge.py b/lib/iris/tests/test_merge.py index f3c6a7b6c3..d734e2bce9 100644 --- a/lib/iris/tests/test_merge.py +++ b/lib/iris/tests/test_merge.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_pandas.py b/lib/iris/tests/test_pandas.py index 5988059eb3..f2b462e908 100644 --- a/lib/iris/tests/test_pandas.py +++ b/lib/iris/tests/test_pandas.py @@ -18,8 +18,7 @@ import netCDF4 import numpy as np - -# Importing pandas has the side-effect of messing with the formatters +# importing pandas has the side-effect of messing with the formatters # used by matplotlib for handling dates. default_units_registry = copy.copy(matplotlib.units.registry) try: diff --git a/lib/iris/tests/test_pickling.py b/lib/iris/tests/test_pickling.py index dab1be25e7..7a7891e2e4 100644 --- a/lib/iris/tests/test_pickling.py +++ b/lib/iris/tests/test_pickling.py @@ -8,9 +8,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris tests first so that some things can be initialised +# import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/test_plot.py b/lib/iris/tests/test_plot.py index c14b8d7b60..09382ddde2 100644 --- a/lib/iris/tests/test_plot.py +++ b/lib/iris/tests/test_plot.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/test_pp_module.py b/lib/iris/tests/test_pp_module.py index da7a801226..cdcb5ebdec 100644 --- a/lib/iris/tests/test_pp_module.py +++ b/lib/iris/tests/test_pp_module.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_pp_to_cube.py b/lib/iris/tests/test_pp_to_cube.py index 558301bdc4..a5a9f4b1f6 100644 --- a/lib/iris/tests/test_pp_to_cube.py +++ b/lib/iris/tests/test_pp_to_cube.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_util.py b/lib/iris/tests/test_util.py index e8ce7e9c96..0ddad4387d 100644 --- a/lib/iris/tests/test_util.py +++ b/lib/iris/tests/test_util.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/analysis/maths/__init__.py b/lib/iris/tests/unit/analysis/maths/__init__.py index b3b92be350..d430b0b253 100644 --- a/lib/iris/tests/unit/analysis/maths/__init__.py +++ b/lib/iris/tests/unit/analysis/maths/__init__.py @@ -5,7 +5,6 @@ # licensing details. """Unit tests for the :mod:`iris.analysis.maths` module.""" -from six.moves import (filter, input, map, range, zip) # noqa import six from abc import ABCMeta, abstractproperty diff --git a/lib/iris/tests/unit/analysis/maths/test__output_dtype.py b/lib/iris/tests/unit/analysis/maths/test__output_dtype.py index 2f56a8d203..cd9a459c11 100644 --- a/lib/iris/tests/unit/analysis/maths/test__output_dtype.py +++ b/lib/iris/tests/unit/analysis/maths/test__output_dtype.py @@ -8,9 +8,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py index 1a013a8643..570fb48b45 100644 --- a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for :class:`iris.analysis._regrid.RectilinearRegridder`.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py index 4374b53c18..646f946d6a 100644 --- a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for :class:`iris.analysis._regrid.CurvilinearRegridder`.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/stats/test_pearsonr.py b/lib/iris/tests/unit/analysis/stats/test_pearsonr.py index a0e9f39585..e9e06eaa10 100644 --- a/lib/iris/tests/unit/analysis/stats/test_pearsonr.py +++ b/lib/iris/tests/unit/analysis/stats/test_pearsonr.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the `iris.analysis.stats.pearsonr` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris tests first so that some things can be initialised before +# import iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_PERCENTILE.py b/lib/iris/tests/unit/analysis/test_PERCENTILE.py index 1e4f2ac52d..32eba6c892 100644 --- a/lib/iris/tests/unit/analysis/test_PERCENTILE.py +++ b/lib/iris/tests/unit/analysis/test_PERCENTILE.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the :data:`iris.analysis.PERCENTILE` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_WPERCENTILE.py b/lib/iris/tests/unit/analysis/test_WPERCENTILE.py index f96e4a3e02..53e9b5efaa 100644 --- a/lib/iris/tests/unit/analysis/test_WPERCENTILE.py +++ b/lib/iris/tests/unit/analysis/test_WPERCENTILE.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the :data:`iris.analysis.PERCENTILE` aggregator.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py b/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py index 6722c6f57c..ab27a863c2 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py @@ -8,9 +8,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py b/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py index 2a447b9971..34c9ed8015 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_UnstructuredNearestNeighbourRegridder.py @@ -8,7 +8,6 @@ :class:`iris.analysis.trajectory.UnstructuredNearestNeigbourRegridder`. """ -from six.moves import (filter, input, map, range, zip) # noqa # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/concatenate/test_concatenate.py b/lib/iris/tests/unit/concatenate/test_concatenate.py index b5f7453e8e..f74ceba3bf 100644 --- a/lib/iris/tests/unit/concatenate/test_concatenate.py +++ b/lib/iris/tests/unit/concatenate/test_concatenate.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris._concatenate.concatenate.py`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coord_categorisation/test_add_categorised_coord.py b/lib/iris/tests/unit/coord_categorisation/test_add_categorised_coord.py index a49fee0259..b435ecf523 100644 --- a/lib/iris/tests/unit/coord_categorisation/test_add_categorised_coord.py +++ b/lib/iris/tests/unit/coord_categorisation/test_add_categorised_coord.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.coord_categorisation.add_categorised_coord`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index c0d18173b1..e8baf3d835 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the `iris.cube.Cube` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/cube/test_CubeList.py b/lib/iris/tests/unit/cube/test_CubeList.py index dc39a339fb..29901cf541 100644 --- a/lib/iris/tests/unit/cube/test_CubeList.py +++ b/lib/iris/tests/unit/cube/test_CubeList.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the `iris.cube.CubeList` class.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests import iris.tests.stock diff --git a/lib/iris/tests/unit/experimental/equalise_cubes/test_equalise_attributes.py b/lib/iris/tests/unit/experimental/equalise_cubes/test_equalise_attributes.py index 8b714f8d05..82aff39cfe 100644 --- a/lib/iris/tests/unit/experimental/equalise_cubes/test_equalise_attributes.py +++ b/lib/iris/tests/unit/experimental/equalise_cubes/test_equalise_attributes.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/experimental/regrid/test_regrid_weighted_curvilinear_to_rectilinear.py b/lib/iris/tests/unit/experimental/regrid/test_regrid_weighted_curvilinear_to_rectilinear.py index 393cbd7d28..f3e3698c58 100644 --- a/lib/iris/tests/unit/experimental/regrid/test_regrid_weighted_curvilinear_to_rectilinear.py +++ b/lib/iris/tests/unit/experimental/regrid/test_regrid_weighted_curvilinear_to_rectilinear.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/experimental/representation/test_CubeListRepresentation.py b/lib/iris/tests/unit/experimental/representation/test_CubeListRepresentation.py index e2c66efead..81a1928494 100644 --- a/lib/iris/tests/unit/experimental/representation/test_CubeListRepresentation.py +++ b/lib/iris/tests/unit/experimental/representation/test_CubeListRepresentation.py @@ -5,7 +5,6 @@ # licensing details. """Unit tests for the `iris.cube.CubeRepresentation` class.""" -from six.moves import (filter, input, map, range, zip) # noqa from html import escape # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/experimental/representation/test_CubeRepresentation.py b/lib/iris/tests/unit/experimental/representation/test_CubeRepresentation.py index e1a3ab3073..fb420dfd60 100644 --- a/lib/iris/tests/unit/experimental/representation/test_CubeRepresentation.py +++ b/lib/iris/tests/unit/experimental/representation/test_CubeRepresentation.py @@ -5,7 +5,6 @@ # licensing details. """Unit tests for the `iris.cube.CubeRepresentation` class.""" -from six.moves import (filter, input, map, range, zip) # noqa from html import escape # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py index 8291ebc3bf..40a1865151 100644 --- a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py +++ b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py @@ -8,9 +8,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py index 0a278c3898..0007a5704e 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py +++ b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py @@ -5,7 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.fileformat.ff.FF2PP` class.""" -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py b/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py index 5ac94a2300..b2371b75cf 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py @@ -8,9 +8,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py b/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py index a9383e793f..6f13d5de11 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py @@ -9,9 +9,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py b/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py index d081ea52eb..f7a2dad4e2 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the `iris.fileformats.netcdf._load_cube` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_save.py b/lib/iris/tests/unit/fileformats/netcdf/test_save.py index a14057e992..46cf6de80c 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_save.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_save.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the `iris.fileformats.netcdf.save` function.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py index 7c59d509c6..c82204db31 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py @@ -9,9 +9,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py index d637ee1a57..011f453649 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for :func:`iris.fileformats.pp_load_rules._dim_or_aux`.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py index c7b984a9aa..532e412854 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py @@ -8,9 +8,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py index 06a62d3720..23e0041856 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py @@ -9,9 +9,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py index 893d914eca..707e8c3b8b 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py @@ -5,7 +5,6 @@ # licensing details. """Unit tests for :func:`iris.fileformats.pp_load_rules.convert`.""" -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py b/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py index 0156401af3..095a5d8966 100644 --- a/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py +++ b/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py @@ -9,9 +9,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py b/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py index f425249cb0..0a1d847ad5 100644 --- a/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py +++ b/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py @@ -9,9 +9,7 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/test_rules.py b/lib/iris/tests/unit/fileformats/test_rules.py index 13656038b0..6310ce59fc 100644 --- a/lib/iris/tests/unit/fileformats/test_rules.py +++ b/lib/iris/tests/unit/fileformats/test_rules.py @@ -8,8 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_group_structured_fields.py b/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_group_structured_fields.py index b24ef32a8c..83c3a859a4 100644 --- a/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_group_structured_fields.py +++ b/lib/iris/tests/unit/fileformats/um/fast_load_structured_fields/test_group_structured_fields.py @@ -9,8 +9,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/__init__.py b/lib/iris/tests/unit/plot/__init__.py index b1062395fe..595fe809f0 100644 --- a/lib/iris/tests/unit/plot/__init__.py +++ b/lib/iris/tests/unit/plot/__init__.py @@ -5,9 +5,7 @@ # licensing details. """Unit tests for the :mod:`iris.plot` module.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py index d81bd8f548..b1798fa063 100644 --- a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py +++ b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py @@ -6,8 +6,7 @@ """Unit tests for the `iris.plot._get_plot_defn_custom_coords_picked` function.""" - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/time/test_PartialDateTime.py b/lib/iris/tests/unit/time/test_PartialDateTime.py index bc18bbe3fa..53bd56777c 100644 --- a/lib/iris/tests/unit/time/test_PartialDateTime.py +++ b/lib/iris/tests/unit/time/test_PartialDateTime.py @@ -5,7 +5,6 @@ # licensing details. """Unit tests for the `iris.time.PartialDateTime` class.""" -from six.moves import (filter, input, map, range, zip) # noqa import six # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/util/test__coord_regular.py b/lib/iris/tests/unit/util/test__coord_regular.py index ae33df53d8..dedc8fb37b 100644 --- a/lib/iris/tests/unit/util/test__coord_regular.py +++ b/lib/iris/tests/unit/util/test__coord_regular.py @@ -13,7 +13,6 @@ """ - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test__slice_data_with_keys.py b/lib/iris/tests/unit/util/test__slice_data_with_keys.py index d4fffe23e9..dcbdec6d89 100644 --- a/lib/iris/tests/unit/util/test__slice_data_with_keys.py +++ b/lib/iris/tests/unit/util/test__slice_data_with_keys.py @@ -13,7 +13,6 @@ in combination. """ -from six.moves import (filter, input, map, range, zip) # noqa # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/util/test_broadcast_to_shape.py b/lib/iris/tests/unit/util/test_broadcast_to_shape.py index c96f204ce4..510fc4ce94 100644 --- a/lib/iris/tests/unit/util/test_broadcast_to_shape.py +++ b/lib/iris/tests/unit/util/test_broadcast_to_shape.py @@ -5,8 +5,6 @@ # licensing details. """Test function :func:`iris.util.broadcast_to_shape`.""" -from six.moves import (filter, input, map, range, zip) # noqa - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_new_axis.py b/lib/iris/tests/unit/util/test_new_axis.py index b3a82596fb..7f8d91271e 100644 --- a/lib/iris/tests/unit/util/test_new_axis.py +++ b/lib/iris/tests/unit/util/test_new_axis.py @@ -5,9 +5,7 @@ # licensing details. """Test function :func:`iris.util.new_axis`.""" -from six.moves import (filter, input, map, range, zip) # noqa - -# Import iris.tests first so that some things can be initialised before +# import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests import iris.tests.stock as stock diff --git a/lib/iris/util.py b/lib/iris/util.py index 78da4dce53..dde4ba954e 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -8,7 +8,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six try: # Python 3 diff --git a/tools/gen_stash_refs.py b/tools/gen_stash_refs.py index 5e52a66365..e1a6d0c9ca 100644 --- a/tools/gen_stash_refs.py +++ b/tools/gen_stash_refs.py @@ -22,8 +22,13 @@ ''' +<<<<<<< HEAD CODE_PREAMBLE = ("from six.moves import " "(filter, input, map, range, zip) # noqa\n\n" +======= +CODE_PREAMBLE = ("\nfrom __future__ import " + "(absolute_import, division, print_function)\n" +>>>>>>> Removed uses of six.moves. "from collections import namedtuple\n\n\n" "Stash = namedtuple('Stash', " "'grid_code field_code pseudo_level_type')\n\n\n") diff --git a/tools/gen_translations.py b/tools/gen_translations.py index 5c0c2c8332..b7ca0f3141 100644 --- a/tools/gen_translations.py +++ b/tools/gen_translations.py @@ -49,7 +49,6 @@ # https://github.com/metarelate/metOcean/commit/{git_sha} {doc_string} -from six.moves import (filter, input, map, range, zip) # noqa from collections import namedtuple diff --git a/tools/generate_std_names.py b/tools/generate_std_names.py index a36c7af27d..540e97e14a 100644 --- a/tools/generate_std_names.py +++ b/tools/generate_std_names.py @@ -48,7 +48,6 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa STD_NAMES = '''.lstrip() diff --git a/tools/translator/__init__.py b/tools/translator/__init__.py index 50ca9cc87b..7f464832d4 100644 --- a/tools/translator/__init__.py +++ b/tools/translator/__init__.py @@ -9,13 +9,12 @@ """ -from six.moves import (filter, input, map, range, zip) # noqa import six from abc import ABCMeta, abstractmethod, abstractproperty from collections import deque, namedtuple import copy -from six.moves.queue import Queue +from queue import Queue import re from threading import Thread import warnings From 4ffd8bc8e538e10474973ea6b70bcc324a511233 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 17:22:22 +0000 Subject: [PATCH 26/35] Removed remaining six imports. --- lib/iris/_cube_coord_common.py | 5 +++++ lib/iris/_merge.py | 2 -- lib/iris/analysis/maths.py | 1 - lib/iris/aux_factory.py | 2 -- lib/iris/coord_systems.py | 5 +++++ lib/iris/coords.py | 2 -- lib/iris/cube.py | 2 -- lib/iris/fileformats/cf.py | 5 +++++ lib/iris/fileformats/name_loaders.py | 2 -- lib/iris/fileformats/netcdf.py | 3 +++ lib/iris/fileformats/nimrod.py | 5 +++++ lib/iris/fileformats/pp.py | 2 -- lib/iris/fileformats/um/_optimal_array_structuring.py | 5 +++++ lib/iris/io/format_picker.py | 5 +++++ lib/iris/tests/integration/test_netcdf.py | 2 -- lib/iris/tests/test_cdm.py | 5 +++++ lib/iris/tests/test_constraints.py | 2 -- lib/iris/tests/test_cube_to_pp.py | 2 -- lib/iris/tests/test_file_save.py | 5 +++++ lib/iris/tests/test_plot.py | 2 -- lib/iris/tests/test_util.py | 2 -- lib/iris/tests/unit/analysis/maths/__init__.py | 2 -- lib/iris/tests/unit/fileformats/ff/test_FF2PP.py | 2 -- lib/iris/tests/unit/fileformats/netcdf/test_Saver.py | 5 +++++ lib/iris/tests/unit/fileformats/pp/test__field_gen.py | 5 +++++ lib/iris/tests/unit/fileformats/pp/test_save_fields.py | 5 +++++ .../tests/unit/fileformats/pp_load_rules/test_convert.py | 2 -- lib/iris/tests/unit/merge/test_ProtoCube.py | 5 +++++ lib/iris/tests/unit/tests/test_IrisTest.py | 5 +++++ lib/iris/tests/unit/time/test_PartialDateTime.py | 2 -- lib/iris/tests/unit/util/test_describe_diff.py | 5 +++++ lib/iris/util.py | 2 -- tools/generate_std_names.py | 5 +++++ tools/translator/__init__.py | 2 -- 34 files changed, 78 insertions(+), 35 deletions(-) diff --git a/lib/iris/_cube_coord_common.py b/lib/iris/_cube_coord_common.py index 248a4fff71..24abde2648 100644 --- a/lib/iris/_cube_coord_common.py +++ b/lib/iris/_cube_coord_common.py @@ -3,7 +3,12 @@ # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. import re import string diff --git a/lib/iris/_merge.py b/lib/iris/_merge.py index 80f90cbf07..6460cdbb10 100644 --- a/lib/iris/_merge.py +++ b/lib/iris/_merge.py @@ -11,8 +11,6 @@ """ -import six - from collections import namedtuple, OrderedDict from copy import deepcopy diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index 0523dcfe9d..8bfe756ab4 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -12,7 +12,6 @@ import inspect import math import operator -import six import warnings import cf_units diff --git a/lib/iris/aux_factory.py b/lib/iris/aux_factory.py index 3b9db8ffd3..a5bdabb6dc 100644 --- a/lib/iris/aux_factory.py +++ b/lib/iris/aux_factory.py @@ -8,8 +8,6 @@ """ -import six - from abc import ABCMeta, abstractmethod, abstractproperty import warnings diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index 4c2c2b86af..5e1eabd923 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -7,7 +7,12 @@ Definitions of coordinate systems. """ +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. from abc import ABCMeta, abstractmethod import warnings diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 3575bcb5f4..6167a424ad 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -8,8 +8,6 @@ """ -import six - from abc import ABCMeta from collections import namedtuple try: # Python 3 diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 053d7a76a7..66f14043d9 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -9,8 +9,6 @@ """ -import six - from collections import namedtuple, OrderedDict try: # Python 3 from collections.abc import (Iterable, diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index f4cb0fe9b4..15150bcc17 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -13,7 +13,12 @@ [NUG] NetCDF User's Guide, http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html """ +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. from abc import ABCMeta, abstractmethod diff --git a/lib/iris/fileformats/name_loaders.py b/lib/iris/fileformats/name_loaders.py index d334b46764..a5cf0a72ba 100644 --- a/lib/iris/fileformats/name_loaders.py +++ b/lib/iris/fileformats/name_loaders.py @@ -5,8 +5,6 @@ # licensing details. """NAME file format loading functions.""" -import six - import collections import datetime import re diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index 1444d5500c..8c4b112666 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -18,8 +18,11 @@ from six.moves import zip_longest # Previous line may not be tampered with! ======= from __future__ import (absolute_import, division, print_function) +<<<<<<< HEAD >>>>>>> Removed uses of six.moves. import six +======= +>>>>>>> Removed remaining six imports. import collections from itertools import repeat diff --git a/lib/iris/fileformats/nimrod.py b/lib/iris/fileformats/nimrod.py index e4b6b915d3..d417b72860 100644 --- a/lib/iris/fileformats/nimrod.py +++ b/lib/iris/fileformats/nimrod.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Provides NIMROD file format capabilities.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. import glob import numpy as np diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 5303c4fb91..34b43daaa6 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -8,8 +8,6 @@ """ -import six - import abc import collections from copy import deepcopy diff --git a/lib/iris/fileformats/um/_optimal_array_structuring.py b/lib/iris/fileformats/um/_optimal_array_structuring.py index fe7f3c984c..e80a0ca691 100644 --- a/lib/iris/fileformats/um/_optimal_array_structuring.py +++ b/lib/iris/fileformats/um/_optimal_array_structuring.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """A module to provide an optimal array structure calculation.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. import itertools diff --git a/lib/iris/io/format_picker.py b/lib/iris/io/format_picker.py index 51ce58b29e..5173ec5915 100644 --- a/lib/iris/io/format_picker.py +++ b/lib/iris/io/format_picker.py @@ -39,7 +39,12 @@ """ +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. try: # Python 3 from collections.abc import Callable diff --git a/lib/iris/tests/integration/test_netcdf.py b/lib/iris/tests/integration/test_netcdf.py index 16ecd6f65a..430557f10f 100644 --- a/lib/iris/tests/integration/test_netcdf.py +++ b/lib/iris/tests/integration/test_netcdf.py @@ -5,8 +5,6 @@ # licensing details. """Integration tests for loading and saving netcdf files.""" -import six - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 1b1142b16d..8156a3635e 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -7,7 +7,12 @@ Test cube indexing, slicing, and extracting, and also the dot graphs. """ +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_constraints.py b/lib/iris/tests/test_constraints.py index 1714691b7b..79ee51c9c4 100644 --- a/lib/iris/tests/test_constraints.py +++ b/lib/iris/tests/test_constraints.py @@ -8,8 +8,6 @@ """ -import six - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_cube_to_pp.py b/lib/iris/tests/test_cube_to_pp.py index a9e87e46bc..aa7b21ae26 100644 --- a/lib/iris/tests/test_cube_to_pp.py +++ b/lib/iris/tests/test_cube_to_pp.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -import six - # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_file_save.py b/lib/iris/tests/test_file_save.py index c4b644dbc0..5b3923218a 100644 --- a/lib/iris/tests/test_file_save.py +++ b/lib/iris/tests/test_file_save.py @@ -7,7 +7,12 @@ Test the file saving mechanism. """ +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_plot.py b/lib/iris/tests/test_plot.py index 09382ddde2..16acdcbc00 100644 --- a/lib/iris/tests/test_plot.py +++ b/lib/iris/tests/test_plot.py @@ -4,8 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -import six - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_util.py b/lib/iris/tests/test_util.py index 0ddad4387d..f9ac236f7a 100644 --- a/lib/iris/tests/test_util.py +++ b/lib/iris/tests/test_util.py @@ -8,8 +8,6 @@ """ -import six - # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/__init__.py b/lib/iris/tests/unit/analysis/maths/__init__.py index d430b0b253..00f9b7058e 100644 --- a/lib/iris/tests/unit/analysis/maths/__init__.py +++ b/lib/iris/tests/unit/analysis/maths/__init__.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :mod:`iris.analysis.maths` module.""" -import six - from abc import ABCMeta, abstractproperty import numpy as np diff --git a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py index 0007a5704e..dc9e73882e 100644 --- a/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py +++ b/lib/iris/tests/unit/fileformats/ff/test_FF2PP.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the :class:`iris.fileformat.ff.FF2PP` class.""" -import six - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py index 0be26e5400..cfb1c45813 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.netcdf.Saver` class.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py index 8860779f3f..61ec6b3e38 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py +++ b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.pp._field_gen` function.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py index 5e0661f356..2a9e3a4487 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py +++ b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.pp.save_fields` function.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py index 707e8c3b8b..79f0e48bc7 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test_convert.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for :func:`iris.fileformats.pp_load_rules.convert`.""" -import six - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/merge/test_ProtoCube.py b/lib/iris/tests/unit/merge/test_ProtoCube.py index c8e620224a..31ffda8628 100644 --- a/lib/iris/tests/unit/merge/test_ProtoCube.py +++ b/lib/iris/tests/unit/merge/test_ProtoCube.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris._merge.ProtoCube` class.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/tests/test_IrisTest.py b/lib/iris/tests/unit/tests/test_IrisTest.py index aeb1510f12..3b82c2b912 100644 --- a/lib/iris/tests/unit/tests/test_IrisTest.py +++ b/lib/iris/tests/unit/tests/test_IrisTest.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.tests.IrisTest` class.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/time/test_PartialDateTime.py b/lib/iris/tests/unit/time/test_PartialDateTime.py index 53bd56777c..52aa85d986 100644 --- a/lib/iris/tests/unit/time/test_PartialDateTime.py +++ b/lib/iris/tests/unit/time/test_PartialDateTime.py @@ -5,8 +5,6 @@ # licensing details. """Unit tests for the `iris.time.PartialDateTime` class.""" -import six - # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_describe_diff.py b/lib/iris/tests/unit/util/test_describe_diff.py index 989b144f53..56a7cf9716 100644 --- a/lib/iris/tests/unit/util/test_describe_diff.py +++ b/lib/iris/tests/unit/util/test_describe_diff.py @@ -4,7 +4,12 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Test function :func:`iris.util.describe_diff`.""" +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/util.py b/lib/iris/util.py index dde4ba954e..f06a8a4f67 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -8,8 +8,6 @@ """ -import six - try: # Python 3 from collections.abc import Hashable except ImportError: # Python 2.7 diff --git a/tools/generate_std_names.py b/tools/generate_std_names.py index 540e97e14a..d6699a2397 100644 --- a/tools/generate_std_names.py +++ b/tools/generate_std_names.py @@ -16,7 +16,12 @@ http://cf-pcmdi.llnl.gov/documents/cf-standard-names """ +<<<<<<< HEAD import six +======= + +from __future__ import (absolute_import, division, print_function) +>>>>>>> Removed remaining six imports. import argparse import pprint diff --git a/tools/translator/__init__.py b/tools/translator/__init__.py index 7f464832d4..689b184785 100644 --- a/tools/translator/__init__.py +++ b/tools/translator/__init__.py @@ -9,8 +9,6 @@ """ -import six - from abc import ABCMeta, abstractmethod, abstractproperty from collections import deque, namedtuple import copy From 0c9aa05b0151de7305e15133a8890e62fd44704d Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 17:23:52 +0000 Subject: [PATCH 27/35] Removed requirement references to six. --- requirements/setup.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements/setup.txt b/requirements/setup.txt index 552f54318c..abdf7b72f4 100644 --- a/requirements/setup.txt +++ b/requirements/setup.txt @@ -3,4 +3,3 @@ setuptools # pyke (not pip installable) #conda: pyke -six From 0bb116cb0464560758442db23c067ba27f368d36 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Fri, 1 Nov 2019 17:25:28 +0000 Subject: [PATCH 28/35] Removed six from fc_rules_cf. --- .../fileformats/_pyke_rules/fc_rules_cf.krb | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/iris/fileformats/_pyke_rules/fc_rules_cf.krb b/lib/iris/fileformats/_pyke_rules/fc_rules_cf.krb index 3d5609d733..5ecfeb77b1 100644 --- a/lib/iris/fileformats/_pyke_rules/fc_rules_cf.krb +++ b/lib/iris/fileformats/_pyke_rules/fc_rules_cf.krb @@ -1165,8 +1165,6 @@ fc_formula_terms fc_extras - import six - import warnings import cf_units @@ -1327,15 +1325,9 @@ fc_extras warnings.warn(message=msg, category=UnknownCellMethodWarning) # Set the cube global attributes. - for attr_name, attr_value in six.iteritems(cf_var.cf_group.global_attributes): + for attr_name, attr_value in cf_var.cf_group.global_attributes.items(): try: - if six.PY2 and isinstance(attr_value, six.text_type): - try: - cube.attributes[str(attr_name)] = str(attr_value) - except UnicodeEncodeError: - cube.attributes[str(attr_name)] = attr_value - else: - cube.attributes[str(attr_name)] = attr_value + cube.attributes[str(attr_name)] = attr_value except ValueError as e: msg = 'Skipping global attribute {!r}: {}' warnings.warn(msg.format(attr_name, str(e))) @@ -1674,10 +1666,7 @@ fc_extras # Using converted unicode message. Can be reverted with Python 3. msg = u'Ignoring netCDF variable {!r} invalid units {!r}'.format( cf_var.cf_name, attr_units) - if six.PY3: - warnings.warn(msg) - else: - warnings.warn(msg.encode('ascii', errors='backslashreplace')) + warnings.warn(msg) attributes['invalid_units'] = attr_units attr_units = cf_units._UNKNOWN_UNIT_STRING From 8143b544b583b38cdf2e1984aea16aa4f33dde6d Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Mon, 4 Nov 2019 09:33:38 +0000 Subject: [PATCH 29/35] Removed uses of six.moves. --- lib/iris/_cube_coord_common.py | 6 ------ lib/iris/config.py | 1 + lib/iris/coord_systems.py | 6 ------ lib/iris/coords.py | 2 +- lib/iris/fileformats/cf.py | 6 ------ lib/iris/fileformats/netcdf.py | 4 ++++ lib/iris/fileformats/nimrod.py | 6 ------ lib/iris/fileformats/um/_optimal_array_structuring.py | 6 ------ lib/iris/io/format_picker.py | 6 ------ lib/iris/tests/test_cdm.py | 6 ------ lib/iris/tests/test_file_save.py | 6 ------ lib/iris/tests/unit/fileformats/netcdf/test_Saver.py | 6 ------ lib/iris/tests/unit/fileformats/pp/test__field_gen.py | 6 ------ lib/iris/tests/unit/fileformats/pp/test_save_fields.py | 6 ------ lib/iris/tests/unit/merge/test_ProtoCube.py | 6 ------ lib/iris/tests/unit/tests/test_IrisTest.py | 6 ------ lib/iris/tests/unit/util/test_describe_diff.py | 6 ------ tools/generate_std_names.py | 6 ------ 18 files changed, 6 insertions(+), 91 deletions(-) diff --git a/lib/iris/_cube_coord_common.py b/lib/iris/_cube_coord_common.py index 24abde2648..e7a5c9721d 100644 --- a/lib/iris/_cube_coord_common.py +++ b/lib/iris/_cube_coord_common.py @@ -3,12 +3,6 @@ # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. import re import string diff --git a/lib/iris/config.py b/lib/iris/config.py index 7bdb92ff5a..7a94e98e6f 100644 --- a/lib/iris/config.py +++ b/lib/iris/config.py @@ -36,6 +36,7 @@ from __future__ import (absolute_import, division, print_function) >>>>>>> Removed uses of six.moves. +import configparser import contextlib import os.path import sys diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index 5e1eabd923..8e2e87ea2c 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -7,12 +7,6 @@ Definitions of coordinate systems. """ -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. from abc import ABCMeta, abstractmethod import warnings diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 6167a424ad..6d461ddd63 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -15,7 +15,7 @@ except ImportError: # Python 2.7 from collections import Iterator import copy -from itertools import chain +from itertools import chain, zip_longest import operator import warnings import zlib diff --git a/lib/iris/fileformats/cf.py b/lib/iris/fileformats/cf.py index 15150bcc17..ac4f5d6f9d 100644 --- a/lib/iris/fileformats/cf.py +++ b/lib/iris/fileformats/cf.py @@ -13,12 +13,6 @@ [NUG] NetCDF User's Guide, http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html """ -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. from abc import ABCMeta, abstractmethod diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index 8c4b112666..33c020f254 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -19,10 +19,14 @@ ======= from __future__ import (absolute_import, division, print_function) <<<<<<< HEAD +<<<<<<< HEAD >>>>>>> Removed uses of six.moves. import six ======= >>>>>>> Removed remaining six imports. +======= +from itertools import zip_longest # Previous line may not be tampered with! +>>>>>>> Removed uses of six.moves. import collections from itertools import repeat diff --git a/lib/iris/fileformats/nimrod.py b/lib/iris/fileformats/nimrod.py index d417b72860..6b85e89545 100644 --- a/lib/iris/fileformats/nimrod.py +++ b/lib/iris/fileformats/nimrod.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Provides NIMROD file format capabilities.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. import glob import numpy as np diff --git a/lib/iris/fileformats/um/_optimal_array_structuring.py b/lib/iris/fileformats/um/_optimal_array_structuring.py index e80a0ca691..5fdba97a75 100644 --- a/lib/iris/fileformats/um/_optimal_array_structuring.py +++ b/lib/iris/fileformats/um/_optimal_array_structuring.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """A module to provide an optimal array structure calculation.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. import itertools diff --git a/lib/iris/io/format_picker.py b/lib/iris/io/format_picker.py index 5173ec5915..f0738809ce 100644 --- a/lib/iris/io/format_picker.py +++ b/lib/iris/io/format_picker.py @@ -39,12 +39,6 @@ """ -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. try: # Python 3 from collections.abc import Callable diff --git a/lib/iris/tests/test_cdm.py b/lib/iris/tests/test_cdm.py index 8156a3635e..2cd7e15224 100644 --- a/lib/iris/tests/test_cdm.py +++ b/lib/iris/tests/test_cdm.py @@ -7,12 +7,6 @@ Test cube indexing, slicing, and extracting, and also the dot graphs. """ -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_file_save.py b/lib/iris/tests/test_file_save.py index 5b3923218a..d236f9a9a5 100644 --- a/lib/iris/tests/test_file_save.py +++ b/lib/iris/tests/test_file_save.py @@ -7,12 +7,6 @@ Test the file saving mechanism. """ -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py index cfb1c45813..45f306979c 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.netcdf.Saver` class.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py index 61ec6b3e38..8929e950f0 100644 --- a/lib/iris/tests/unit/fileformats/pp/test__field_gen.py +++ b/lib/iris/tests/unit/fileformats/pp/test__field_gen.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.pp._field_gen` function.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py index 2a9e3a4487..9e9b2cbf36 100644 --- a/lib/iris/tests/unit/fileformats/pp/test_save_fields.py +++ b/lib/iris/tests/unit/fileformats/pp/test_save_fields.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.pp.save_fields` function.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/merge/test_ProtoCube.py b/lib/iris/tests/unit/merge/test_ProtoCube.py index 31ffda8628..b1fe650933 100644 --- a/lib/iris/tests/unit/merge/test_ProtoCube.py +++ b/lib/iris/tests/unit/merge/test_ProtoCube.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris._merge.ProtoCube` class.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # Import iris.tests first so that some things can be initialised before # importing anything else. diff --git a/lib/iris/tests/unit/tests/test_IrisTest.py b/lib/iris/tests/unit/tests/test_IrisTest.py index 3b82c2b912..b545158eb0 100644 --- a/lib/iris/tests/unit/tests/test_IrisTest.py +++ b/lib/iris/tests/unit/tests/test_IrisTest.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :mod:`iris.tests.IrisTest` class.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before # importing anything else diff --git a/lib/iris/tests/unit/util/test_describe_diff.py b/lib/iris/tests/unit/util/test_describe_diff.py index 56a7cf9716..7c31c2c5ca 100644 --- a/lib/iris/tests/unit/util/test_describe_diff.py +++ b/lib/iris/tests/unit/util/test_describe_diff.py @@ -4,12 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Test function :func:`iris.util.describe_diff`.""" -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. # import iris tests first so that some things can be initialised before # importing anything else diff --git a/tools/generate_std_names.py b/tools/generate_std_names.py index d6699a2397..6736a7dbdb 100644 --- a/tools/generate_std_names.py +++ b/tools/generate_std_names.py @@ -16,12 +16,6 @@ http://cf-pcmdi.llnl.gov/documents/cf-standard-names """ -<<<<<<< HEAD -import six -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed remaining six imports. import argparse import pprint From 6dd3c3c66f82955c44fcd2043282c94b4ee24670 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Mon, 4 Nov 2019 09:35:23 +0000 Subject: [PATCH 30/35] Comment tidy. --- lib/iris/config.py | 6 ------ lib/iris/fileformats/netcdf.py | 17 +---------------- tools/gen_stash_refs.py | 10 +--------- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/lib/iris/config.py b/lib/iris/config.py index 7a94e98e6f..54a7f35cd8 100644 --- a/lib/iris/config.py +++ b/lib/iris/config.py @@ -29,12 +29,6 @@ ---------- """ -<<<<<<< HEAD -from six.moves import configparser -======= - -from __future__ import (absolute_import, division, print_function) ->>>>>>> Removed uses of six.moves. import configparser import contextlib diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index 33c020f254..3ef26d3ca5 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -13,23 +13,8 @@ """ -<<<<<<< HEAD -from six.moves import (filter, input, map, range, zip) # noqa -from six.moves import zip_longest # Previous line may not be tampered with! -======= -from __future__ import (absolute_import, division, print_function) -<<<<<<< HEAD -<<<<<<< HEAD ->>>>>>> Removed uses of six.moves. -import six -======= ->>>>>>> Removed remaining six imports. -======= -from itertools import zip_longest # Previous line may not be tampered with! ->>>>>>> Removed uses of six.moves. - import collections -from itertools import repeat +from itertools import repeat, zip_longest import os import os.path import re diff --git a/tools/gen_stash_refs.py b/tools/gen_stash_refs.py index e1a6d0c9ca..e614b52ab2 100644 --- a/tools/gen_stash_refs.py +++ b/tools/gen_stash_refs.py @@ -21,15 +21,7 @@ """ ''' - -<<<<<<< HEAD -CODE_PREAMBLE = ("from six.moves import " - "(filter, input, map, range, zip) # noqa\n\n" -======= -CODE_PREAMBLE = ("\nfrom __future__ import " - "(absolute_import, division, print_function)\n" ->>>>>>> Removed uses of six.moves. - "from collections import namedtuple\n\n\n" +CODE_PREAMBLE = ("from collections import namedtuple\n\n\n" "Stash = namedtuple('Stash', " "'grid_code field_code pseudo_level_type')\n\n\n") From bc8bf5eff0aadc7c18f1c5961a0b20afc314b2df Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Mon, 4 Nov 2019 12:55:15 +0000 Subject: [PATCH 31/35] Single line break after file docstring. --- docs/iris/src/sphinxext/generate_package_rst.py | 1 - docs/iris/src/whatsnew/aggregate_directory.py | 1 + lib/iris/__init__.py | 1 + lib/iris/_concatenate.py | 1 - lib/iris/_constraints.py | 1 - lib/iris/_data_manager.py | 1 - lib/iris/analysis/__init__.py | 1 - lib/iris/analysis/_grid_angles.py | 1 + lib/iris/analysis/_interpolation.py | 1 - lib/iris/analysis/_regrid.py | 1 - lib/iris/analysis/calculus.py | 1 - lib/iris/analysis/cartography.py | 1 - lib/iris/analysis/geometry.py | 1 - lib/iris/analysis/maths.py | 1 - lib/iris/analysis/stats.py | 1 - lib/iris/analysis/trajectory.py | 1 - lib/iris/coord_categorisation.py | 1 - lib/iris/exceptions.py | 1 - lib/iris/experimental/animate.py | 1 - lib/iris/experimental/concatenate.py | 1 - lib/iris/experimental/regrid_conservative.py | 1 - lib/iris/experimental/representation.py | 1 - lib/iris/fileformats/_ff.py | 1 - lib/iris/fileformats/_ff_cross_references.py | 1 - lib/iris/fileformats/_pp_lbproc_pairs.py | 1 - lib/iris/fileformats/_structured_array_identification.py | 1 - lib/iris/fileformats/nimrod_load_rules.py | 1 - lib/iris/fileformats/pp_save_rules.py | 1 - lib/iris/fileformats/rules.py | 1 - lib/iris/fileformats/um/_fast_load.py | 1 - lib/iris/fileformats/um/_fast_load_structured_fields.py | 1 - lib/iris/fileformats/um/_ff_replacement.py | 1 - lib/iris/fileformats/um_cf_map.py | 1 - lib/iris/io/__init__.py | 1 - lib/iris/iterate.py | 1 - lib/iris/palette.py | 1 - lib/iris/plot.py | 1 - lib/iris/symbols.py | 1 - lib/iris/tests/__init__.py | 1 - lib/iris/tests/experimental/test_raster.py | 1 - .../tests/integration/experimental/test_CubeRepresentation.py | 1 + lib/iris/tests/integration/test_grib_load.py | 1 + lib/iris/tests/integration/test_regrid_equivalence.py | 1 + lib/iris/tests/stock/__init__.py | 1 - lib/iris/tests/test_grib_load_translations.py | 1 + lib/iris/tests/test_whatsnew_contributions.py | 1 + .../tests/unit/analysis/cartography/test_gridcell_angles.py | 1 + .../tests/unit/analysis/cartography/test_rotate_grid_vectors.py | 1 + lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py | 1 + lib/iris/tests/unit/coords/__init__.py | 1 + lib/iris/tests/unit/coords/test_Coord.py | 1 + .../unit/fileformats/pp_load_rules/test__epoch_date_hours.py | 1 + .../fc_rules_cf_fc/test_has_supported_mercator_parameters.py | 1 + .../test_has_supported_stereographic_parameters.py | 1 + tools/generate_std_names.py | 2 -- 55 files changed, 16 insertions(+), 40 deletions(-) diff --git a/docs/iris/src/sphinxext/generate_package_rst.py b/docs/iris/src/sphinxext/generate_package_rst.py index cb9644c785..0c6510c170 100644 --- a/docs/iris/src/sphinxext/generate_package_rst.py +++ b/docs/iris/src/sphinxext/generate_package_rst.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - import os import sys import re diff --git a/docs/iris/src/whatsnew/aggregate_directory.py b/docs/iris/src/whatsnew/aggregate_directory.py index 76083c6972..3debdffe3d 100644 --- a/docs/iris/src/whatsnew/aggregate_directory.py +++ b/docs/iris/src/whatsnew/aggregate_directory.py @@ -18,6 +18,7 @@ is in the style "2001-Jan-23". """ + import datetime from glob import glob import os diff --git a/lib/iris/__init__.py b/lib/iris/__init__.py index 9618db7336..03279aa0ed 100644 --- a/lib/iris/__init__.py +++ b/lib/iris/__init__.py @@ -84,6 +84,7 @@ def callback(cube, field, filename): cube.add_aux_coord(experiment_coord) """ + import contextlib import glob import itertools diff --git a/lib/iris/_concatenate.py b/lib/iris/_concatenate.py index 9b7f73a182..86c3e05a56 100644 --- a/lib/iris/_concatenate.py +++ b/lib/iris/_concatenate.py @@ -8,7 +8,6 @@ """ - from collections import defaultdict, namedtuple from copy import deepcopy diff --git a/lib/iris/_constraints.py b/lib/iris/_constraints.py index 7d0abc89da..662c251c8b 100644 --- a/lib/iris/_constraints.py +++ b/lib/iris/_constraints.py @@ -8,7 +8,6 @@ """ - try: # Python 3 from collections.abc import Iterable, Mapping except ImportError: # Python 2.7 diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index fb32656a6c..73fcc3db52 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -8,7 +8,6 @@ """ - import copy import numpy as np import numpy.ma as ma diff --git a/lib/iris/analysis/__init__.py b/lib/iris/analysis/__init__.py index 3666388092..a91426e6ba 100644 --- a/lib/iris/analysis/__init__.py +++ b/lib/iris/analysis/__init__.py @@ -35,7 +35,6 @@ """ - from collections import OrderedDict try: # Python 3 from collections.abc import Iterable diff --git a/lib/iris/analysis/_grid_angles.py b/lib/iris/analysis/_grid_angles.py index d603ab9ca5..4b3180cd22 100644 --- a/lib/iris/analysis/_grid_angles.py +++ b/lib/iris/analysis/_grid_angles.py @@ -8,6 +8,7 @@ from coordinate points and bounds. """ + import numpy as np import cartopy.crs as ccrs diff --git a/lib/iris/analysis/_interpolation.py b/lib/iris/analysis/_interpolation.py index 1339eaf1a8..49fc04899d 100644 --- a/lib/iris/analysis/_interpolation.py +++ b/lib/iris/analysis/_interpolation.py @@ -5,7 +5,6 @@ # licensing details. """A collection of helpers for interpolation.""" - from collections import namedtuple from itertools import product import operator diff --git a/lib/iris/analysis/_regrid.py b/lib/iris/analysis/_regrid.py index 7bdfc46eea..d734083ff3 100644 --- a/lib/iris/analysis/_regrid.py +++ b/lib/iris/analysis/_regrid.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - import copy import functools import warnings diff --git a/lib/iris/analysis/calculus.py b/lib/iris/analysis/calculus.py index d25edd2a4d..ca0a60bfba 100644 --- a/lib/iris/analysis/calculus.py +++ b/lib/iris/analysis/calculus.py @@ -10,7 +10,6 @@ """ - import re import warnings diff --git a/lib/iris/analysis/cartography.py b/lib/iris/analysis/cartography.py index c741fb1e7e..d48bae3b8c 100644 --- a/lib/iris/analysis/cartography.py +++ b/lib/iris/analysis/cartography.py @@ -8,7 +8,6 @@ """ - from collections import namedtuple import copy import warnings diff --git a/lib/iris/analysis/geometry.py b/lib/iris/analysis/geometry.py index 00cba19f4c..590a9c2689 100644 --- a/lib/iris/analysis/geometry.py +++ b/lib/iris/analysis/geometry.py @@ -11,7 +11,6 @@ """ - import warnings from shapely.geometry import Polygon diff --git a/lib/iris/analysis/maths.py b/lib/iris/analysis/maths.py index 8bfe756ab4..73aff490c5 100644 --- a/lib/iris/analysis/maths.py +++ b/lib/iris/analysis/maths.py @@ -8,7 +8,6 @@ """ - import inspect import math import operator diff --git a/lib/iris/analysis/stats.py b/lib/iris/analysis/stats.py index 6fc182e0dd..19a83ca28a 100644 --- a/lib/iris/analysis/stats.py +++ b/lib/iris/analysis/stats.py @@ -8,7 +8,6 @@ """ - import numpy as np import numpy.ma as ma import iris diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index 1d5a65b91d..2395eecd0e 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -9,7 +9,6 @@ """ - import math import numpy as np diff --git a/lib/iris/coord_categorisation.py b/lib/iris/coord_categorisation.py index 0dccb5be32..12589b20a4 100644 --- a/lib/iris/coord_categorisation.py +++ b/lib/iris/coord_categorisation.py @@ -16,7 +16,6 @@ """ - import calendar import collections diff --git a/lib/iris/exceptions.py b/lib/iris/exceptions.py index 1f9b0108b4..6ca6d36714 100644 --- a/lib/iris/exceptions.py +++ b/lib/iris/exceptions.py @@ -8,7 +8,6 @@ """ - class IrisError(Exception): """Base class for errors in the Iris package.""" pass diff --git a/lib/iris/experimental/animate.py b/lib/iris/experimental/animate.py index 6b8027e300..75b829aa8d 100644 --- a/lib/iris/experimental/animate.py +++ b/lib/iris/experimental/animate.py @@ -8,7 +8,6 @@ """ - import warnings import matplotlib.pyplot as plt diff --git a/lib/iris/experimental/concatenate.py b/lib/iris/experimental/concatenate.py index 7446360f02..14bdf5e747 100644 --- a/lib/iris/experimental/concatenate.py +++ b/lib/iris/experimental/concatenate.py @@ -13,7 +13,6 @@ """ - def concatenate(cubes): """ Concatenate the provided cubes over common existing dimensions. diff --git a/lib/iris/experimental/regrid_conservative.py b/lib/iris/experimental/regrid_conservative.py index 1a175ebaa7..bd315d0a84 100644 --- a/lib/iris/experimental/regrid_conservative.py +++ b/lib/iris/experimental/regrid_conservative.py @@ -8,7 +8,6 @@ """ - import cartopy.crs as ccrs import numpy as np diff --git a/lib/iris/experimental/representation.py b/lib/iris/experimental/representation.py index c5d37b0436..21ff36f33c 100644 --- a/lib/iris/experimental/representation.py +++ b/lib/iris/experimental/representation.py @@ -9,7 +9,6 @@ """ - from html import escape import re diff --git a/lib/iris/fileformats/_ff.py b/lib/iris/fileformats/_ff.py index 9c4e3e4f1f..e26477510c 100644 --- a/lib/iris/fileformats/_ff.py +++ b/lib/iris/fileformats/_ff.py @@ -8,7 +8,6 @@ """ - import os import warnings diff --git a/lib/iris/fileformats/_ff_cross_references.py b/lib/iris/fileformats/_ff_cross_references.py index b7bb122a95..3c9448c12c 100644 --- a/lib/iris/fileformats/_ff_cross_references.py +++ b/lib/iris/fileformats/_ff_cross_references.py @@ -11,7 +11,6 @@ """ - from collections import namedtuple diff --git a/lib/iris/fileformats/_pp_lbproc_pairs.py b/lib/iris/fileformats/_pp_lbproc_pairs.py index 0a812019d2..0622a48020 100644 --- a/lib/iris/fileformats/_pp_lbproc_pairs.py +++ b/lib/iris/fileformats/_pp_lbproc_pairs.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - import itertools diff --git a/lib/iris/fileformats/_structured_array_identification.py b/lib/iris/fileformats/_structured_array_identification.py index 46567d918c..7340f2860e 100644 --- a/lib/iris/fileformats/_structured_array_identification.py +++ b/lib/iris/fileformats/_structured_array_identification.py @@ -43,7 +43,6 @@ """ - from collections import namedtuple import numpy as np diff --git a/lib/iris/fileformats/nimrod_load_rules.py b/lib/iris/fileformats/nimrod_load_rules.py index 8ea4e4c200..703582068a 100644 --- a/lib/iris/fileformats/nimrod_load_rules.py +++ b/lib/iris/fileformats/nimrod_load_rules.py @@ -5,7 +5,6 @@ # licensing details. """Rules for converting NIMROD fields into cubes.""" - import warnings import cf_units diff --git a/lib/iris/fileformats/pp_save_rules.py b/lib/iris/fileformats/pp_save_rules.py index 02b0417e13..f7823f1737 100644 --- a/lib/iris/fileformats/pp_save_rules.py +++ b/lib/iris/fileformats/pp_save_rules.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - import warnings import iris diff --git a/lib/iris/fileformats/rules.py b/lib/iris/fileformats/rules.py index 8e45085e7c..436b2ee01e 100644 --- a/lib/iris/fileformats/rules.py +++ b/lib/iris/fileformats/rules.py @@ -8,7 +8,6 @@ """ - import collections import warnings diff --git a/lib/iris/fileformats/um/_fast_load.py b/lib/iris/fileformats/um/_fast_load.py index ed9f530184..ba21fc648c 100644 --- a/lib/iris/fileformats/um/_fast_load.py +++ b/lib/iris/fileformats/um/_fast_load.py @@ -21,7 +21,6 @@ """ - from contextlib import contextmanager import threading import os.path diff --git a/lib/iris/fileformats/um/_fast_load_structured_fields.py b/lib/iris/fileformats/um/_fast_load_structured_fields.py index cfe3f7030f..06bf07c9bb 100644 --- a/lib/iris/fileformats/um/_fast_load_structured_fields.py +++ b/lib/iris/fileformats/um/_fast_load_structured_fields.py @@ -12,7 +12,6 @@ """ - import itertools import cftime diff --git a/lib/iris/fileformats/um/_ff_replacement.py b/lib/iris/fileformats/um/_ff_replacement.py index 21ecd471f1..367b69fb84 100644 --- a/lib/iris/fileformats/um/_ff_replacement.py +++ b/lib/iris/fileformats/um/_ff_replacement.py @@ -11,7 +11,6 @@ """ - from iris.fileformats._ff import FF2PP from iris.fileformats.pp import _load_cubes_variable_loader diff --git a/lib/iris/fileformats/um_cf_map.py b/lib/iris/fileformats/um_cf_map.py index e4cb6ff2ca..2272d12c70 100644 --- a/lib/iris/fileformats/um_cf_map.py +++ b/lib/iris/fileformats/um_cf_map.py @@ -16,7 +16,6 @@ """ - from collections import namedtuple diff --git a/lib/iris/io/__init__.py b/lib/iris/io/__init__.py index 104b506c54..42f6f32bcc 100644 --- a/lib/iris/io/__init__.py +++ b/lib/iris/io/__init__.py @@ -8,7 +8,6 @@ """ - from collections import OrderedDict import glob import os.path diff --git a/lib/iris/iterate.py b/lib/iris/iterate.py index 4db86d9d6a..89f81db3a6 100644 --- a/lib/iris/iterate.py +++ b/lib/iris/iterate.py @@ -8,7 +8,6 @@ """ - try: # Python 3 from collections.abc import Iterator except ImportError: # Python 2.7 diff --git a/lib/iris/palette.py b/lib/iris/palette.py index a5a1a02363..edbbe80883 100644 --- a/lib/iris/palette.py +++ b/lib/iris/palette.py @@ -9,7 +9,6 @@ """ - from functools import wraps import os import os.path diff --git a/lib/iris/plot.py b/lib/iris/plot.py index 5ee2701cb2..93ec83f04d 100644 --- a/lib/iris/plot.py +++ b/lib/iris/plot.py @@ -11,7 +11,6 @@ """ - import collections import datetime diff --git a/lib/iris/symbols.py b/lib/iris/symbols.py index ecbcb7725e..69688585e2 100644 --- a/lib/iris/symbols.py +++ b/lib/iris/symbols.py @@ -205,7 +205,6 @@ def _wedge_fix(wedge_path): """ - def _convert_paths_to_patches(): # Convert the symbols defined as lists-of-paths into patches. for code, symbol in CLOUD_COVER.items(): diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 9b7366eebf..be6347fdff 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -19,7 +19,6 @@ """ - import codecs import collections import contextlib diff --git a/lib/iris/tests/experimental/test_raster.py b/lib/iris/tests/experimental/test_raster.py index ee950d3ebc..90381dcf3e 100644 --- a/lib/iris/tests/experimental/test_raster.py +++ b/lib/iris/tests/experimental/test_raster.py @@ -4,7 +4,6 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. - import iris.tests as tests import iris diff --git a/lib/iris/tests/integration/experimental/test_CubeRepresentation.py b/lib/iris/tests/integration/experimental/test_CubeRepresentation.py index 3bf2991af1..e32d0bd09c 100644 --- a/lib/iris/tests/integration/experimental/test_CubeRepresentation.py +++ b/lib/iris/tests/integration/experimental/test_CubeRepresentation.py @@ -4,6 +4,7 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Integration tests for cube html representation.""" + from html import escape # Import iris.tests first so that some things can be initialised before diff --git a/lib/iris/tests/integration/test_grib_load.py b/lib/iris/tests/integration/test_grib_load.py index 77641dbc0a..b4b70dd307 100644 --- a/lib/iris/tests/integration/test_grib_load.py +++ b/lib/iris/tests/integration/test_grib_load.py @@ -14,6 +14,7 @@ specific, and target the module 'iris_grib'. """ + # Import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/integration/test_regrid_equivalence.py b/lib/iris/tests/integration/test_regrid_equivalence.py index 8a5b35af65..6c802a4d4a 100644 --- a/lib/iris/tests/integration/test_regrid_equivalence.py +++ b/lib/iris/tests/integration/test_regrid_equivalence.py @@ -9,6 +9,7 @@ "iris.cube.Cube.regrid(scheme=iris.analysis.Nearest())". """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/stock/__init__.py b/lib/iris/tests/stock/__init__.py index 26807729e5..7183a9e79e 100644 --- a/lib/iris/tests/stock/__init__.py +++ b/lib/iris/tests/stock/__init__.py @@ -8,7 +8,6 @@ """ - from datetime import datetime import os.path diff --git a/lib/iris/tests/test_grib_load_translations.py b/lib/iris/tests/test_grib_load_translations.py index f4e6795036..c9a555b874 100644 --- a/lib/iris/tests/test_grib_load_translations.py +++ b/lib/iris/tests/test_grib_load_translations.py @@ -7,6 +7,7 @@ Tests for specific implementation aspects of the grib loaders. """ + # Import iris.tests first so that some things can be initialised before # importing anything else import iris.tests as tests diff --git a/lib/iris/tests/test_whatsnew_contributions.py b/lib/iris/tests/test_whatsnew_contributions.py index 22524501ee..6bffa22e8a 100644 --- a/lib/iris/tests/test_whatsnew_contributions.py +++ b/lib/iris/tests/test_whatsnew_contributions.py @@ -19,6 +19,7 @@ invokes the checking command directly. """ + # import iris tests first. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py index 8123e5fad5..920062081f 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py +++ b/lib/iris/tests/unit/analysis/cartography/test_gridcell_angles.py @@ -8,6 +8,7 @@ :func:`iris.analysis.cartography.gridcell_angles`. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py b/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py index 1d0eb36193..4f03fc584e 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py +++ b/lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py @@ -8,6 +8,7 @@ :func:`iris.analysis.cartography.rotate_grid_vectors`. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py b/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py index 88a403e5aa..5aa552594d 100644 --- a/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py +++ b/lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py @@ -8,6 +8,7 @@ :func:`iris.analysis.cartography.rotate_winds`. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/coords/__init__.py b/lib/iris/tests/unit/coords/__init__.py index 840922ebc7..9cad3d7a07 100644 --- a/lib/iris/tests/unit/coords/__init__.py +++ b/lib/iris/tests/unit/coords/__init__.py @@ -11,6 +11,7 @@ :class:`~iris.tests.unit.coords.test_DimCoord`. """ + import dask.array as da import numpy as np import numpy.ma as ma diff --git a/lib/iris/tests/unit/coords/test_Coord.py b/lib/iris/tests/unit/coords/test_Coord.py index 54976c0a1c..e2dade9e1f 100644 --- a/lib/iris/tests/unit/coords/test_Coord.py +++ b/lib/iris/tests/unit/coords/test_Coord.py @@ -4,6 +4,7 @@ # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :class:`iris.coords.Coord` class.""" + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py index 81fba69603..3f18b64fcd 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__epoch_date_hours.py @@ -8,6 +8,7 @@ :func:`iris.fileformats.pp_load_rules._epoch_date_hours`. """ + # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py index acd79415fa..1c167ec45d 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_mercator_parameters.py @@ -8,6 +8,7 @@ fc_rules_cf_fc.has_supported_mercator_parameters`. """ + import warnings # import iris tests first so that some things can be initialised before diff --git a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py index 18e7d83dd2..d02695f298 100644 --- a/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py +++ b/lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_has_supported_stereographic_parameters.py @@ -8,6 +8,7 @@ fc_rules_cf_fc.has_supported_stereographic_parameters`. """ + import warnings # import iris tests first so that some things can be initialised before diff --git a/tools/generate_std_names.py b/tools/generate_std_names.py index 6736a7dbdb..3aad3bb09c 100644 --- a/tools/generate_std_names.py +++ b/tools/generate_std_names.py @@ -47,8 +47,6 @@ """ - - STD_NAMES = '''.lstrip() From de5dcd4f56d01c036c91ad34a4822d1e983f31a8 Mon Sep 17 00:00:00 2001 From: Martin Yeo Date: Mon, 4 Nov 2019 13:10:35 +0000 Subject: [PATCH 32/35] Fixed over-zealous removal of line breaks in 3 places. --- lib/iris/exceptions.py | 1 + lib/iris/experimental/concatenate.py | 1 + lib/iris/symbols.py | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/iris/exceptions.py b/lib/iris/exceptions.py index 6ca6d36714..1f9b0108b4 100644 --- a/lib/iris/exceptions.py +++ b/lib/iris/exceptions.py @@ -8,6 +8,7 @@ """ + class IrisError(Exception): """Base class for errors in the Iris package.""" pass diff --git a/lib/iris/experimental/concatenate.py b/lib/iris/experimental/concatenate.py index 14bdf5e747..7446360f02 100644 --- a/lib/iris/experimental/concatenate.py +++ b/lib/iris/experimental/concatenate.py @@ -13,6 +13,7 @@ """ + def concatenate(cubes): """ Concatenate the provided cubes over common existing dimensions. diff --git a/lib/iris/symbols.py b/lib/iris/symbols.py index 69688585e2..ecbcb7725e 100644 --- a/lib/iris/symbols.py +++ b/lib/iris/symbols.py @@ -205,6 +205,7 @@ def _wedge_fix(wedge_path): """ + def _convert_paths_to_patches(): # Convert the symbols defined as lists-of-paths into patches. for code, symbol in CLOUD_COVER.items(): From c3e7dd1d956a3b5e9989789c34888a62ae7edc13 Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Tue, 5 Nov 2019 12:56:12 +0000 Subject: [PATCH 33/35] Minor additional fixes --- lib/iris/coords.py | 3 ++- lib/iris/tests/unit/io/test_run_callback.py | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/iris/coords.py b/lib/iris/coords.py index b9d338b01e..23d3552d8f 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -615,9 +615,10 @@ def _value_type_name(self): kind = dtype.kind if kind in 'SU': # Establish the basic type name for 'string' type data. - value_type_name = 'string' if kind == 'S': value_type_name = 'bytes' + else: + value_type_name = 'string' else: value_type_name = dtype.name diff --git a/lib/iris/tests/unit/io/test_run_callback.py b/lib/iris/tests/unit/io/test_run_callback.py index c752e81ee0..3f1cd5ace9 100644 --- a/lib/iris/tests/unit/io/test_run_callback.py +++ b/lib/iris/tests/unit/io/test_run_callback.py @@ -58,9 +58,7 @@ def test_bad_signature(self): def callback(cube): pass with self.assertRaisesRegex(TypeError, - # exactly == Py2, positional == Py3 - 'takes (exactly )?1 (positional )?' - 'argument '): + 'takes 1 positional argument '): iris.io.run_callback(callback, None, None, None) def test_callback_args(self): From e5651ee3ef5febd58e38987d2df0892cb37d975c Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Tue, 5 Nov 2019 13:32:52 +0000 Subject: [PATCH 34/35] revert changes to comment capitalisation --- .../tests/integration/aux_factory/test_OceanSigmaZFactory.py | 2 +- lib/iris/tests/integration/test_regridding.py | 2 +- lib/iris/tests/test_pandas.py | 3 ++- lib/iris/tests/test_pickling.py | 2 +- lib/iris/tests/unit/analysis/maths/test__output_dtype.py | 2 +- .../tests/unit/analysis/regrid/test_RectilinearRegridder.py | 2 +- .../tests/unit/analysis/regrid/test__CurvilinearRegridder.py | 2 +- lib/iris/tests/unit/analysis/stats/test_pearsonr.py | 2 +- lib/iris/tests/unit/analysis/test_PERCENTILE.py | 2 +- lib/iris/tests/unit/analysis/test_WPERCENTILE.py | 2 +- lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py | 2 +- lib/iris/tests/unit/cube/test_Cube.py | 2 +- lib/iris/tests/unit/cube/test_CubeList.py | 2 +- lib/iris/tests/unit/fileformats/cf/test_CFReader.py | 2 +- .../unit/fileformats/name_loaders/test__generate_cubes.py | 2 +- .../netcdf/test__FillValueMaskCheckAndStoreTarget.py | 2 +- lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py | 2 +- lib/iris/tests/unit/fileformats/netcdf/test_save.py | 2 +- .../fileformats/pp_load_rules/test__convert_vertical_coords.py | 2 +- .../tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py | 2 +- .../unit/fileformats/pp_load_rules/test__model_level_number.py | 2 +- .../fileformats/pp_load_rules/test__reshape_vector_args.py | 2 +- .../structured_array_identification/test_ArrayStructure.py | 2 +- .../structured_array_identification/test_GroupStructure.py | 2 +- lib/iris/tests/unit/plot/__init__.py | 2 +- .../unit/plot/test__get_plot_defn_custom_coords_picked.py | 2 +- lib/iris/tests/unit/util/test_new_axis.py | 2 +- 27 files changed, 28 insertions(+), 27 deletions(-) diff --git a/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py b/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py index 892ee43000..3e2714d2b7 100644 --- a/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py +++ b/lib/iris/tests/integration/aux_factory/test_OceanSigmaZFactory.py @@ -9,7 +9,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/integration/test_regridding.py b/lib/iris/tests/integration/test_regridding.py index 10888ca15b..36ae6b0459 100644 --- a/lib/iris/tests/integration/test_regridding.py +++ b/lib/iris/tests/integration/test_regridding.py @@ -5,7 +5,7 @@ # licensing details. """Integration tests for regridding.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/test_pandas.py b/lib/iris/tests/test_pandas.py index f2b462e908..5988059eb3 100644 --- a/lib/iris/tests/test_pandas.py +++ b/lib/iris/tests/test_pandas.py @@ -18,7 +18,8 @@ import netCDF4 import numpy as np -# importing pandas has the side-effect of messing with the formatters + +# Importing pandas has the side-effect of messing with the formatters # used by matplotlib for handling dates. default_units_registry = copy.copy(matplotlib.units.registry) try: diff --git a/lib/iris/tests/test_pickling.py b/lib/iris/tests/test_pickling.py index 7a7891e2e4..ef2caf3f60 100644 --- a/lib/iris/tests/test_pickling.py +++ b/lib/iris/tests/test_pickling.py @@ -8,7 +8,7 @@ """ -# import iris tests first so that some things can be initialised +# Import iris tests first so that some things can be initialised # before importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/maths/test__output_dtype.py b/lib/iris/tests/unit/analysis/maths/test__output_dtype.py index fb83f5a654..2280673a69 100644 --- a/lib/iris/tests/unit/analysis/maths/test__output_dtype.py +++ b/lib/iris/tests/unit/analysis/maths/test__output_dtype.py @@ -8,7 +8,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py index 570fb48b45..c78d067f53 100644 --- a/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test_RectilinearRegridder.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for :class:`iris.analysis._regrid.RectilinearRegridder`.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py index 646f946d6a..394086445b 100644 --- a/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py +++ b/lib/iris/tests/unit/analysis/regrid/test__CurvilinearRegridder.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for :class:`iris.analysis._regrid.CurvilinearRegridder`.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/stats/test_pearsonr.py b/lib/iris/tests/unit/analysis/stats/test_pearsonr.py index e9e06eaa10..32d65f5614 100644 --- a/lib/iris/tests/unit/analysis/stats/test_pearsonr.py +++ b/lib/iris/tests/unit/analysis/stats/test_pearsonr.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the `iris.analysis.stats.pearsonr` function.""" -# import iris tests first so that some things can be initialised before +# Import iris tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_PERCENTILE.py b/lib/iris/tests/unit/analysis/test_PERCENTILE.py index 32eba6c892..ea7b4ec199 100644 --- a/lib/iris/tests/unit/analysis/test_PERCENTILE.py +++ b/lib/iris/tests/unit/analysis/test_PERCENTILE.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the :data:`iris.analysis.PERCENTILE` aggregator.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/test_WPERCENTILE.py b/lib/iris/tests/unit/analysis/test_WPERCENTILE.py index 53e9b5efaa..f509332c02 100644 --- a/lib/iris/tests/unit/analysis/test_WPERCENTILE.py +++ b/lib/iris/tests/unit/analysis/test_WPERCENTILE.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the :data:`iris.analysis.PERCENTILE` aggregator.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py b/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py index ab27a863c2..5dd4e6142e 100644 --- a/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py +++ b/lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py @@ -8,7 +8,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index e8baf3d835..7d9b65f2ae 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the `iris.cube.Cube` class.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/cube/test_CubeList.py b/lib/iris/tests/unit/cube/test_CubeList.py index 29901cf541..f0510f33c0 100644 --- a/lib/iris/tests/unit/cube/test_CubeList.py +++ b/lib/iris/tests/unit/cube/test_CubeList.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the `iris.cube.CubeList` class.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests import iris.tests.stock diff --git a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py index 40a1865151..968cbb4c3e 100644 --- a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py +++ b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py @@ -8,7 +8,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py b/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py index b2371b75cf..0b59f5d308 100644 --- a/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py +++ b/lib/iris/tests/unit/fileformats/name_loaders/test__generate_cubes.py @@ -8,7 +8,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py b/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py index 6f13d5de11..1ca8cf814b 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test__FillValueMaskCheckAndStoreTarget.py @@ -9,7 +9,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py b/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py index f7a2dad4e2..c6127da067 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test__load_cube.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the `iris.fileformats.netcdf._load_cube` function.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_save.py b/lib/iris/tests/unit/fileformats/netcdf/test_save.py index 46cf6de80c..759f371077 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_save.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_save.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the `iris.fileformats.netcdf.save` function.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py index c82204db31..7c1ef5678b 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_vertical_coords.py @@ -9,7 +9,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py index 011f453649..4112aa7580 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__dim_or_aux.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for :func:`iris.fileformats.pp_load_rules._dim_or_aux`.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py index 532e412854..66a03c5b2b 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__model_level_number.py @@ -8,7 +8,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py index 23e0041856..6132a19294 100644 --- a/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py +++ b/lib/iris/tests/unit/fileformats/pp_load_rules/test__reshape_vector_args.py @@ -9,7 +9,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py b/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py index 095a5d8966..4302e66173 100644 --- a/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py +++ b/lib/iris/tests/unit/fileformats/structured_array_identification/test_ArrayStructure.py @@ -9,7 +9,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py b/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py index 0a1d847ad5..9b20cf798c 100644 --- a/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py +++ b/lib/iris/tests/unit/fileformats/structured_array_identification/test_GroupStructure.py @@ -9,7 +9,7 @@ """ -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/__init__.py b/lib/iris/tests/unit/plot/__init__.py index 622d990eaf..f8361929d8 100644 --- a/lib/iris/tests/unit/plot/__init__.py +++ b/lib/iris/tests/unit/plot/__init__.py @@ -5,7 +5,7 @@ # licensing details. """Unit tests for the :mod:`iris.plot` module.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py index b1798fa063..e40a483905 100644 --- a/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py +++ b/lib/iris/tests/unit/plot/test__get_plot_defn_custom_coords_picked.py @@ -6,7 +6,7 @@ """Unit tests for the `iris.plot._get_plot_defn_custom_coords_picked` function.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests diff --git a/lib/iris/tests/unit/util/test_new_axis.py b/lib/iris/tests/unit/util/test_new_axis.py index 7f8d91271e..b914d4ba15 100644 --- a/lib/iris/tests/unit/util/test_new_axis.py +++ b/lib/iris/tests/unit/util/test_new_axis.py @@ -5,7 +5,7 @@ # licensing details. """Test function :func:`iris.util.new_axis`.""" -# import iris.tests first so that some things can be initialised before +# Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests as tests import iris.tests.stock as stock From 95307eba3275328e8c2c0dc3677875d9881aae05 Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Tue, 5 Nov 2019 15:20:18 +0000 Subject: [PATCH 35/35] remove super arguments --- lib/iris/fileformats/pp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 9e8d876117..3ebea0e606 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -318,7 +318,7 @@ def __hash__(self): def __eq__(self, other): if isinstance(other, str): - return super(STASH, self).__eq__(STASH.from_msi(other)) + return super().__eq__(STASH.from_msi(other)) else: return super().__eq__(other)