Skip to content

Commit

Permalink
chore: types and cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Sep 21, 2024
1 parent e3e7967 commit 4ee4e53
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/py/mat3ra/made/tools/build/interface/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,16 @@ class CommensurateLatticeInterfaceBuilderParameters(BaseModel):


class CommensurateLatticeInterfaceBuilder(BaseBuilder):
_GeneratedItemType = CommensurateLatticePair
_ConfigurationType = TwistedInterfaceConfiguration
_GeneratedItemType: type(CommensurateLatticePair) = CommensurateLatticePair # type: ignore
_ConfigurationType: type(TwistedInterfaceConfiguration) = TwistedInterfaceConfiguration # type: ignore

def _generate(self, configuration: _ConfigurationType) -> List[_GeneratedItemType]:
film = configuration.film
substrate = configuration.substrate
# substrate = configuration.substrate
max_search = self.build_parameters.max_search
a1 = film.lattice.vector_arrays[0][:2]
a2 = film.lattice.vector_arrays[1][:2]
commensurate_lattices = self.__generate_commensurate_lattices(a1, a2, max_search, configuration.twist_angle)
a = film.lattice.vector_arrays[0][:2]
b = film.lattice.vector_arrays[1][:2]
commensurate_lattices = self.__generate_commensurate_lattices(a, b, max_search, configuration.twist_angle)
commensurate_lattice_pairs = [
CommensurateLatticePair(configuration=configuration, **lattice) for lattice in commensurate_lattices
]
Expand Down Expand Up @@ -393,9 +393,7 @@ def __generate_commensurate_lattices(
/ (np.linalg.norm(product2[0]) * np.linalg.norm(product2[1]))
)
if np.isclose(angle1, angle2, atol=0.01):
print(
f"Found commensurate lattice with angle {angle} and size metric {size_metric} !!!!!!!"
)
print(f"Found commensurate lattice with angle {angle} and size metric {size_metric}")
solutions.append(
{"matrix1": matrix1, "matrix2": matrix2, "angle": angle, "size_metric": size_metric}
)
Expand All @@ -406,7 +404,9 @@ def __generate_commensurate_lattices(
return solutions

def _post_process(
self, items: List[_GeneratedItemType], post_process_parameters: Optional[_PostProcessParametersType]
self,
items: List[_GeneratedItemType],
post_process_parameters: Optional[BaseBuilder._PostProcessParametersType] = None,
) -> List[Material]:
interfaces = []
for item in items:
Expand Down

0 comments on commit 4ee4e53

Please sign in to comment.