Skip to content

Commit

Permalink
update: add default termination for slab builder
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Sep 26, 2024
1 parent 7e3f4f5 commit 8c18184
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/py/mat3ra/made/tools/build/slab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import List, Optional

from mat3ra.made.material import Material
from .builders import SlabBuilder, SlabSelectorParameters
Expand All @@ -10,6 +10,7 @@ def get_terminations(configuration: SlabConfiguration) -> List[Termination]:
return SlabBuilder().get_terminations(configuration)


def create_slab(configuration: SlabConfiguration, termination: Termination) -> Material:
def create_slab(configuration: SlabConfiguration, termination: Optional[Termination] = None) -> Material:
builder = SlabBuilder()
termination = termination or builder.get_terminations(configuration)[0]
return builder.get_material(configuration, selector_parameters=SlabSelectorParameters(termination=termination))

0 comments on commit 8c18184

Please sign in to comment.