def test_get_tori(self): '''Test getting Tori and riq''' from metrics import get_tori tori, tori_ref, riq, riq_ref, d = get_tori(testset, testset) # First test the total Tori with the computed value self.assertAlmostEqual(tori, expected_results['indicators']['tori']) # The riq follows from normalizing by date range yrange = datetime.now().year - min([int(p[:4]) for p in testset]) + 1 self.assertAlmostEqual(riq, int(1000.0 * sqrt(tori) / float(yrange))) # Now do the same for the refereed set self.assertAlmostEqual(tori_ref, expected_results['indicators refereed']['tori']) # The riq follows from normalizing by date range self.assertAlmostEqual(riq_ref, int(1000.0 * sqrt(tori_ref) / float(yrange)))
def test_get_tori(self): '''Test getting Tori and riq''' from metrics import get_tori tori, tori_ref, riq, riq_ref, d = get_tori(testset, testset) # First test the total Tori with the computed value self.assertAlmostEqual(tori, expected_results['indicators']['tori']) # The riq follows from normalizing by date range yrange = datetime.now().year - min([int(p[:4]) for p in testset]) + 1 self.assertAlmostEqual(riq, int(1000.0 * sqrt(tori) / float(yrange))) # Now do the same for the refereed set self.assertAlmostEqual( tori_ref, expected_results['indicators refereed']['tori']) # The riq follows from normalizing by date range self.assertAlmostEqual( riq_ref, int(1000.0 * sqrt(tori_ref) / float(yrange)))
def test_get_tori(self): '''Test getting Tori when all citations are self-citations''' from metrics import get_tori tori, tori_ref, riq, riq_ref, d = get_tori(testset, testset) self.assertEqual(tori, 0)