Code Duplication    Length = 30-31 lines in 2 locations

aacgmv2/tests/test_py_aacgmv2.py 2 locations

@@ 333-363 (lines=31) @@
330
                                    [1.04551548, 1.04546847, 1.04542272]],
331
                                   rtol=1e-4)
332
333
    def test_convert_latlon_arr_mult_arr_unequal(self):
334
        """Test array latlon conversion for unequal sized multi-dim array"""
335
        (self.lat_out, self.lon_out,
336
         self.r_out) = aacgmv2.convert_latlon_arr(np.array([[60, 61, 62],
337
                                                            [63, 64, 65]]),
338
                                                  np.array([0]),
339
                                                  np.array([300]), self.dtime)
340
341
        if not isinstance(self.lat_out, np.ndarray):
342
            raise AssertionError()
343
        if not isinstance(self.lon_out, np.ndarray):
344
            raise AssertionError()
345
        if not isinstance(self.r_out, np.ndarray):
346
            raise AssertionError()
347
        if not (self.r_out.shape == self.lon_out.shape and
348
                self.lat_out.shape == self.r_out.shape and
349
                self.r_out.shape == (2, 3)):
350
            raise AssertionError()
351
352
        np.testing.assert_allclose(self.lat_out,
353
                                   [[58.2257709, 59.3186093, 60.4039740],
354
                                    [61.4819893, 62.5527635, 63.6163840]],
355
                                   rtol=1e-4)
356
        np.testing.assert_allclose(self.lon_out,
357
                                   [[81.1684696, 81.6139893, 82.0871880],
358
                                    [82.5909499, 83.1285895, 83.7039272]],
359
                                   rtol=1e-4)
360
        np.testing.assert_allclose(self.r_out,
361
                                   [[1.04566346, 1.04561304, 1.04556369],
362
                                    [1.04551548, 1.04546847, 1.04542272]],
363
                                   rtol=1e-4)
364
365
    def test_convert_latlon_arr_badidea(self):
366
        """Test array latlon conversion for BADIDEA"""
@@ 302-331 (lines=30) @@
299
        np.testing.assert_allclose(self.r_out, [1.04566346, 1.04561304],
300
                                   rtol=1e-4)
301
302
    def test_convert_latlon_arr_mult_arr_mix(self):
303
        """Test array latlon conversion for mix type with 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
                                                 0, 300, self.dtime)
308
309
        if not isinstance(self.lat_out, np.ndarray):
310
            raise AssertionError()
311
        if not isinstance(self.lon_out, np.ndarray):
312
            raise AssertionError()
313
        if not isinstance(self.r_out, np.ndarray):
314
            raise AssertionError()
315
        if not (self.r_out.shape == self.lon_out.shape and
316
                self.lat_out.shape == self.r_out.shape and
317
                self.r_out.shape == (2, 3)):
318
            raise AssertionError()
319
320
        np.testing.assert_allclose(self.lat_out,
321
                                   [[58.2257709, 59.3186093, 60.4039740],
322
                                    [61.4819893, 62.5527635, 63.6163840]],
323
                                   rtol=1e-4)
324
        np.testing.assert_allclose(self.lon_out,
325
                                   [[81.1684696, 81.6139893, 82.0871880],
326
                                    [82.5909499, 83.1285895, 83.7039272]],
327
                                   rtol=1e-4)
328
        np.testing.assert_allclose(self.r_out,
329
                                   [[1.04566346, 1.04561304, 1.04556369],
330
                                    [1.04551548, 1.04546847, 1.04542272]],
331
                                   rtol=1e-4)
332
333
    def test_convert_latlon_arr_mult_arr_unequal(self):
334
        """Test array latlon conversion for unequal sized multi-dim array"""