def test(self): mfd = TruncatedGRMFD(min_mag=0.61, max_mag=0.94, bin_width=0.1, a_val=1, b_val=0.2) # mag values should be rounded to 0.6 and 0.9 and there # should be three bins with the first having center at 0.65 min_mag, num_bins = mfd._get_min_mag_and_num_bins() self.assertAlmostEqual(min_mag, 0.65) self.assertEqual(mfd.get_min_max_mag(), (min_mag, min_mag + 0.2)) self.assertEqual(num_bins, 3)