Skip to content

Commit

Permalink
update: various cleaups
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Oct 4, 2024
1 parent d46c197 commit 74f58e1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 68 deletions.
1 change: 0 additions & 1 deletion src/py/mat3ra/made/tools/build/defect/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def create_adatom(
def _calculate_coordinate_from_position_and_distance(
self, material: Material, position_on_surface: List[float], distance_z: float
) -> List[float]:
# max_z = get_atomic_coordinates_extremum(material, use_cartesian_coordinates=False)
max_z_id = get_local_extremum_atom_index(
material, position_on_surface, "max", vicinity=3.0, use_cartesian_coordinates=False
)
Expand Down
66 changes: 2 additions & 64 deletions tests/py/unit/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"bulk": SI_CONVENTIONAL_CELL,
"miller_indices": (0, 0, 1),
"thickness": 1,
"vacuum": 1,
"vacuum": 5.0,
"xy_supercell_matrix": [[1, 0], [0, 1]],
"use_conventional_cell": True,
"use_orthogonal_z": True,
Expand Down Expand Up @@ -211,69 +211,7 @@
"_id": "",
"metadata": {
"boundaryConditions": {"type": "pbc", "offset": 0},
"build": {
"termination": "Si_P6/mmm_1",
"configuration": {
"type": "SlabConfiguration",
"bulk": {
"name": "Si8",
"basis": {
"elements": [
{"id": 0, "value": "Si"},
{"id": 1, "value": "Si"},
{"id": 2, "value": "Si"},
{"id": 3, "value": "Si"},
{"id": 4, "value": "Si"},
{"id": 5, "value": "Si"},
{"id": 6, "value": "Si"},
{"id": 7, "value": "Si"},
],
"coordinates": [
{"id": 0, "value": [0.5, 0.0, 0.0]},
{"id": 1, "value": [0.25, 0.25, 0.75]},
{"id": 2, "value": [0.5, 0.5, 0.5]},
{"id": 3, "value": [0.25, 0.75, 0.25]},
{"id": 4, "value": [0.0, 0.0, 0.5]},
{"id": 5, "value": [0.75, 0.25, 0.25]},
{"id": 6, "value": [0.0, 0.5, 0.0]},
{"id": 7, "value": [0.75, 0.75, 0.75]},
],
"units": "crystal",
"cell": [[5.468763846, 0.0, 0.0], [-0.0, 5.468763846, 0.0], [0.0, 0.0, 5.468763846]],
"constraints": [],
"labels": [],
},
"lattice": {
"a": 5.468763846,
"b": 5.468763846,
"c": 5.468763846,
"alpha": 90.0,
"beta": 90.0,
"gamma": 90.0,
"units": {"length": "angstrom", "angle": "degree"},
"type": "TRI",
"vectors": {
"a": [5.468763846, 0.0, 0.0],
"b": [-0.0, 5.468763846, 0.0],
"c": [0.0, 0.0, 5.468763846],
"alat": 1,
"units": "angstrom",
},
},
"isNonPeriodic": False,
"_id": "",
"metadata": {"boundaryConditions": {"type": "pbc", "offset": 0}},
"isUpdated": True,
},
"miller_indices": (0, 0, 1),
"thickness": 1,
"vacuum": 5.0,
"xy_supercell_matrix": [[1, 0], [0, 1]],
"use_conventional_cell": True,
"use_orthogonal_z": True,
"make_primitive": True,
},
},
"build": {"configuration": SI_SLAB_CONFIGURATION, "termination": "Si_P6/mmm_1"},
},
"isUpdated": True,
}
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 @@ -107,7 +107,7 @@ def test_create_crystal_site_adatom():

assert defect.basis.elements.values[-1] == "Si"
assertion_utils.assert_deep_almost_equal(
# TO pass on GHA
# Adjusted expected value to pass tests on GHA due to slab generation differences between GHA and local
[0.083333333, 0.458333333, 0.561569594],
defect.basis.coordinates.values[-1],
)
Expand Down
2 changes: 1 addition & 1 deletion tests/py/unit/test_tools_build_grain_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_slab_grain_boundary_builder():
[0.0, 3.867, 0.0],
[0.0, 0.0, 8.734],
]
# To pass on GHA
# Adjusted expected value to pass tests on GHA due to slab generation differences between GHA and local
expected_coordinate_15 = [0.777190818, 0.0, 0.110688115]

assert len(gb.basis.elements.values) == 32
Expand Down
1 change: 0 additions & 1 deletion tests/py/unit/test_tools_build_slab.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ def test_build_slab():
)
termination = get_terminations(slab_config)[0]
slab = create_slab(slab_config, termination)
print(slab.to_json())
assertion_utils.assert_deep_almost_equal(SI_SLAB, slab.to_json())

0 comments on commit 74f58e1

Please sign in to comment.