Skip to content

Commit

Permalink
Reverted behavior of get_fcs back to default. Added in a keyword argu…
Browse files Browse the repository at this point in the history
…ment to allow for higher than 6-coordinated structures.
  • Loading branch information
aarongarrison committed Apr 16, 2024
1 parent 5f49ace commit 46abd16
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions molSimplify/Classes/mol3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -4918,7 +4918,7 @@ def Structure_inspection(self, init_mol=None, catoms_arr=None, num_coord=5, dict
num_coord=num_coord, debug=debug)
return flag_oct, flag_list, dict_oct_info, flag_oct_loose, flag_list_loose

def get_fcs(self, strict_cutoff=False, catom_list=None):
def get_fcs(self, strict_cutoff=False, catom_list=None, max6=True):
"""
Get first coordination shell of a transition metal complex.
Expand All @@ -4928,6 +4928,8 @@ def get_fcs(self, strict_cutoff=False, catom_list=None):
strict bonding cutoff for fullerene and SACs
catom_list : list, optional
List of indices of coordinating atoms.
max6 : bool, optional
If True, will return catoms from oct_comp.
Returns
-------
Expand All @@ -4938,8 +4940,8 @@ def get_fcs(self, strict_cutoff=False, catom_list=None):
self.get_num_coord_metal(debug=False, strict_cutoff=strict_cutoff, catom_list=catom_list)
catoms = self.catoms
# print(catoms, [self.getAtom(x).symbol() for x in catoms])
# if len(catoms) > 6:
# _, catoms = self.oct_comp(debug=False)
if max6 and len(catoms) > 6:
_, catoms = self.oct_comp(debug=False)
fcs = [metalind] + catoms
return fcs

Expand Down Expand Up @@ -5727,7 +5729,7 @@ def get_geometry_type_distance(self, max_dev=1e6, close_dev=1e-2,
raise ValueError('Multimetal complexes are not yet handled.')
elif len(first_shell.findMetal(transition_metals_only=transition_metals_only)) == 1:
#Use oct=False to ensure coordination number based on radius cutoffs only
num_coord = len(first_shell.getBondedAtomsSmart(first_shell.findMetal(transition_metals_only=transition_metals_only)[0]), oct=False)
num_coord = len(first_shell.getBondedAtomsSmart(first_shell.findMetal(transition_metals_only=transition_metals_only)[0], oct=False))
else:
raise ValueError('No metal centers exist in this complex.')
if catoms_arr is not None and len(catoms_arr) != num_coord:
Expand Down Expand Up @@ -5799,7 +5801,7 @@ def dev_from_ideal_geometry(self, ideal_polyhedron):
elif len(metal_idx) != 1:
raise ValueError('Multimetal complexes are not yet handled.')
temp_mol = self.get_first_shell()[0]
fcs_indices = temp_mol.get_fcs()
fcs_indices = temp_mol.get_fcs(max6=False)
# remove metal index from first coordination shell
fcs_indices.remove(temp_mol.findMetal()[0])

Expand Down

0 comments on commit 46abd16

Please sign in to comment.