Skip to content

Commit

Permalink
chore: run lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Sep 5, 2024
1 parent c4f5ac2 commit 1515fff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/py/mat3ra/made/tools/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,17 @@ def get_optimal_displacements(
return displacements_with_min_norm


def calculate_moire_periodicity(lattice_a: float, lattice_b: float, twist_angle: float) -> tuple[float, float]:
def calculate_moire_periodicity(lattice_a: float, lattice_b: float, twist_angle: float) -> Tuple[float, float]:
"""
Calculate the periodicity of the Moiré pattern considering X and Y independently.
Args:
lattice_a (float): Lattice constant of the first material.
lattice_b (float): Lattice constant of the second material.
twist_angle (float): Twist angle between the two materials.
Returns:
Tuple[float, float]: Periodicity of the Moiré pattern in X and Y directions in Angstroms.
"""
theta = np.deg2rad(twist_angle)

Expand Down
7 changes: 3 additions & 4 deletions src/py/mat3ra/made/tools/build/interface/builders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List, Optional, Tuple
from typing import Any, List, Optional

import numpy as np
from mat3ra.made.tools.build.supercell import create_supercell
Expand All @@ -7,7 +7,6 @@
translate_to_z_level,
rotate_material,
translate_by_vector,
filter_by_box,
filter_by_triangle_projection,
)
from pydantic import BaseModel, Field
Expand Down Expand Up @@ -270,8 +269,8 @@ def _update_material_name(self, material: Material, configuration: TwistedInterf
substrate_formula = get_chemical_formula(configuration.substrate_configuration.bulk)
film_miller = "".join(map(str, configuration.film_configuration.miller_indices))
substrate_miller = "".join(map(str, configuration.substrate_configuration.miller_indices))

new_name = f"{film_formula}({film_miller})-{substrate_formula}({substrate_miller}), Twist {configuration.twist_angle:.2f}°"
twist_str = f"Twist {configuration.twist_angle:.2f} degrees"
new_name = f"{film_formula}({film_miller})-{substrate_formula}({substrate_miller}), {twist_str}"
if "mean_abs_strain" in material.metadata:
strain = material.metadata["mean_abs_strain"]
new_name += f", Strain {strain*100:.3f}%"
Expand Down
1 change: 1 addition & 0 deletions src/py/mat3ra/made/tools/modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ def rotate_material(material: Material, axis: List[int], angle: float, wrap: boo
material (Material): The material to rotate.
axis (List[int]): The axis to rotate around, expressed as [x, y, z].
angle (float): The angle of rotation in degrees.
wrap (bool): Whether to wrap the material to the unit cell.
Returns:
Atoms: The rotated material.
"""
Expand Down

0 comments on commit 1515fff

Please sign in to comment.