-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from Exabyte-io/feature/SOF-7397
feature/SOF 7397
- Loading branch information
Showing
20 changed files
with
618 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from typing import Union, Optional | ||
|
||
from mat3ra.made.material import Material | ||
from .builders import ( | ||
SlabPerturbationBuilder, | ||
DistancePreservingSlabPerturbationBuilder, | ||
CellMatchingDistancePreservingSlabPerturbationBuilder, | ||
) | ||
from .configuration import PerturbationConfiguration | ||
|
||
|
||
def create_perturbation( | ||
configuration: PerturbationConfiguration, | ||
preserve_distance: Optional[bool] = False, | ||
builder: Union[ | ||
SlabPerturbationBuilder, | ||
DistancePreservingSlabPerturbationBuilder, | ||
CellMatchingDistancePreservingSlabPerturbationBuilder, | ||
None, | ||
] = None, | ||
) -> Material: | ||
""" | ||
Return a material with a perturbation applied. | ||
Args: | ||
configuration: The configuration of the perturbation to be applied. | ||
preserve_distance: If True, the builder that preserves the distance between atoms is used. | ||
builder: The builder to be used to create the perturbation. | ||
Returns: | ||
The material with the perturbation applied. | ||
""" | ||
if builder is None: | ||
builder = SlabPerturbationBuilder() | ||
if preserve_distance: | ||
builder = CellMatchingDistancePreservingSlabPerturbationBuilder() | ||
return builder.get_material(configuration) |
Oops, something went wrong.