Skip to content

Commit

Permalink
update: actually pass parameters of passivation
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Dec 11, 2024
1 parent 8cbf95e commit cde2528
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/py/mat3ra/made/tools/analyze/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ def get_unique_coordination_numbers(self, cutoff: float) -> List[int]:

@decorator_handle_periodic_boundary_conditions(cutoff=0.25)
def find_missing_bonds_for_all_sites(
self, bond_templates_list: List[BondDirectionsTemplatesForElement]
self,
bond_templates_list: List[BondDirectionsTemplatesForElement],
max_bonds_to_add: int = 1,
angle_tolerance: float = 0.1,
) -> List[BondDirections]:
"""
Find missing bonds for all sites in the material.
Expand All @@ -209,8 +212,8 @@ def find_missing_bonds_for_all_sites(
continue
missing_bonds_for_site = existing_bond_directions.find_missing_directions(
bond_templates=bond_templates,
angle_tolerance=0.1,
max_bonds_to_add=1,
angle_tolerance=angle_tolerance,
max_bonds_to_add=max_bonds_to_add,
)
missing_bonds.append(BondDirections(missing_bonds_for_site))

Expand Down
6 changes: 5 additions & 1 deletion src/py/mat3ra/made/tools/build/passivation/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ def create_passivated_material(self, configuration: PassivationConfiguration) ->
)
# TODO: bonds_templates will be passed from the configuration in the "controlled" version of this class
bonds_templates = material_with_crystal_sites.find_unique_bond_directions()
reconstructed_bonds = material_with_crystal_sites.find_missing_bonds_for_all_sites(bonds_templates)
reconstructed_bonds = material_with_crystal_sites.find_missing_bonds_for_all_sites(
bond_templates_list=bonds_templates,
max_bonds_to_add=self.build_parameters.bonds_to_passivate,
angle_tolerance=self.build_parameters.symmetry_tolerance,
)
passivant_coordinates_values = self._get_passivant_coordinates(
material,
configuration,
Expand Down

0 comments on commit cde2528

Please sign in to comment.