예제 #1
0
 def test_db_6(self):
     """Test function for db() 6/6"""
     res = ds.db(self.tv1, 'power', R=100)
     # the R value should be ignored (warning only)
     self.assertTrue(np.allclose(self.r1, res, atol=1e-8, rtol=1e-5))
예제 #2
0
 def test_db_4(self):
     """Test function for db() 4/6"""
     res = ds.undbv(ds.db(self.tv4, 'voltage'))
     self.assertTrue(np.allclose(self.tv4, res, atol=1e-8, rtol=1e-5))
예제 #3
0
 def test_db_5(self):
     """Test function for db() 5/6"""
     with self.assertRaises(ValueError):
         res = ds.db([1], 'wrong')
예제 #4
0
 def test_db_3(self):
     """Test function for db() 3/6"""
     res = ds.db(self.tv3, 'power')
     self.assertTrue(np.allclose(self.r3, res, atol=1e-8, rtol=1e-5))
예제 #5
0
 def test_db_6(self):
     """Test function for db() 6/6"""
     res = ds.db(self.tv1, 'power', R=100)
     # the R value should be ignored (warning only)
     self.assertTrue(np.allclose(self.r1, res, atol=1e-8, rtol=1e-5))
예제 #6
0
 def test_db_5(self):
     """Test function for db() 5/6"""
     res = ds.db([1], 'wrong')
예제 #7
0
 def test_db_4(self):
     """Test function for db() 4/6"""
     res = ds.undbv(ds.db(self.tv4, 'voltage'))
     self.assertTrue(np.allclose(self.tv4, res, atol=1e-8, rtol=1e-5))
예제 #8
0
 def test_db_3(self):
     """Test function for db() 3/6"""
     res = ds.db(self.tv3, 'power')
     self.assertTrue(np.allclose(self.r3, res, atol=1e-8, rtol=1e-5))