From 7ab307de467619aed475d220108c120b995f9a17 Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Fri, 1 Nov 2019 12:12:47 +0000 Subject: [PATCH 1/2] remove arguments from super --- lib/iris/_concatenate.py | 8 ++---- lib/iris/_deprecation.py | 3 +- lib/iris/aux_factory.py | 14 +++++----- lib/iris/cube.py | 4 +-- .../_structured_array_identification.py | 5 ++-- lib/iris/fileformats/pp.py | 8 +++--- lib/iris/fileformats/um/_fast_load.py | 2 +- lib/iris/tests/__init__.py | 3 +- lib/iris/tests/experimental/test_animate.py | 2 +- .../tests/integration/plot/test_colorbar.py | 2 +- .../integration/plot/test_vector_plots.py | 2 +- lib/iris/tests/integration/test_pickle.py | 6 ++-- lib/iris/tests/integration/test_regridding.py | 2 +- lib/iris/tests/test_coding_standards.py | 3 +- lib/iris/tests/test_grib_load_translations.py | 2 +- lib/iris/tests/test_hybrid.py | 2 +- lib/iris/tests/test_mapping.py | 12 ++++---- lib/iris/tests/test_plot.py | 28 +++++++++---------- lib/iris/tests/test_quickplot.py | 4 +-- lib/iris/tests/unit/coords/test_AuxCoord.py | 2 +- lib/iris/tests/unit/coords/test_DimCoord.py | 2 +- .../um/fast_load/test_FieldCollation.py | 2 +- lib/iris/tests/unit/plot/__init__.py | 2 +- lib/iris/tests/unit/plot/test_plot.py | 2 +- lib/iris/tests/unit/plot/test_scatter.py | 2 +- lib/iris/tests/unit/quickplot/test_plot.py | 2 +- lib/iris/tests/unit/quickplot/test_scatter.py | 2 +- lib/iris/util.py | 3 +- 28 files changed, 62 insertions(+), 69 deletions(-) diff --git a/lib/iris/_concatenate.py b/lib/iris/_concatenate.py index 97471d4f3b..00a5d958a1 100644 --- a/lib/iris/_concatenate.py +++ b/lib/iris/_concatenate.py @@ -122,16 +122,14 @@ def __new__(cls, coord, dims): else: order = _DECREASING kwargs['order'] = order - metadata = super(_CoordMetaData, cls).__new__(cls, defn, dims, - points_dtype, - bounds_dtype, - kwargs) + metadata = super().__new__(cls, defn, dims, points_dtype, + bounds_dtype, kwargs) return metadata __slots__ = () def __hash__(self): - return super(_CoordMetaData, self).__hash__() + return super().__hash__() def __eq__(self, other): result = NotImplemented diff --git a/lib/iris/_deprecation.py b/lib/iris/_deprecation.py index 6a4341dc5a..77d4e3b77c 100644 --- a/lib/iris/_deprecation.py +++ b/lib/iris/_deprecation.py @@ -66,5 +66,4 @@ def __new__(metacls, classname, bases, class_dict): class_dict['__doc__'] = parent_class.__doc__ # Return the result. - return super(ClassWrapperSameDocstring, metacls).__new__( - metacls, classname, bases, class_dict) + return super().__new__(metacls, classname, bases, class_dict) diff --git a/lib/iris/aux_factory.py b/lib/iris/aux_factory.py index c78c8a918d..f8774ae3c8 100644 --- a/lib/iris/aux_factory.py +++ b/lib/iris/aux_factory.py @@ -366,7 +366,7 @@ def __init__(self, delta=None, sigma=None, orography=None): The coordinate providing the `orog` term. """ - super(HybridHeightFactory, self).__init__() + super().__init__() if delta and delta.nbounds not in (0, 2): raise ValueError('Invalid delta coordinate: must have either 0 or' @@ -521,7 +521,7 @@ def __init__(self, delta=None, sigma=None, surface_air_pressure=None): The coordinate providing the `ps` term. """ - super(HybridPressureFactory, self).__init__() + super().__init__() # Check that provided coords meet necessary conditions. self._check_dependencies(delta, sigma, surface_air_pressure) @@ -696,7 +696,7 @@ def __init__(self, sigma=None, eta=None, depth=None, either `eta`, or 'sigma' and `depth` and `depth_c` coordinates. """ - super(OceanSigmaZFactory, self).__init__() + super().__init__() # Check that provided coordinates meet necessary conditions. self._check_dependencies(sigma, eta, depth, depth_c, nsigma, zlev) @@ -955,7 +955,7 @@ def __init__(self, sigma=None, eta=None, depth=None): (depth(j, i) + eta(n, j, i)) """ - super(OceanSigmaFactory, self).__init__() + super().__init__() # Check that provided coordinates meet necessary conditions. self._check_dependencies(sigma, eta, depth) @@ -1119,7 +1119,7 @@ def __init__(self, s=None, c=None, eta=None, depth=None, depth_c=None): S(k,j,i) = depth_c * s(k) + (depth(j,i) - depth_c) * C(k) """ - super(OceanSg1Factory, self).__init__() + super().__init__() # Check that provided coordinates meet necessary conditions. self._check_dependencies(s, c, eta, depth, depth_c) @@ -1308,7 +1308,7 @@ def __init__(self, s=None, eta=None, depth=None, a=None, b=None, b * [tanh(a * (s(k) + 0.5)) / (2 * tanh(0.5*a)) - 0.5] """ - super(OceanSFactory, self).__init__() + super().__init__() # Check that provided coordinates meet necessary conditions. self._check_dependencies(s, eta, depth, a, b, depth_c) @@ -1492,7 +1492,7 @@ def __init__(self, s=None, c=None, eta=None, depth=None, depth_c=None): (depth_c + depth(j,i)) """ - super(OceanSg2Factory, self).__init__() + super().__init__() # Check that provided coordinates meet necessary conditions. self._check_dependencies(s, c, eta, depth, depth_c) diff --git a/lib/iris/cube.py b/lib/iris/cube.py index e5257b7060..03a6fcd9e6 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -231,7 +231,7 @@ def __add__(self, other): def __getitem__(self, keys): """x.__getitem__(y) <==> x[y]""" - result = super(CubeList, self).__getitem__(keys) + result = super().__getitem__(keys) if isinstance(result, list): result = CubeList(result) return result @@ -243,7 +243,7 @@ def __getslice__(self, start, stop): Use of negative indices is not supported. """ - result = super(CubeList, self).__getslice__(start, stop) + result = super().__getslice__(start, stop) result = CubeList(result) return result diff --git a/lib/iris/fileformats/_structured_array_identification.py b/lib/iris/fileformats/_structured_array_identification.py index f83d9423cb..75d2d64f38 100644 --- a/lib/iris/fileformats/_structured_array_identification.py +++ b/lib/iris/fileformats/_structured_array_identification.py @@ -92,8 +92,7 @@ class ArrayStructure(namedtuple('ArrayStructure', """ def __new__(cls, stride, unique_ordered_values): - self = super(ArrayStructure, cls).__new__(cls, stride, - unique_ordered_values) + self = super().__new__(cls, stride, unique_ordered_values) return self __slots__ = () @@ -108,7 +107,7 @@ def size(self): return len(self.unique_ordered_values) def __hash__(self): - return super(ArrayStructure, self).__hash__() + return super().__hash__() def __eq__(self, other): stride = getattr(other, 'stride', None) diff --git a/lib/iris/fileformats/pp.py b/lib/iris/fileformats/pp.py index 0b124966b6..50004273cd 100644 --- a/lib/iris/fileformats/pp.py +++ b/lib/iris/fileformats/pp.py @@ -262,7 +262,7 @@ def __new__(cls, model, section, item): model = cls._validate_member('model', model, 1, 99) section = cls._validate_member('section', section, 0, 99) item = cls._validate_member('item', item, 1, 999) - return super(STASH, cls).__new__(cls, model, section, item) + return super().__new__(cls, model, section, item) @staticmethod def from_msi(msi): @@ -318,13 +318,13 @@ def is_valid(self): return '?' not in str(self) def __hash__(self): - return super(STASH, self).__hash__() + return super().__hash__() def __eq__(self, other): if isinstance(other, six.string_types): - return super(STASH, self).__eq__(STASH.from_msi(other)) + return super().__eq__(STASH.from_msi(other)) else: - return super(STASH, self).__eq__(other) + return super().__eq__(other) def __ne__(self, other): return not self.__eq__(other) diff --git a/lib/iris/fileformats/um/_fast_load.py b/lib/iris/fileformats/um/_fast_load.py index c1457340ce..33d0fbfa1a 100644 --- a/lib/iris/fileformats/um/_fast_load.py +++ b/lib/iris/fileformats/um/_fast_load.py @@ -62,7 +62,7 @@ def __init__(self, fields, filepath): The path of the file the collation is loaded from. """ - super(FieldCollation, self).__init__(fields) + super().__init__(fields) self._load_filepath = filepath @property diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 709a78f5f8..84a9863929 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -524,8 +524,7 @@ def assertRaisesRegexp(self, *args, **kwargs): """ # 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) + return six.assertRaisesRegex(super(), *args, **kwargs) @contextlib.contextmanager def _recordWarningMatches(self, expected_regexp=''): diff --git a/lib/iris/tests/experimental/test_animate.py b/lib/iris/tests/experimental/test_animate.py index 1c4d4350a9..5d89bea397 100644 --- a/lib/iris/tests/experimental/test_animate.py +++ b/lib/iris/tests/experimental/test_animate.py @@ -29,7 +29,7 @@ @tests.skip_plot class IntegrationTest(tests.GraphicsTest): def setUp(self): - super(IntegrationTest, self).setUp() + super().setUp() cube = iris.cube.Cube(np.arange(36, dtype=np.int32).reshape((3, 3, 4))) cs = GeogCS(6371229) diff --git a/lib/iris/tests/integration/plot/test_colorbar.py b/lib/iris/tests/integration/plot/test_colorbar.py index 1088238c6a..394e7f1cf4 100644 --- a/lib/iris/tests/integration/plot/test_colorbar.py +++ b/lib/iris/tests/integration/plot/test_colorbar.py @@ -31,7 +31,7 @@ @tests.skip_plot class TestColorBarCreation(tests.GraphicsTest): def setUp(self): - super(TestColorBarCreation, self).setUp() + super().setUp() self.draw_functions = (contour, contourf, pcolormesh, pcolor) self.cube = iris.tests.stock.lat_lon_cube() self.cube.coord('longitude').guess_bounds() diff --git a/lib/iris/tests/integration/plot/test_vector_plots.py b/lib/iris/tests/integration/plot/test_vector_plots.py index f7a567c195..73889cc355 100644 --- a/lib/iris/tests/integration/plot/test_vector_plots.py +++ b/lib/iris/tests/integration/plot/test_vector_plots.py @@ -178,7 +178,7 @@ def test_circular_longitude(self): class TestQuiver(MixinVectorPlotCases, tests.GraphicsTest): def setUp(self): - super(TestQuiver, self).setUp() + super().setUp() def plot_function_to_test(self): return quiver diff --git a/lib/iris/tests/integration/test_pickle.py b/lib/iris/tests/integration/test_pickle.py index 8aaca62f03..94adf89598 100644 --- a/lib/iris/tests/integration/test_pickle.py +++ b/lib/iris/tests/integration/test_pickle.py @@ -57,15 +57,15 @@ def pickle_obj(self, obj): # see https://github.com/SciTools/iris/pull/2608 @unittest.expectedFailure def test_protocol_0(self): - super(TestGribMessage, self).test_protocol_0() + super().test_protocol_0() @unittest.expectedFailure def test_protocol_1(self): - super(TestGribMessage, self).test_protocol_1() + super().test_protocol_1() @unittest.expectedFailure def test_protocol_2(self): - super(TestGribMessage, self).test_protocol_2() + super().test_protocol_2() def test(self): # Check that a GribMessage pickles without errors. diff --git a/lib/iris/tests/integration/test_regridding.py b/lib/iris/tests/integration/test_regridding.py index 40d83c70fb..ceb62d76dd 100644 --- a/lib/iris/tests/integration/test_regridding.py +++ b/lib/iris/tests/integration/test_regridding.py @@ -138,7 +138,7 @@ def test_linear_same_crs_global(self): class TestZonalMean_regional(TestZonalMean_global, tests.IrisTest): def setUp(self): - super(TestZonalMean_regional, self).setUp() + super().setUp() # Define a target grid and a target result (what we expect the # regridder to return). diff --git a/lib/iris/tests/test_coding_standards.py b/lib/iris/tests/test_coding_standards.py index e490bd1d8f..423f139e52 100644 --- a/lib/iris/tests/test_coding_standards.py +++ b/lib/iris/tests/test_coding_standards.py @@ -133,8 +133,7 @@ def get_file_results(self): return self.file_errors # Otherwise call the superclass' method to print the bad results. - return super(StandardReportWithExclusions, - self).get_file_results() + return super().get_file_results() class TestCodeFormat(tests.IrisTest): diff --git a/lib/iris/tests/test_grib_load_translations.py b/lib/iris/tests/test_grib_load_translations.py index 4696754ae5..a14ddff782 100644 --- a/lib/iris/tests/test_grib_load_translations.py +++ b/lib/iris/tests/test_grib_load_translations.py @@ -355,7 +355,7 @@ def cube_from_message(self, grib): class TestGrib1LoadPhenomenon(TestGribSimple): # Test recognition of grib phenomenon types. def mock_grib(self): - grib = super(TestGrib1LoadPhenomenon, self).mock_grib() + grib = super().mock_grib() grib.edition = 1 return grib diff --git a/lib/iris/tests/test_hybrid.py b/lib/iris/tests/test_hybrid.py index 1dfcc86780..aed7e94eae 100644 --- a/lib/iris/tests/test_hybrid.py +++ b/lib/iris/tests/test_hybrid.py @@ -29,7 +29,7 @@ @tests.skip_data class TestRealistic4d(tests.GraphicsTest): def setUp(self): - super(TestRealistic4d, self).setUp() + super().setUp() self.cube = iris.tests.stock.realistic_4d() self.altitude = self.cube.coord('altitude') diff --git a/lib/iris/tests/test_mapping.py b/lib/iris/tests/test_mapping.py index f941a421b3..1b7932a18c 100644 --- a/lib/iris/tests/test_mapping.py +++ b/lib/iris/tests/test_mapping.py @@ -39,7 +39,7 @@ @tests.skip_data class TestBasic(tests.GraphicsTest): def setUp(self): - super(TestBasic, self).setUp() + super().setUp() self.cube = iris.tests.stock.realistic_4d() def test_contourf(self): @@ -73,7 +73,7 @@ def test_default_projection_and_extent(self): @tests.skip_plot class TestUnmappable(tests.GraphicsTest): def setUp(self): - super(TestUnmappable, self).setUp() + super().setUp() src_cube = iris.tests.stock.global_pp() # Make a cube that can't be located on the globe. @@ -99,7 +99,7 @@ def test_simple(self): @tests.skip_plot class TestMappingSubRegion(tests.GraphicsTest): def setUp(self): - super(TestMappingSubRegion, self).setUp() + super().setUp() cube_path = tests.get_data_path( ('PP', 'aPProt1', 'rotatedMHtimecube.pp')) cube = iris.load_cube(cube_path)[0] @@ -148,7 +148,7 @@ def test_default_projection_and_extent(self): @tests.skip_plot class TestLowLevel(tests.GraphicsTest): def setUp(self): - super(TestLowLevel, self).setUp() + super().setUp() self.cube = iris.tests.stock.global_pp() self.few = 4 self.few_levels = list(range(280, 300, 5)) @@ -181,7 +181,7 @@ def test_keywords(self): @tests.skip_plot class TestBoundedCube(tests.GraphicsTest): def setUp(self): - super(TestBoundedCube, self).setUp() + super().setUp() self.cube = iris.tests.stock.global_pp() # Add some bounds to this data (this will actually make the bounds # invalid as they will straddle the north pole and overlap on the @@ -216,7 +216,7 @@ def test_default_projection_and_extent(self): @tests.skip_plot class TestLimitedAreaCube(tests.GraphicsTest): def setUp(self): - super(TestLimitedAreaCube, self).setUp() + super().setUp() cube_path = tests.get_data_path(('PP', 'aPProt1', 'rotated.pp')) self.cube = iris.load_cube(cube_path)[::20, ::20] self.cube.coord('grid_latitude').guess_bounds() diff --git a/lib/iris/tests/test_plot.py b/lib/iris/tests/test_plot.py index 7e70901fbb..b6a565ffec 100644 --- a/lib/iris/tests/test_plot.py +++ b/lib/iris/tests/test_plot.py @@ -95,7 +95,7 @@ def test_missing_cs(self): @tests.skip_data class TestHybridHeight(tests.GraphicsTest): def setUp(self): - super(TestHybridHeight, self).setUp() + super().setUp() self.cube = iris.tests.stock.realistic_4d()[0, :15, 0, :] def _check(self, plt_method, test_altitude=True): @@ -147,7 +147,7 @@ class Test1dPlotMultiArgs(tests.GraphicsTest): # tests for iris.plot using multi-argument calling convention def setUp(self): - super(Test1dPlotMultiArgs, self).setUp() + super().setUp() self.cube1d = _load_4d_testcube()[0, :, 0, 0] self.draw_method = iplt.plot @@ -242,7 +242,7 @@ def setUp(self): @tests.skip_plot class Test1dScatter(tests.GraphicsTest): def setUp(self): - super(Test1dScatter, self).setUp() + super().setUp() self.cube = iris.load_cube( tests.get_data_path(('NAME', 'NAMEIII_trajectory.txt')), 'Temperature') @@ -460,7 +460,7 @@ def test_tz(self): class TestContour(tests.GraphicsTest, SliceMixin): """Test the iris.plot.contour routine.""" def setUp(self): - super(TestContour, self).setUp() + super().setUp() self.wind = _load_4d_testcube() self.draw_method = iplt.contour @@ -469,7 +469,7 @@ def setUp(self): class TestContourf(tests.GraphicsTest, SliceMixin): """Test the iris.plot.contourf routine.""" def setUp(self): - super(TestContourf, self).setUp() + super().setUp() self.wind = _load_4d_testcube() self.draw_method = iplt.contourf @@ -478,7 +478,7 @@ def setUp(self): class TestPcolor(tests.GraphicsTest, SliceMixin): """Test the iris.plot.pcolor routine.""" def setUp(self): - super(TestPcolor, self).setUp() + super().setUp() self.wind = _load_4d_testcube() self.draw_method = iplt.pcolor @@ -487,7 +487,7 @@ def setUp(self): class TestPcolormesh(tests.GraphicsTest, SliceMixin): """Test the iris.plot.pcolormesh routine.""" def setUp(self): - super(TestPcolormesh, self).setUp() + super().setUp() self.wind = _load_4d_testcube() self.draw_method = iplt.pcolormesh @@ -580,7 +580,7 @@ class TestPcolorNoBounds(six.with_metaclass(CheckForWarningsMetaclass, """ def setUp(self): - super(TestPcolorNoBounds, self).setUp() + super().setUp() self.wind = _load_wind_no_bounds() self.draw_method = iplt.pcolor @@ -596,7 +596,7 @@ class TestPcolormeshNoBounds(six.with_metaclass(CheckForWarningsMetaclass, """ def setUp(self): - super(TestPcolormeshNoBounds, self).setUp() + super().setUp() self.wind = _load_wind_no_bounds() self.draw_method = iplt.pcolormesh @@ -641,7 +641,7 @@ def test_t_dates(self): class TestPlot(tests.GraphicsTest, Slice1dMixin): """Test the iris.plot.plot routine.""" def setUp(self): - super(TestPlot, self).setUp() + super().setUp() self.wind = _load_4d_testcube() self.draw_method = iplt.plot @@ -650,7 +650,7 @@ def setUp(self): class TestQuickplotPlot(tests.GraphicsTest, Slice1dMixin): """Test the iris.quickplot.plot routine.""" def setUp(self): - super(TestQuickplotPlot, self).setUp() + super().setUp() self.wind = _load_4d_testcube() self.draw_method = qplt.plot @@ -692,7 +692,7 @@ def __repr__(self): @tests.skip_plot class TestPlotCoordinatesGiven(tests.GraphicsTest): def setUp(self): - super(TestPlotCoordinatesGiven, self).setUp() + super().setUp() filename = tests.get_data_path(('PP', 'COLPEX', 'theta_and_orog_subset.pp')) self.cube = load_cube_once(filename, 'air_potential_temperature') @@ -822,7 +822,7 @@ def test_non_cube_coordinate(self): @tests.skip_plot class TestPlotDimAndAuxCoordsKwarg(tests.GraphicsTest): def setUp(self): - super(TestPlotDimAndAuxCoordsKwarg, self).setUp() + super().setUp() filename = tests.get_data_path(('NetCDF', 'rotated', 'xy', 'rotPole_landAreaFraction.nc')) self.cube = iris.load_cube(filename) @@ -930,7 +930,7 @@ def test_plot_tmerc(self): @tests.skip_plot class TestPlotCitation(tests.GraphicsTest): def setUp(self): - super(TestPlotCitation, self).setUp() + super().setUp() self.figure = plt.figure() self.axes = self.figure.gca() self.text = ('Lorem ipsum dolor sit amet, consectetur adipiscing ' diff --git a/lib/iris/tests/test_quickplot.py b/lib/iris/tests/test_quickplot.py index 7bb8f0300e..079f631925 100644 --- a/lib/iris/tests/test_quickplot.py +++ b/lib/iris/tests/test_quickplot.py @@ -100,7 +100,7 @@ def setUp(self): @tests.skip_plot class TestLabels(tests.GraphicsTest): def setUp(self): - super(TestLabels, self).setUp() + super().setUp() self.theta = _load_theta() def _slice(self, coords): @@ -203,7 +203,7 @@ def test_alignment(self): @tests.skip_plot class TestTimeReferenceUnitsLabels(tests.GraphicsTest): def setUp(self): - super(TestTimeReferenceUnitsLabels, self).setUp() + super().setUp() path = tests.get_data_path(('PP', 'aPProt1', 'rotatedMHtimecube.pp')) self.cube = iris.load_cube(path)[:, 0, 0] diff --git a/lib/iris/tests/unit/coords/test_AuxCoord.py b/lib/iris/tests/unit/coords/test_AuxCoord.py index 6af4a8cf9a..dedf241b71 100644 --- a/lib/iris/tests/unit/coords/test_AuxCoord.py +++ b/lib/iris/tests/unit/coords/test_AuxCoord.py @@ -33,7 +33,7 @@ class AuxCoordTestMixin(CoordTestMixin): # Define a 2-D default array shape. def setupTestArrays(self, shape=(2, 3), masked=False): - super(AuxCoordTestMixin, self).setupTestArrays(shape, masked=masked) + super().setupTestArrays(shape, masked=masked) class Test__init__(tests.IrisTest, AuxCoordTestMixin): diff --git a/lib/iris/tests/unit/coords/test_DimCoord.py b/lib/iris/tests/unit/coords/test_DimCoord.py index d5a8776914..cc0beaed85 100644 --- a/lib/iris/tests/unit/coords/test_DimCoord.py +++ b/lib/iris/tests/unit/coords/test_DimCoord.py @@ -32,7 +32,7 @@ class DimCoordTestMixin(CoordTestMixin): # Define a 1-D default array shape. def setupTestArrays(self, shape=(3, ), masked=False): - super(DimCoordTestMixin, self).setupTestArrays(shape, masked=masked) + super().setupTestArrays(shape, masked=masked) class Test__init__(tests.IrisTest, DimCoordTestMixin): 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 a83e7cff7a..0ec264332a 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 @@ -32,7 +32,7 @@ class TestFastCallbackLocationInfo(Mixin_FieldTest, tests.IrisTest): def setUp(self): # Call parent setup. - super(TestFastCallbackLocationInfo, self).setUp() + super().setUp() # Create a basic load test case. self.callback_collations = [] diff --git a/lib/iris/tests/unit/plot/__init__.py b/lib/iris/tests/unit/plot/__init__.py index 19b97ece2b..52aa9f9ebb 100644 --- a/lib/iris/tests/unit/plot/__init__.py +++ b/lib/iris/tests/unit/plot/__init__.py @@ -20,7 +20,7 @@ @tests.skip_plot class TestGraphicStringCoord(tests.GraphicsTest): def setUp(self): - super(TestGraphicStringCoord, self).setUp() + super().setUp() self.cube = simple_2d(with_bounds=True) self.cube.add_aux_coord(AuxCoord(list('abcd'), long_name='str_coord'), 1) diff --git a/lib/iris/tests/unit/plot/test_plot.py b/lib/iris/tests/unit/plot/test_plot.py index b3ddad5ca6..041c0e3a09 100644 --- a/lib/iris/tests/unit/plot/test_plot.py +++ b/lib/iris/tests/unit/plot/test_plot.py @@ -30,7 +30,7 @@ @tests.skip_plot class TestStringCoordPlot(TestGraphicStringCoord): def setUp(self): - super(TestStringCoordPlot, self).setUp() + super().setUp() self.cube = self.cube[0, :] self.lat_lon_cube = self.lat_lon_cube[0, :] diff --git a/lib/iris/tests/unit/plot/test_scatter.py b/lib/iris/tests/unit/plot/test_scatter.py index 7c4a52b8ba..0aadf43006 100644 --- a/lib/iris/tests/unit/plot/test_scatter.py +++ b/lib/iris/tests/unit/plot/test_scatter.py @@ -20,7 +20,7 @@ @tests.skip_plot class TestStringCoordPlot(TestGraphicStringCoord): def setUp(self): - super(TestStringCoordPlot, self).setUp() + super().setUp() self.cube = self.cube[0, :] self.lat_lon_cube = self.lat_lon_cube[0, :] diff --git a/lib/iris/tests/unit/quickplot/test_plot.py b/lib/iris/tests/unit/quickplot/test_plot.py index 2fdeb53f29..a0199658e8 100644 --- a/lib/iris/tests/unit/quickplot/test_plot.py +++ b/lib/iris/tests/unit/quickplot/test_plot.py @@ -20,7 +20,7 @@ @tests.skip_plot class TestStringCoordPlot(TestGraphicStringCoord): def setUp(self): - super(TestStringCoordPlot, self).setUp() + super().setUp() self.cube = self.cube[0, :] def test_yaxis_labels(self): diff --git a/lib/iris/tests/unit/quickplot/test_scatter.py b/lib/iris/tests/unit/quickplot/test_scatter.py index e6b52f4748..07746bfb6b 100644 --- a/lib/iris/tests/unit/quickplot/test_scatter.py +++ b/lib/iris/tests/unit/quickplot/test_scatter.py @@ -20,7 +20,7 @@ @tests.skip_plot class TestStringCoordPlot(TestGraphicStringCoord): def setUp(self): - super(TestStringCoordPlot, self).setUp() + super().setUp() self.cube = self.cube[0, :] def test_xaxis_labels(self): diff --git a/lib/iris/util.py b/lib/iris/util.py index f8cc859cd2..9e5a39a3df 100644 --- a/lib/iris/util.py +++ b/lib/iris/util.py @@ -821,8 +821,7 @@ def __new__(cls, name, bases, namespace): 'self._init_from_tuple((%s,))' % (args, args)) exec(method_source, namespace) - return super(_MetaOrderedHashable, cls).__new__( - cls, name, bases, namespace) + return super().__new__(cls, name, bases, namespace) @functools.total_ordering From bdd4ab890366605231bcef0e15b7777f129d1f01 Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Mon, 4 Nov 2019 13:05:32 +0000 Subject: [PATCH 2/2] remove additional super arguments --- lib/iris/coords.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 2aa7f542f9..5773f05008 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -860,9 +860,8 @@ def __new__(cls, name_or_coord, minimum, maximum, in the selection. Default is True. """ - return super(CoordExtent, cls).__new__(cls, name_or_coord, minimum, - maximum, min_inclusive, - max_inclusive) + return super().__new__(cls, name_or_coord, minimum, maximum, + min_inclusive, max_inclusive) __slots__ = () @@ -979,7 +978,7 @@ def __new__(cls, point=None, bound=None): 'length 1.') point = point[0] - return super(Cell, cls).__new__(cls, point, bound) + return super().__new__(cls, point, bound) def __mod__(self, mod): point = self.point @@ -1000,7 +999,7 @@ def __add__(self, mod): return Cell(point, bound) def __hash__(self): - return super(Cell, self).__hash__() + return super().__hash__() def __eq__(self, other): """