Skip to content

Commit

Permalink
update: position -> coordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Oct 15, 2024
1 parent fb3742e commit dd90c00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/py/mat3ra/made/tools/build/defect/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def from_site_id(
return cls(crystal=crystal, defect_type=defect_type, coordinate=coordinate, chemical_element=chemical_element)

@classmethod
def from_approximate_position(
def from_approximate_coordinate(
cls,
crystal: Material,
defect_type: PointDefectTypeEnum,
Expand All @@ -81,7 +81,7 @@ def from_dict(cls, crystal: Material, data: dict):
elif "coordinate" in data:
config = PointDefectConfiguration(crystal=crystal, **data)
elif "approximate_coordinate" in data:
config = PointDefectConfiguration.from_approximate_position(crystal=crystal, **data)
config = PointDefectConfiguration.from_approximate_coordinate(crystal=crystal, **data)
else:
raise ValueError(f"Invalid defect configuration: {data}")
return config
Expand Down
2 changes: 1 addition & 1 deletion tests/py/unit/test_tools_build_defect.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_create_terrace():


def test_create_defect_pair():
defect1_config = PointDefectConfiguration.from_approximate_position(
defect1_config = PointDefectConfiguration.from_approximate_coordinate(
crystal=SLAB_001,
defect_type=PointDefectTypeEnum.VACANCY,
approximate_coordinate=[0.5, 0.5, 0.25],
Expand Down

0 comments on commit dd90c00

Please sign in to comment.