Skip to content

Commit

Permalink
update: move surface enums to top level to avoid circular deps
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Sep 9, 2024
1 parent 13d8538 commit 60e8b69
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/py/mat3ra/made/tools/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/py/mat3ra/made/tools/build/passivation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions src/py/mat3ra/made/tools/build/passivation/builders.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from mat3ra.made.material import Material

from .enums import SurfaceTypes
from ...enums import SurfaceTypes
from ...build import BaseConfiguration


Expand Down
7 changes: 0 additions & 7 deletions src/py/mat3ra/made/tools/build/passivation/enums.py
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 7 additions & 0 deletions src/py/mat3ra/made/tools/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from enum import Enum


class SurfaceTypes(str, Enum):
TOP = "top"
BOTTOM = "bottom"
BOTH = "both"

0 comments on commit 60e8b69

Please sign in to comment.