def test_getters(self): comparator = dc.DataComparator([self.DS_0, self.DS_1]) comparator.implement(significance=0.05) # XXX do these need unit tests? EGN: maybe not - could ask Kenny mdl = self.DS_0.keys()[10] comparator.get_JSD(mdl) comparator.get_JSD_pseudothreshold() comparator.get_LLR(mdl) comparator.get_LLR_pseudothreshold() comparator.get_SSJSD(mdl) comparator.get_SSTVD(mdl) comparator.get_TVD(mdl) comparator.get_aggregate_LLR() comparator.get_aggregate_LLR_threshold() comparator.get_aggregate_nsigma() comparator.get_aggregate_pvalue() comparator.get_aggregate_pvalue_threshold() comparator.get_maximum_SSTVD() comparator.get_pvalue(mdl) comparator.get_pvalue_pseudothreshold() comparator.get_worst_circuits(10)
def test_construction_raises_on_op_sequence_mismatch(self): DS_bad = DataSet(outcomeLabels=['0', '1']) # order ok... DS_bad.add_count_dict(('Gx',), {'0': 10, '1': 90}) DS_bad.done_adding_data() with self.assertRaises(ValueError): dc.DataComparator([self.DS_0, DS_bad])
def test_construction_raises_on_bad_ds_names(self): with self.assertRaises(ValueError): dc.DataComparator([self.DS_0, self.DS_1], DS_names=["foobar"])
def test_implement_multidataset(self): mds = MultiDataSet(outcomeLabels=[('0',),('1',)]) mds.add_dataset('D0', self.DS_0) mds.add_dataset('D1', self.DS_1) comparator = dc.DataComparator(mds) comparator.implement(significance=0.05)
def test_implement_inclusive(self): comparator = dc.DataComparator([self.DS_0, self.DS_1], op_inclusions=['Gi'], DS_names=['D0', 'D1']) comparator.implement(significance=0.05)
def test_implement(self): comparator = dc.DataComparator([self.DS_0, self.DS_1]) comparator.implement(significance=0.05)