Code Duplication    Length = 30-31 lines in 2 locations

aacgmv2/tests/test_py_aacgmv2.py 2 locations

@@ 302-332 (lines=31) @@
299
                                    [1.04551548, 1.04546847, 1.04542272]],
300
                                   rtol=1e-4)
301
302
    def test_convert_latlon_arr_mult_arr_unequal(self):
303
        """Test array latlon conversion for unequal sized multi-dim array"""
304
        (self.lat_out, self.lon_out,
305
         self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62],
306
                                                            [63, 64, 65]]),
307
                                                  np.array([0]),
308
                                                  np.array([300]), self.dtime)
309
310
        if not isinstance(self.lat_out, np.ndarray):
311
            raise AssertionError()
312
        if not isinstance(self.lon_out, np.ndarray):
313
            raise AssertionError()
314
        if not isinstance(self.r_out, np.ndarray):
315
            raise AssertionError()
316
        if not (self.r_out.shape == self.lon_out.shape and
317
                self.lat_out.shape == self.r_out.shape and
318
                self.r_out.shape == (2, 3)):
319
            raise AssertionError()
320
321
        np.testing.assert_allclose(self.lat_out,
322
                                   [[58.2257709, 59.3186093, 60.4039740],
323
                                    [61.4819893, 62.5527635, 63.6163840]],
324
                                   rtol=1e-4)
325
        np.testing.assert_allclose(self.lon_out,
326
                                   [[81.1684696, 81.6139893, 82.0871880],
327
                                    [82.5909499, 83.1285895, 83.7039272]],
328
                                   rtol=1e-4)
329
        np.testing.assert_allclose(self.r_out,
330
                                   [[1.04566346, 1.04561304, 1.04556369],
331
                                    [1.04551548, 1.04546847, 1.04542272]],
332
                                   rtol=1e-4)
333
334
    def test_convert_latlon_arr_badidea(self):
335
        """Test array latlon conversion for BADIDEA"""
@@ 271-300 (lines=30) @@
268
        np.testing.assert_allclose(self.r_out, [1.04566346, 1.04561304],
269
                                   rtol=1e-4)
270
271
    def test_convert_latlon_arr_mult_arr_mix(self):
272
        """Test array latlon conversion for mix type with multi-dim array"""
273
        (self.lat_out, self.lon_out,
274
        self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62],
275
                                                           [63, 64, 65]]),
276
                                                 0, 300, self.dtime)
277
278
        if not isinstance(self.lat_out, np.ndarray):
279
            raise AssertionError()
280
        if not isinstance(self.lon_out, np.ndarray):
281
            raise AssertionError()
282
        if not isinstance(self.r_out, np.ndarray):
283
            raise AssertionError()
284
        if not (self.r_out.shape == self.lon_out.shape and
285
                self.lat_out.shape == self.r_out.shape and
286
                self.r_out.shape == (2, 3)):
287
            raise AssertionError()
288
289
        np.testing.assert_allclose(self.lat_out,
290
                                   [[58.2257709, 59.3186093, 60.4039740],
291
                                    [61.4819893, 62.5527635, 63.6163840]],
292
                                   rtol=1e-4)
293
        np.testing.assert_allclose(self.lon_out,
294
                                   [[81.1684696, 81.6139893, 82.0871880],
295
                                    [82.5909499, 83.1285895, 83.7039272]],
296
                                   rtol=1e-4)
297
        np.testing.assert_allclose(self.r_out,
298
                                   [[1.04566346, 1.04561304, 1.04556369],
299
                                    [1.04551548, 1.04546847, 1.04542272]],
300
                                   rtol=1e-4)
301
302
    def test_convert_latlon_arr_mult_arr_unequal(self):
303
        """Test array latlon conversion for unequal sized multi-dim array"""