Skip to content

Commit

Permalink
added helper functions, improved documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jwtoney committed Dec 11, 2024
1 parent 703a06b commit a44f4ce
Showing 1 changed file with 41 additions and 54 deletions.
95 changes: 41 additions & 54 deletions molSimplify/Classes/mol3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -6320,7 +6320,6 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
max_allowed_dev=max_allowed_dev,
details=True)
symmetry = symmetry_dict['symmetry']

num_unique_ligands = detailed_dict['num_unique_ligands']
unique_ligand_ratios = detailed_dict['unique_ligand_ratios']
metal_idx = detailed_dict['metal_idx']
Expand All @@ -6333,12 +6332,10 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal

if num_unique_ligands == 1:
raise ValueError('Function not defined for homoleptic complexes')

# two unique ligands: consider cis/trans and fac/mer conversions
elif num_unique_ligands == 2:
if unique_ligand_ratios == 5:
raise ValueError('Function not defined for monoheteroleptic complexes')

Check warning on line 6338 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6338

Added line #L6338 was not covered by tests

# cis/trans conversion
elif unique_ligand_ratios == 2:
# idx of ligand type 1 to be swapped
Expand All @@ -6348,10 +6345,8 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.getAngle(idx0=lig1_catoms[1], idx1=metal_idx, idx2=lig2_catoms[1]),
tmc_mol.getAngle(idx0=lig1_catoms[2], idx1=metal_idx, idx2=lig2_catoms[1]),
tmc_mol.getAngle(idx0=lig1_catoms[3], idx1=metal_idx, idx2=lig2_catoms[1]))) - 180))
# idx of ligand type 2 to be swapped
# swapping any ligand2 is valid as long as ligand1 is chosen to be orthogonal to it
# idx of ligand type 2 to be swapped (any ligand2 is valid as long as ligand1 is orthogonal)
swap_idx_2 = 0

# fac/mer conversion

Check warning on line 6350 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6341-L6350

Added lines #L6341 - L6350 were not covered by tests
elif unique_ligand_ratios == 1:
if symmetry == 'mer':
Expand All @@ -6369,8 +6364,7 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
np.abs(np.array((tmc_mol.getAngle(idx0=lig1_catoms[0], idx1=metal_idx, idx2=lig2_catoms[0]),
tmc_mol.getAngle(idx0=lig1_catoms[1], idx1=metal_idx, idx2=lig2_catoms[0]),
tmc_mol.getAngle(idx0=lig1_catoms[2], idx1=metal_idx, idx2=lig2_catoms[0]))) - 90))
# idx of ligand type 2 to be swapped
# swapping any ligand2 is valid as long as ligand1 is chosen to be orthogonal to it
# idx of ligand type 2 to be swapped (ligand2 is valid as long as ligand1 is orthogonal)
swap_idx_2 = 0

Check warning on line 6368 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6368

Added line #L6368 was not covered by tests
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords())
Expand All @@ -6379,7 +6373,6 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),

Check warning on line 6373 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6373

Added line #L6373 was not covered by tests
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,
atoms_to_move=atoms_to_move)

# three unique ligands: consider cis asymmetric (CA)/trans asymmetric (TA),
# double cis symmetric (DCS)/ double trans symmetric (DTS)/equatorial asymmetric (EA),

Check warning on line 6377 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6377

Added line #L6377 was not covered by tests
# and fac asymmetric (FA)/mer asymmetric trans (MAT)/mer asymmetric cis (MAC) conversions
Expand All @@ -6401,24 +6394,23 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,
atoms_to_move=atoms_to_move)

# DCS/DTS/EA conversion
elif unique_ligand_ratios == [1, 1, 1]:

Check warning on line 6398 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6398

Added line #L6398 was not covered by tests
# warning: moves L3 to axial position by default, using ligand sorting order from get_symmetry()
if target_symmetry not in ['DCS', 'DTS', 'EA']:

Check warning on line 6400 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6400

Added line #L6400 was not covered by tests
raise ValueError("target_symmetry must be either 'DCS', 'DTS', or 'EA' for TMCs with 3 unique ligands in given stoichiometry")
# DTS to EA
elif target_symmetry == 'EA' and symmetry == 'double trans symmetric':

Check warning on line 6403 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6403

Added line #L6403 was not covered by tests
# idx of ligand type 1 to be swapped
# idx of ligand types 1 and 2 to be swapped
swap_idx_1 = 0
# idx of ligand type 2 to be swapped
swap_idx_2 = 0
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords())
atoms_to_move = lig1_atoms[swap_idx_1] + lig2_atoms[swap_idx_2]
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,
atoms_to_move=atoms_to_move)

# DCS to EA

Check warning on line 6413 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6409-L6413

Added lines #L6409 - L6413 were not covered by tests
elif target_symmetry == 'EA' and symmetry == 'double cis symmetric':
# warning: moves L3 to axial position by default, using ligand sorting order from get_symmetry()
# idx of ligand type 2 to be swapped (that which forms 90° angles with both ligands of type 1)
Expand All @@ -6443,14 +6435,14 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,

Check warning on line 6436 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6436

Added line #L6436 was not covered by tests
atoms_to_move=atoms_to_move)

# EA to DTS
elif target_symmetry == 'DTS' and symmetry == 'equatorial asymmetric':
# figure out which ligands are axial
axial_idx = np.argmin(np.abs(np.array((
tmc_mol.getAngle(idx0=lig1_catoms[0], idx1=metal_idx, idx2=lig1_catoms[1]),
tmc_mol.getAngle(idx0=lig2_catoms[0], idx1=metal_idx, idx2=lig2_catoms[1]),
tmc_mol.getAngle(idx0=lig3_catoms[0], idx1=metal_idx, idx2=lig3_catoms[1]))) - 180))

Check warning on line 6444 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6444

Added line #L6444 was not covered by tests
# figure out which ligands are not axial
# figure out which ligands are not axial (i.e., equatorial)
equatorial_idx = [val for val in range(3) if val != axial_idx]
all_ligand_catoms = [lig1_catoms, lig2_catoms, lig3_catoms]
all_ligand_atoms = [lig1_atoms, lig2_atoms, lig3_atoms]
Expand All @@ -6469,7 +6461,7 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,
atoms_to_move=atoms_to_move)

# DCS to DTS
elif target_symmetry == 'DTS' and symmetry == 'double cis symmetric':
# idx of ligand type 1 to be swapped (that which forms 90° angles with both ligands of type 3)
swap_idx_1 = np.argmin(np.array((

Check warning on line 6467 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6465-L6467

Added lines #L6465 - L6467 were not covered by tests
Expand Down Expand Up @@ -6509,14 +6501,12 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,

Check warning on line 6502 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6502

Added line #L6502 was not covered by tests
atoms_to_move=atoms_to_move)

# DTS to DCS
elif target_symmetry == 'DCS' and symmetry == 'double trans symmetric':
# these operations can result in unique chiral structures
# idx of ligand type 1 to be swapped
# idx of ligand types 1, 2, and 3 to be swapped
swap_idx_1 = 0
# idx of ligand type 2 to be swapped
swap_idx_2 = 0
# idx of ligand type 3 to be swapped
swap_idx_3 = 0
# first reflection
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
Expand All @@ -6525,36 +6515,22 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,
atoms_to_move=atoms_to_move)
# vec_reflect_a = vec1 / np.linalg.norm(vec1, 2) + vec2 / np.linalg.norm(vec2, 2)
# vec_reflect_a = vec_reflect_a / np.linalg.norm(vec_reflect_a, 2)
# for atom_idx in atoms_to_move_a:
# vec_atoms = np.array(tmc_mol.atoms[atom_idx].coords()) - np.array(tmc_mol.atoms[metal_idx].coords())
# vec_proj = np.dot(vec_atoms, vec_reflect_a) * vec_reflect_a
# reflected_coords = np.array(tmc_mol.atoms[metal_idx].coords()) + 2 * vec_proj - vec_atoms
# tmc_mol.atoms[atom_idx].setcoords(reflected_coords)
# second reflection
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig3_catoms[swap_idx_3]].coords())

Check warning on line 6520 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6517-L6520

Added lines #L6517 - L6520 were not covered by tests
atoms_to_move = lig1_atoms[swap_idx_1] + lig3_atoms[swap_idx_3]
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,
atoms_to_move=atoms_to_move)

Check warning on line 6524 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6524

Added line #L6524 was not covered by tests
# vec_reflect_b = vec1 / np.linalg.norm(vec1, 2) + vec3 / np.linalg.norm(vec3, 2)
# vec_reflect_b = vec_reflect_b / np.linalg.norm(vec_reflect_b, 2)
# for atom_idx in atoms_to_move_b:
# vec_atoms = np.array(tmc_mol.atoms[atom_idx].coords()) - np.array(tmc_mol.atoms[metal_idx].coords())
# vec_proj = np.dot(vec_atoms, vec_reflect_b) * vec_reflect_b
# reflected_coords = np.array(tmc_mol.atoms[metal_idx].coords()) + 2 * vec_proj - vec_atoms
# tmc_mol.atoms[atom_idx].setcoords(reflected_coords)

# EA to DCS
elif target_symmetry == 'DCS' and symmetry == 'equatorial asymmetric':
# these operations can result in unique chiral structures
# figure out which ligands are axial
axial_idx = np.argmin(np.abs(np.array((

Check warning on line 6529 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6527-L6529

Added lines #L6527 - L6529 were not covered by tests
tmc_mol.getAngle(idx0=lig1_catoms[0], idx1=metal_idx, idx2=lig1_catoms[1]),
tmc_mol.getAngle(idx0=lig2_catoms[0], idx1=metal_idx, idx2=lig2_catoms[1]),
tmc_mol.getAngle(idx0=lig3_catoms[0], idx1=metal_idx, idx2=lig3_catoms[1]))) - 180))
# figure out which ligands are not axial
# figure out which ligands are not axial (i.e., equatorial)
equatorial_idx = [val for val in range(3) if val != axial_idx]

Check warning on line 6534 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6531-L6534

Added lines #L6531 - L6534 were not covered by tests
all_ligand_catoms = [lig1_catoms, lig2_catoms, lig3_catoms]
all_ligand_atoms = [lig1_atoms, lig2_atoms, lig3_atoms]
Expand All @@ -6564,11 +6540,11 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,

Check warning on line 6541 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6538-L6541

Added lines #L6538 - L6541 were not covered by tests
atoms_to_move=atoms_to_move)

# FA/MAT/MAC conversion
elif unique_ligand_ratios == [3 / 2, 2, 3]:
if target_symmetry not in ['FA', 'MAT', 'MAC']:

Check warning on line 6545 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6545

Added line #L6545 was not covered by tests
raise ValueError("target_symmetry must be either 'FA', 'MAT', or 'MAC' for TMCs with 3 unique ligands in given stoichiometry")
# MAT to FA
elif target_symmetry == 'FA' and symmetry == 'mer asymmetric trans':

Check warning on line 6548 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6548

Added line #L6548 was not covered by tests
# idx of ligand type 1 to be swapped
swap_idx_1 = np.argmax(np.array((
Expand All @@ -6586,7 +6562,7 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords())
atoms_to_move = lig1_atoms[swap_idx_1] + lig2_atoms[swap_idx_2]

# MAC to FA

Check warning on line 6565 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6563-L6565

Added lines #L6563 - L6565 were not covered by tests
elif target_symmetry == 'FA' and symmetry == 'mer asymmetric cis':
# idx of ligand type 1 to be swapped

Check warning on line 6567 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6567

Added line #L6567 was not covered by tests
swap_idx_1 = np.argmax(np.array((
Expand All @@ -6612,7 +6588,7 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords())
atoms_to_move = lig1_atoms[swap_idx_1] + lig2_atoms[swap_idx_2]

# FA to MAT
elif target_symmetry == 'MAT' and symmetry == 'fac asymmetric':
# idx of ligand type 1 to be swapped
swap_idx_1 = np.argmin(np.abs(np.array((
Expand All @@ -6624,7 +6600,7 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords())
atoms_to_move = lig1_atoms[swap_idx_1] + lig2_atoms[swap_idx_2]

# MAC to MAT
elif target_symmetry == 'MAT' and symmetry == 'mer asymmetric cis':
# idx of ligand type 2 to be swapped
swap_idx_2 = np.argmax(np.array(
Expand All @@ -6641,7 +6617,7 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
lig1_catom_coords = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig3_catoms[swap_idx_3]].coords())
atoms_to_move = lig2_atoms[swap_idx_2] + lig3_atoms[swap_idx_3]

# FA to MAC
elif target_symmetry == 'MAC' and symmetry == 'fac asymmetric':

Check warning on line 6621 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6618-L6621

Added lines #L6618 - L6621 were not covered by tests
# these operations can result in unique chiral structures
# idx of ligand type 1 to be swapped

Check warning on line 6623 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6623

Added line #L6623 was not covered by tests
Expand All @@ -6654,30 +6630,41 @@ def flip_symmetry(tmc_mol, verbose=True, max_allowed_dev=30, target_symmetry=Fal
lig1_catom_coords = np.array(tmc_mol.atoms[lig1_catoms[swap_idx_1]].coords())
lig2_catom_coords = np.array(tmc_mol.atoms[lig3_catoms[swap_idx_3]].coords())
atoms_to_move = lig1_atoms[swap_idx_1] + lig3_atoms[swap_idx_3]

# MAT to MAC
elif target_symmetry == 'MAC' and symmetry == 'mer asymmetric trans':
# idx of ligand type 2 to be swapped
# idx of ligand types 2 and 3 to be swapped
swap_idx_2 = 0
# idx of ligand type 3 to be swapped
swap_idx_3 = 0
# vec1 = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords()) - np.array(tmc_mol.atoms[metal_idx].coords())
# vec2 = np.array(tmc_mol.atoms[lig3_catoms[swap_idx_3]].coords()) - np.array(tmc_mol.atoms[metal_idx].coords())
lig1_catom_coords = np.array(tmc_mol.atoms[lig2_catoms[swap_idx_2]].coords())

Check warning on line 6638 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6635-L6638

Added lines #L6635 - L6638 were not covered by tests
lig2_catom_coords = np.array(tmc_mol.atoms[lig3_catoms[swap_idx_3]].coords())
atoms_to_move = lig2_atoms[swap_idx_2] + lig3_atoms[swap_idx_3]

Check warning on line 6640 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6640

Added line #L6640 was not covered by tests
tmc_mol.reflect_coords(metal_coords=np.array(tmc_mol.atoms[metal_idx].coords()),
lig1_catom_coords=lig1_catom_coords, lig2_catom_coords=lig2_catom_coords,
atoms_to_move=atoms_to_move)

Check warning on line 6643 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6643

Added line #L6643 was not covered by tests

# vec_reflect = vec1 / np.linalg.norm(vec1, 2) + vec2 / np.linalg.norm(vec2, 2)
# vec_reflect = vec_reflect / np.linalg.norm(vec_reflect, 2)
# for atom_idx in atoms_to_move:
# vec_atoms = np.array(tmc_mol.atoms[atom_idx].coords()) - np.array(tmc_mol.atoms[metal_idx].coords())
# vec_proj = np.dot(vec_atoms, vec_reflect) * vec_reflect
# reflected_coords = np.array(tmc_mol.atoms[metal_idx].coords()) + 2 * vec_proj - vec_atoms
# tmc_mol.atoms[atom_idx].setcoords(reflected_coords)
return tmc_mol
def reflect_coords(tmc_mol, metal_coords, lig1_catom_coords, lig2_catom_coords, atoms_to_move):
"""
Helper function for flip symmetry to calculate vectors, projections, and update coordinates
Parameters
----------
tmc_mol: mol3D

Check warning on line 6651 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6648-L6651

Added lines #L6648 - L6651 were not covered by tests
mol3D instance of TMC
metal_coords: np.array

Check warning on line 6653 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6653

Added line #L6653 was not covered by tests
Coordinates of metal in TMC
lig1_catom_coords: np.array
Coordinates of coordinating atom of first ligand to be flipped
lig2_catom_coords: np.array
Coordinates of coordinating atom of second ligand to be flipped
atoms_to_move: list
List of atom indices to be moved

Check warning on line 6660 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6655-L6660

Added lines #L6655 - L6660 were not covered by tests
Returns
-------

Check warning on line 6663 in molSimplify/Classes/mol3D.py

View check run for this annotation

Codecov / codecov/patch

molSimplify/Classes/mol3D.py#L6663

Added line #L6663 was not covered by tests
tmc_mol: mol3D

Check notice

Code scanning / CodeQL

First parameter of a method is not named 'self' Note

Normal methods should have 'self', rather than 'tmc_mol', as their first parameter.
returns self, a mol3D object with flipped symmetry
"""

# define vector from metal to first coordinating atom of first ligand to be swapped
vec1 = lig1_catom_coords - metal_coords
# define vector from metal to first coordinating atom of second ligand to be swapped
Expand Down

0 comments on commit a44f4ce

Please sign in to comment.