Code Duplication    Length = 12-13 lines in 4 locations

aacgmv2/tests/test_c_aacgmv2.py 4 locations

@@ 216-228 (lines=13) @@
213
214
        del code
215
216
    def test_convert_GEOCENTRIC_A2G_TRACE(self):
217
        """Test convert from magnetic to geographic coordinates using trace"""
218
        code = aacgmv2._aacgmv2.A2G + aacgmv2._aacgmv2.TRACE + \
219
               aacgmv2._aacgmv2.GEOCENTRIC
220
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
221
        (self.mlat, self.mlon,
222
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
223
                                                 self.alt_in[0], code)
224
        np.testing.assert_almost_equal(self.mlat, 30.6211, decimal=4)
225
        np.testing.assert_almost_equal(self.mlon, -94.1809, decimal=4)
226
        np.testing.assert_almost_equal(self.rshell, 1135.0000, decimal=4)
227
228
        del code
229
230
    @classmethod
231
    def test_forbidden(self):
@@ 202-214 (lines=13) @@
199
200
        del code
201
202
    def test_convert_GEOCENTRIC_G2A_TRACE(self):
203
        """Test convert from geographic to magnetic coordinates using trace"""
204
        code = aacgmv2._aacgmv2.G2A + aacgmv2._aacgmv2.TRACE + \
205
               aacgmv2._aacgmv2.GEOCENTRIC
206
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
207
        (self.mlat, self.mlon,
208
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
209
                                                 self.alt_in[0], code)
210
        np.testing.assert_almost_equal(self.mlat, 48.3830, decimal=4)
211
        np.testing.assert_almost_equal(self.mlon, 57.7926, decimal=4)
212
        np.testing.assert_almost_equal(self.rshell, 1.1781, decimal=4)
213
214
        del code
215
216
    def test_convert_GEOCENTRIC_A2G_TRACE(self):
217
        """Test convert from magnetic to geographic coordinates using trace"""
@@ 189-200 (lines=12) @@
186
187
        del code
188
        
189
    def test_convert_GEOCENTRIC_A2G_coeff(self):
190
        """Test convert from magnetic to geocentric coordinates"""
191
        code = aacgmv2._aacgmv2.A2G + aacgmv2._aacgmv2.GEOCENTRIC
192
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
193
        (self.mlat, self.mlon,
194
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
195
                                                 self.alt_in[0], code)
196
        np.testing.assert_almost_equal(self.mlat, 30.6101, decimal=4)
197
        np.testing.assert_almost_equal(self.mlon, -94.1806, decimal=4)
198
        np.testing.assert_almost_equal(self.rshell, 1135.0000, decimal=4)
199
200
        del code
201
202
    def test_convert_GEOCENTRIC_G2A_TRACE(self):
203
        """Test convert from geographic to magnetic coordinates using trace"""
@@ 176-187 (lines=12) @@
173
174
        del code
175
176
    def test_convert_GEOCENTRIC_G2A_coeff(self):
177
        """Test convert from geographic to magnetic coordinates"""
178
        code = aacgmv2._aacgmv2.G2A + aacgmv2._aacgmv2.GEOCENTRIC
179
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
180
        (self.mlat, self.mlon,
181
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
182
                                                 self.alt_in[0], code)
183
        np.testing.assert_almost_equal(self.mlat, 48.3779, decimal=4)
184
        np.testing.assert_almost_equal(self.mlon, 57.7974, decimal=4)
185
        np.testing.assert_almost_equal(self.rshell, 1.1781, decimal=4)
186
187
        del code
188
        
189
    def test_convert_GEOCENTRIC_A2G_coeff(self):
190
        """Test convert from magnetic to geocentric coordinates"""