diff --git a/src/py/mat3ra/made/tools/analyze.py b/src/py/mat3ra/made/tools/analyze.py index ef78bd26..6b9ff0d0 100644 --- a/src/py/mat3ra/made/tools/analyze.py +++ b/src/py/mat3ra/made/tools/analyze.py @@ -4,7 +4,7 @@ from scipy.spatial import cKDTree from ..material import Material -from .build.passivation.enums import SurfaceTypes +from .enums import SurfaceTypes from .convert import decorator_convert_material_args_kwargs_to_atoms, to_pymatgen from .third_party import ASEAtoms, PymatgenIStructure, PymatgenVoronoiNN from .utils import decorator_handle_periodic_boundary_conditions diff --git a/src/py/mat3ra/made/tools/build/passivation/__init__.py b/src/py/mat3ra/made/tools/build/passivation/__init__.py index 17be2ab5..b19e061d 100644 --- a/src/py/mat3ra/made/tools/build/passivation/__init__.py +++ b/src/py/mat3ra/made/tools/build/passivation/__init__.py @@ -2,7 +2,7 @@ from mat3ra.made.material import Material from .configuration import PassivationConfiguration -from .builders import PassivationBuilder, SurfacePassivationBuilder, UndercoordinationPassivationBuilder +from .builders import SurfacePassivationBuilder, UndercoordinationPassivationBuilder def create_passivation( diff --git a/src/py/mat3ra/made/tools/build/passivation/builders.py b/src/py/mat3ra/made/tools/build/passivation/builders.py index 576efac8..134f611f 100644 --- a/src/py/mat3ra/made/tools/build/passivation/builders.py +++ b/src/py/mat3ra/made/tools/build/passivation/builders.py @@ -1,10 +1,10 @@ -from typing import List +from typing import List, Optional import numpy as np from mat3ra.made.material import Material from pydantic import BaseModel -from .enums import SurfaceTypes +from ...enums import SurfaceTypes from ...analyze import ( get_surface_atom_indices, get_undercoordinated_atom_indices, @@ -77,7 +77,7 @@ class SurfacePassivationBuilder(PassivationBuilder): Detects surface atoms looking along Z axis and passivates either the top or bottom surface or both. """ - build_parameters: SurfacePassivationBuilderParameters = SurfacePassivationBuilderParameters() + build_parameters: Optional[SurfacePassivationBuilderParameters] = SurfacePassivationBuilderParameters() _ConfigurationType = PassivationConfiguration def create_passivated_material(self, configuration: PassivationConfiguration) -> Material: diff --git a/src/py/mat3ra/made/tools/build/passivation/configuration.py b/src/py/mat3ra/made/tools/build/passivation/configuration.py index 10a73b88..a106f3ec 100644 --- a/src/py/mat3ra/made/tools/build/passivation/configuration.py +++ b/src/py/mat3ra/made/tools/build/passivation/configuration.py @@ -1,6 +1,6 @@ from mat3ra.made.material import Material -from .enums import SurfaceTypes +from ...enums import SurfaceTypes from ...build import BaseConfiguration diff --git a/src/py/mat3ra/made/tools/build/passivation/enums.py b/src/py/mat3ra/made/tools/build/passivation/enums.py index dba18bb4..feea29ef 100644 --- a/src/py/mat3ra/made/tools/build/passivation/enums.py +++ b/src/py/mat3ra/made/tools/build/passivation/enums.py @@ -1,14 +1,7 @@ # TODO: Get this from periodic table -from enum import Enum BOND_LENGTHS_MAP = { ("C", "H"): 1.09, ("Ni", "H"): 1.09, ("Si", "H"): 1.48, } - - -class SurfaceTypes(str, Enum): - TOP = "top" - BOTTOM = "bottom" - BOTH = "both" diff --git a/src/py/mat3ra/made/tools/enums.py b/src/py/mat3ra/made/tools/enums.py new file mode 100644 index 00000000..c525714e --- /dev/null +++ b/src/py/mat3ra/made/tools/enums.py @@ -0,0 +1,7 @@ +from enum import Enum + + +class SurfaceTypes(str, Enum): + TOP = "top" + BOTTOM = "bottom" + BOTH = "both"