Skip to content

Commit

Permalink
update: fix defect pair build if no build present
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Nov 19, 2024
1 parent 35b9f31 commit daa7765
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/py/mat3ra/made/tools/build/defect/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ def create_defect_pair(
"""
primary_material = self.create_isolated_defect(primary_defect_configuration)
# Remove metadata to allow for independent defect creation
primary_material.metadata["build"] = primary_defect_configuration.crystal.metadata["build"]
if hasattr(primary_defect_configuration.crystal.metadata, "build"):
primary_material.metadata["build"] = primary_defect_configuration.crystal.metadata["build"]
primary_material.name = primary_defect_configuration.crystal.name
secondary_defect_configuration.crystal = primary_material
secondary_material = self.create_isolated_defect(secondary_defect_configuration)
Expand Down

0 comments on commit daa7765

Please sign in to comment.