def test_pow_to_db_to_pow_arrays(self): x = pow2db(db2pow((1.234567, 2.345678))) self.assertEqual(np.rank(x), 1) self.assertEqual(len(x), 2) self.assertAlmostEqual(x[0], 1.234567, places=6) self.assertAlmostEqual(x[1], 2.345678, places=6)
def test_nested(self): x = lin2db(db2pow(pow2db(db2lin(1.234567)))) self.assertAlmostEqual(x, 1.234567, places=6)
def test_pow_to_db_to_pow(self): x = pow2db(db2pow(1.234567)) self.assertAlmostEqual(x, 1.234567, places=6)
def test_known_value_neg_10(self): x = db2pow(-10) self.assertAlmostEqual(x, 0.1, places=2)
def test_known_value_neg_3(self): x = db2pow(-3) self.assertAlmostEqual(x, 0.5, places=2)
def test_known_value_6(self): x = db2pow(6.02) self.assertAlmostEqual(x, 4.0, places=2)
def test_known_value_3(self): x = db2pow(3) self.assertAlmostEqual(x, 2.0, places=2)
def test_known_value_0(self): x = db2pow(0) self.assertAlmostEqual(x, 1.0, places=6)