@@ -2475,99 +2475,6 @@ def test_get_smallest_set_of_smallest_rings(self):
24752475 cycle_list = mol .get_smallest_set_of_smallest_rings (symmetrized = True )
24762476 assert len (cycle_list ) == 6 # satisfying, but no longer the 'true' SSSR
24772477
2478- @pytest .mark .skip ("get_deterministic_sssr is deprecated" )
2479- def test_get_deterministic_smallest_set_of_smallest_rings_case1 (self ):
2480- """
2481- Test fused tricyclic can be decomposed into single rings more
2482- deterministically
2483- """
2484- smiles = "C1C2C3C=CCCC2C13"
2485-
2486- previous_num_shared_atoms_list = None
2487- # repeat 100 time to test non-deterministic behavior
2488- for _ in range (100 ):
2489- mol = Molecule ().from_smiles (smiles )
2490- sssr_det = mol .get_deterministic_sssr ()
2491-
2492- num_shared_atoms_list = []
2493- for i , ring_i in enumerate (sssr_det ):
2494- for j in range (i + 1 , len (sssr_det )):
2495- ring_j = sssr_det [j ]
2496- num_shared_atoms = len (set (ring_i ).intersection (ring_j ))
2497-
2498- num_shared_atoms_list .append (num_shared_atoms )
2499-
2500- num_shared_atoms_list = sorted (num_shared_atoms_list )
2501-
2502- if previous_num_shared_atoms_list is None :
2503- previous_num_shared_atoms_list = num_shared_atoms_list
2504- continue
2505- assert num_shared_atoms_list == previous_num_shared_atoms_list
2506- previous_num_shared_atoms_list = num_shared_atoms_list
2507-
2508- @pytest .mark .skip ("get_deterministic_sssr is deprecated" )
2509- def test_get_deterministic_smallest_set_of_smallest_rings_case2 (self ):
2510- """
2511- Test if two possible smallest rings can join the smallest set
2512- the method can pick one of them deterministically using sum of
2513- atomic numbers along the rings.
2514- In this test case and with currect method setup, ring (CCSCCCCC)
2515- will be picked rather than ring(CCCOCC).
2516- """
2517-
2518- smiles = "C1=CC2C3CSC(CO3)C2C1"
2519-
2520- previous_atom_symbols_list = None
2521- # repeat 100 time to test non-deterministic behavior
2522- for _ in range (100 ):
2523- mol = Molecule ().from_smiles (smiles )
2524- sssr_det = mol .get_deterministic_sssr ()
2525-
2526- atom_symbols_list = []
2527- for ring in sssr_det :
2528- atom_symbols = sorted ([a .element .symbol for a in ring ])
2529- atom_symbols_list .append (atom_symbols )
2530-
2531- atom_symbols_list = sorted (atom_symbols_list )
2532-
2533- if previous_atom_symbols_list is None :
2534- previous_atom_symbols_list = atom_symbols_list
2535- continue
2536- assert atom_symbols_list == previous_atom_symbols_list
2537- previous_atom_symbols_list = atom_symbols_list
2538-
2539- @pytest .mark .skip ("get_deterministic_sssr is deprecated" )
2540- def test_get_deterministic_smallest_set_of_smallest_rings_case3 (self ):
2541- """
2542- Test if two possible smallest rings can join the smallest set
2543- the method can pick one of them deterministically when their
2544- sum of atomic numbers along the rings are also equal to each other.
2545-
2546- To break the tie, one option we have is to consider adding contributions
2547- from other parts of the molecule, such as atomic number weighted connectivity
2548- value and differentiate bond orders when calculating connectivity values.
2549- """
2550- smiles = "C=1CC2C3CSC(O[Si]3)C2C1"
2551-
2552- previous_atom_symbols_list = None
2553- # repeat 100 time to test non-deterministic behavior
2554- for _ in range (100 ):
2555- mol = Molecule ().from_smiles (smiles )
2556- sssr_det = mol .get_deterministic_sssr ()
2557-
2558- atom_symbols_list = []
2559- for ring in sssr_det :
2560- atom_symbols = sorted ([a .element .symbol for a in ring ])
2561- atom_symbols_list .append (atom_symbols )
2562-
2563- atom_symbols_list = sorted (atom_symbols_list )
2564-
2565- if previous_atom_symbols_list is None :
2566- previous_atom_symbols_list = atom_symbols_list
2567- continue
2568- assert atom_symbols_list == previous_atom_symbols_list
2569- previous_atom_symbols_list = atom_symbols_list
2570-
25712478 def test_to_group (self ):
25722479 """
25732480 Test if we can convert a Molecule object into a Group object.
0 commit comments