Example #1
0
	def testUninitalizedEntries(self):
		# assure that entries with no data are listed as xdata
		m=MeasurementResult("TestData")
		a=m[2.0]
		self.assert_(isinstance(a, AccumulatedValue))
		self.assert_(2.0 in m)
		self.assert_(2.0 not in m.get_xdata())
		m[2.0]+=1
		self.assert_(2.0 in m.get_xdata())
Example #2
0
	def testZeroError(self):
		# AccumulatedValues with only one Accumulation should have 0 error
		m=MeasurementResult("TestData")
		m[0.0]
		m[1.0]=AccumulatedValue()
		m[2.0]=0
		m[3.0]=AccumulatedValue(0,1.0)
		k,v,e=m.get_errorplotdata()
		self.assert_(2.0 in k and 3.0 in k)
		self.assert_(1.0 not in k and 0.0 not in k)
		self.assertAlmostEqual(e[k==2.0][0], 0)
		self.assertAlmostEqual(e[k==3.0][0], 1.0)