Code Duplication    Length = 15-15 lines in 2 locations

aacgmv2/tests/test_c_aacgmv2.py 2 locations

@@ 76-90 (lines=15) @@
73
            np.testing.assert_almost_equal(self.rshell, self.r_comp['G2A'][i],
74
                                           decimal=4)
75
76
    def test_convert_A2G_coeff(self):
77
        """Test convert from magnetic to geodetic coordinates"""
78
        for i,darg in enumerate(self.date_args):
79
            aacgmv2._aacgmv2.set_datetime(*darg)
80
            (self.mlat, self.mlon,
81
             self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[i],
82
                                                     self.lon_in[i],
83
                                                     self.alt_in[i],
84
                                                     aacgmv2._aacgmv2.A2G)
85
            np.testing.assert_almost_equal(self.mlat, self.lat_comp['A2G'][i],
86
                                           decimal=4)
87
            np.testing.assert_almost_equal(self.mlon, self.lon_comp['A2G'][i],
88
                                           decimal=4)
89
            np.testing.assert_almost_equal(self.rshell, self.r_comp['A2G'][i],
90
                                           decimal=4)
91
92
    def test_convert_arr(self):
93
        """Test convert_arr using from magnetic to geodetic coordinates"""
@@ 60-74 (lines=15) @@
57
        with pytest.raises(RuntimeError):
58
            aacgmv2._aacgmv2.set_datetime(1013, 1, 1, 0, 0, 0)
59
60
    def test_convert_G2A_coeff(self):
61
        """Test convert from geographic to magnetic coordinates"""
62
        for i,darg in enumerate(self.date_args):
63
            aacgmv2._aacgmv2.set_datetime(*darg)
64
            (self.mlat, self.mlon,
65
             self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[i],
66
                                                     self.lon_in[i],
67
                                                     self.alt_in[i],
68
                                                     aacgmv2._aacgmv2.G2A)
69
            np.testing.assert_almost_equal(self.mlat, self.lat_comp['G2A'][i],
70
                                           decimal=4)
71
            np.testing.assert_almost_equal(self.mlon, self.lon_comp['G2A'][i],
72
                                           decimal=4)
73
            np.testing.assert_almost_equal(self.rshell, self.r_comp['G2A'][i],
74
                                           decimal=4)
75
76
    def test_convert_A2G_coeff(self):
77
        """Test convert from magnetic to geodetic coordinates"""