def test_state_loading(self): a = State() a.load(self.inputY) X = a.toJSON() Y = self.Y self.assertDictEqual(X, Y, "Loading and dumping to JSON does not " + \ " work: " + str(X) + " != " + str(Y))
def toJSON(self): ret = State.toJSON(self) ret['backgroundprob'] = self.backgroundProbability ret['time'] = self.time ret['transitionmatrix'] = self.transitionMatrix if self.consensusDistribution != None: ret['consensusdistribution'] = \ dist_to_json(self.consensusDistribution) if self.repeatLengthDistribution != None: ret['repeatlengthdistribution'] = \ dist_to_json(self.repeatLengthDistribution) ret['trackemissions'] = self.trackEmissions if self.version != None: ret['version'] = self.version if self.repProb != None: ret['repprob'] = float(self.repProb) #TODO: save consensus distribution return ret
def toJSON(self): ret = State.toJSON(self) ret["durations"] = self.durations return ret
def toJSON(self): ret = State.toJSON(self) ret['order'] = self.order return ret