def test_apply_transformation_sets_different_products_parallel(self): # set_1 = ['[H]OC([H])([H])C([H])(O[H])C([H])([H])[H]'] # set_2 = ['[H]C(=O)C([H])=C([H])[H]', '[H+]', '[H]N=C(O[H])C1=C([H])N(C2([H])OC([H])(C([H])([H])OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C3([H])OC([H])(n4c([H])nc5c(N([H])[H])nc([H])nc54)C([H])(OP(=O)(O[H])O[H])C3([H])O[H])C([H])(O[H])C2([H])O[H])C([H])=C([H])C1([H])[H]'] set_test_compound = "[H][C](=[O])[C]([H])([H])[C]([H])([H])[H]" compound = Compound(set_test_compound, single_worker = True) moves = compound.obtain_applicable_transformation_with_move(available_rules = applicable_rules_10_dict) move_1 = moves[0] product_set_1 = compound.apply_transformation_with_move(move_1) move_2 = moves[1] product_set_2 = compound.apply_transformation_with_move(move_2) assert set([product.name for product in product_set_1]) != set([product.name for product in product_set_2])
def test_apply_transformation_sets_parallel(self): set_1 = [Compound('[H]OC([H])([H])C([H])(O[H])C([H])([H])[H]').name] set_2 = [Compound('[H]C(=O)C([H])=C([H])[H]').name, Compound('[H+]').name, Compound('[H]N=C(O[H])C1=C([H])N(C2([H])OC([H])(C([H])([H])OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C3([H])OC([H])(n4c([H])nc5c(N([H])[H])nc([H])nc54)C([H])(OP(=O)(O[H])O[H])C3([H])O[H])C([H])(O[H])C2([H])O[H])C([H])=C([H])C1([H])[H]').name] set_test_compound = "[H][C](=[O])[C]([H])([H])[C]([H])([H])[H]" compound = Compound(set_test_compound, single_worker = True) moves = compound.obtain_applicable_transformation_with_move(available_rules = applicable_rules_10_dict) found_set_1 = False found_set_2 = False all_found = True for move in moves: products = compound.apply_transformation_with_move(move) if set([product.name for product in products]) == set(set_1): found_set_1 = True elif set([product.name for product in products]) == set(set_2): found_set_2 = True else: all_found = False assert (found_set_1 and found_set_2 and len(moves) == 2)