-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/SOF 7412 #153
feature/SOF 7412 #153
Conversation
VsevolodX
commented
Aug 10, 2024
- feat: first implementation of a nanrobibon
- update: corrections
- chore: run lint fix
from .configuration import NanoribbonConfiguration | ||
|
||
|
||
def build_nanoribbon(configuration: NanoribbonConfiguration) -> Material: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_nanoribbon
length: int # in number of unit cells | ||
vacuum_width: int = 3 # in number of unit cells | ||
vacuum_length: int = 0 # in number of unit cells | ||
edge_type: Literal["armchair", "zigzag"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has to be enums
nanoribbon = self._update_basis_and_lattice( | ||
nanoribbon, length_lattice_vector, width_lattice_vector, height_lattice_vector | ||
) | ||
cenetered_nanoribbon = center_material(nanoribbon) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - centered
src/py/mat3ra/made/tools/modify.py
Outdated
@@ -87,6 +87,31 @@ def translate_by_vector( | |||
return Material(from_ase(atoms)) | |||
|
|||
|
|||
def center_material(material: Material, axes: Optional[List[str]] = None) -> Material: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translate_to_center
return nanoribbon | ||
|
||
@staticmethod | ||
def _update_basis_and_lattice( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to a generic place - Material, modify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving to Material
edge_type: Literal["armchair", "zigzag"] | ||
|
||
class Config: | ||
arbitrary_types_allowed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to BaseModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseModel is Pydantic's class, we can't adjust it. We don't have BaseConfiguration either, because there's no common properties. We can create a BaseConfig that'll house this Pydantic setup.
vacuum_length = config.vacuum_length | ||
edge_type = config.edge_type | ||
|
||
if edge_type == "armchair": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens to Si slab in this case, when we don't use HEX?