|
6 | 6 |
|
7 | 7 | # Imports
|
8 | 8 | import ase
|
9 |
| -import itertools |
10 | 9 | from ase.io import read
|
11 | 10 | from ase import units
|
12 | 11 | import numpy as np
|
|
20 | 19 | from pynauty import Graph as pnGraph
|
21 | 20 | from pynauty import canon_label
|
22 | 21 |
|
23 |
| -# ob.obErrorLog.SetOutputLevel(0) # Set warnings to only critical. |
24 | 22 | ob.obErrorLog.StopLogging() # Turn off ALL openbabel logging.
|
| 23 | +# ob.obErrorLog.SetOutputLevel(0) # Set warnings to only critical. |
25 | 24 |
|
26 | 25 | warnings.filterwarnings('ignore') # Supress warnings.
|
27 | 26 |
|
@@ -442,27 +441,27 @@ def generate_obmol_conformers(structure, rmsd_cutoff=0.4, conf_cutoff=3000,
|
442 | 441 | _, anums, graph = get_OBMol_coords_anums_graph(obmol, return_coords=False,
|
443 | 442 | get_types=False)
|
444 | 443 | syms = [io_ptable.elements[x] for x in anums]
|
445 |
| - act_inds = [i for i,x in enumerate(syms) if x in io_ptable.actinides] |
446 |
| - swapped=False |
| 444 | + act_inds = [i for i, x in enumerate(syms) if x in io_ptable.actinides] |
| 445 | + swapped = False |
447 | 446 | if len(act_inds) > 0:
|
448 | 447 | an_symbols = [syms[x] for x in act_inds]
|
449 | 448 | ln_symbols = [io_ptable.lanthanides[io_ptable.actinides.index(x)] for x in an_symbols]
|
450 | 449 | j = 0
|
451 | 450 | for i, atom in enumerate(ob.OBMolAtomIter(obmol)):
|
452 | 451 | if i in act_inds:
|
453 | 452 | atom.SetAtomicNum(io_ptable.elements.index(ln_symbols[j]))
|
454 |
| - j+=1 |
455 |
| - swapped=True |
| 453 | + j += 1 |
| 454 | + swapped = True |
456 | 455 | mmff94_ok = check_mmff_okay(obmol)
|
457 | 456 | if mmff94_ok:
|
458 | 457 | FF = ob.OBForceField.FindForceField("MMFF94")
|
459 |
| - FF.Setup(obmol) # Make sure setup works OK |
| 458 | + FF.Setup(obmol) # Make sure setup works OK |
460 | 459 | else:
|
461 | 460 | FF = ob.OBForceField.FindForceField("UFF")
|
462 |
| - FF.Setup(obmol) # Make sure setup works OK |
| 461 | + FF.Setup(obmol) # Make sure setup works OK |
463 | 462 | if fix_m_neighbors:
|
464 |
| - mets = [i for i,x in enumerate(syms) if x in io_ptable.all_metals] |
465 |
| - if len(mets) == 1: # Freeze metal and neighbor positions - relax ligands |
| 463 | + mets = [i for i, x in enumerate(syms) if x in io_ptable.all_metals] |
| 464 | + if len(mets) == 1: # Freeze metal and neighbor positions - relax ligands |
466 | 465 | frozen_atoms = [mets[0]+1] + (np.nonzero(np.ravel(graph[mets[0]]))[0] + 1).tolist()
|
467 | 466 | constr = ob.OBFFConstraints()
|
468 | 467 | for j in frozen_atoms:
|
|
0 commit comments