Exemplo n.º 1
0
	def test_normalization(self):
		'''test normalization'''
		m = ts.mean(self.nsample)
		s = ts.samplesd(self.nsample)
		res = [ts.normalize(x, m, s) for x in self.nsample]
		self.assertEqual(round(ts.mean(res)), self.nsampmean)
		self.assertEqual(round(ts.sd(res)), self.nsampdev)
Exemplo n.º 2
0
	def test_calc_valid_meanvalue_harmony(self):
		'''Test caluculate mean value by harmony'''
		time = 50
		samples = ((time,50),(time,25))
		result = ts.mean(samples, mode="harmony")
		self.assertEqual(result, 1.5)
Exemplo n.º 3
0
	def test_calc_valid_meanvalue_geom(self):
		'''Test caluculate mean value by geom'''
		result = ts.mean(self.samples, mode="geom")
		self.assertEqual(round(result,1), 8.8)
Exemplo n.º 4
0
	def test_calc_valid_meanvalue(self):
		'''Test caluculate mean value'''
		result = ts.mean(self.samples)
		self.assertEqual(result, self.x)
Exemplo n.º 5
0
	def test_devvalue(self):
		'''test deviation value'''
		m = ts.mean(self.nsample)
		s = ts.samplesd(self.nsample)
		res = ts.devvalue(self.nsample[0], m, s)
		self.assertEqual(round(res,1), self.devvx)