def __init__(self, biosystem): self.vertex = self.reconstruct_arcs(biosystem) if DEBUG: print debug_info('reconstructed_arcs'), self.vertex self.reaction_lines = [] self.resolve_biosystem_net(self.vertex) if DEBUG: print debug_info('BioNetwork_lines'), self.reaction_lines self.reaction_lines_hash = hash_list(self.reaction_lines) if DEBUG: print debug_info('BioNetwork_lines_hash'), self.reaction_lines_hash self.network_hash = hash(dump_ord(sorted(self.reaction_lines_hash))) + biosystem['system_parameter']['time'] if DEBUG: print debug_info('BioNetwork_hash'), self.network_hash
def test_reaction(self): print debug_info('Test self') print hash_list([{'a': 43.5}, {46: '77y'}, {65.6: 7}]) hash_string_list(['zhang hao', 'cuitianyi', 'zhuangsiyuan']) self.assertEqual(hash_dict({1: 2, 3: 4}), hash_dict({3: 4, 1: 2}))