Code Duplication    Length = 12-13 lines in 4 locations

aacgmv2/tests/test_c_aacgmv2.py 4 locations

@@ 238-250 (lines=13) @@
235
236
        del code
237
238
    def test_convert_GEOCENTRIC_A2G_TRACE(self):
239
        """Test convert from magnetic to geographic coordinates using trace"""
240
        code = aacgmv2._aacgmv2.A2G + aacgmv2._aacgmv2.TRACE + \
241
               aacgmv2._aacgmv2.GEOCENTRIC
242
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
243
        (self.mlat, self.mlon,
244
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
245
                                                 self.alt_in[0], code)
246
        np.testing.assert_almost_equal(self.mlat, 30.6211, decimal=4)
247
        np.testing.assert_almost_equal(self.mlon, -94.1809, decimal=4)
248
        np.testing.assert_almost_equal(self.rshell, 1135.0000, decimal=4)
249
250
        del code
251
252
    @classmethod
253
    def test_forbidden(self):
@@ 224-236 (lines=13) @@
221
222
        del code
223
224
    def test_convert_GEOCENTRIC_G2A_TRACE(self):
225
        """Test convert from geographic to magnetic coordinates using trace"""
226
        code = aacgmv2._aacgmv2.G2A + aacgmv2._aacgmv2.TRACE + \
227
               aacgmv2._aacgmv2.GEOCENTRIC
228
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
229
        (self.mlat, self.mlon,
230
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
231
                                                 self.alt_in[0], code)
232
        np.testing.assert_almost_equal(self.mlat, 48.3830, decimal=4)
233
        np.testing.assert_almost_equal(self.mlon, 57.7926, decimal=4)
234
        np.testing.assert_almost_equal(self.rshell, 1.1781, decimal=4)
235
236
        del code
237
238
    def test_convert_GEOCENTRIC_A2G_TRACE(self):
239
        """Test convert from magnetic to geographic coordinates using trace"""
@@ 211-222 (lines=12) @@
208
209
        del code
210
        
211
    def test_convert_GEOCENTRIC_A2G_coeff(self):
212
        """Test convert from magnetic to geocentric coordinates"""
213
        code = aacgmv2._aacgmv2.A2G + aacgmv2._aacgmv2.GEOCENTRIC
214
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
215
        (self.mlat, self.mlon,
216
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
217
                                                 self.alt_in[0], code)
218
        np.testing.assert_almost_equal(self.mlat, 30.6101, decimal=4)
219
        np.testing.assert_almost_equal(self.mlon, -94.1806, decimal=4)
220
        np.testing.assert_almost_equal(self.rshell, 1135.0000, decimal=4)
221
222
        del code
223
224
    def test_convert_GEOCENTRIC_G2A_TRACE(self):
225
        """Test convert from geographic to magnetic coordinates using trace"""
@@ 198-209 (lines=12) @@
195
196
        del code
197
198
    def test_convert_GEOCENTRIC_G2A_coeff(self):
199
        """Test convert from geographic to magnetic coordinates"""
200
        code = aacgmv2._aacgmv2.G2A + aacgmv2._aacgmv2.GEOCENTRIC
201
        aacgmv2._aacgmv2.set_datetime(*self.date_args[0])
202
        (self.mlat, self.mlon,
203
         self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[0], self.lon_in[0],
204
                                                 self.alt_in[0], code)
205
        np.testing.assert_almost_equal(self.mlat, 48.3779, decimal=4)
206
        np.testing.assert_almost_equal(self.mlon, 57.7974, decimal=4)
207
        np.testing.assert_almost_equal(self.rshell, 1.1781, decimal=4)
208
209
        del code
210
        
211
    def test_convert_GEOCENTRIC_A2G_coeff(self):
212
        """Test convert from magnetic to geocentric coordinates"""