Skip to content

Commit

Permalink
Remove common types from tidy3d module
Browse files Browse the repository at this point in the history
  • Loading branch information
yaugenst committed Oct 13, 2023
1 parent 127ef41 commit 8454cf1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion gplugins/tidy3d/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from gplugins.common.base_models.component import LayeredComponentBase

from .custom_types import Tidy3DMedium
from .types import Tidy3DMedium
from .util import sort_layers


Expand Down
11 changes: 0 additions & 11 deletions gplugins/tidy3d/custom_types.py → gplugins/tidy3d/types.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from typing import Annotated, Any

import tidy3d as td
from gdsfactory import Component
from pydantic.functional_serializers import PlainSerializer
from pydantic.functional_validators import AfterValidator
from shapely import GeometryCollection, MultiPolygon, Polygon


def validate_medium(v):
Expand All @@ -19,12 +17,3 @@ def validate_medium(v):
AfterValidator(validate_medium),
PlainSerializer(lambda x: dict(x), when_used="json"),
]

AnyShapelyPolygon = Annotated[
GeometryCollection | MultiPolygon | Polygon,
PlainSerializer(lambda x: x.wkb_hex, when_used="json"),
]

GFComponent = Annotated[
Component, PlainSerializer(lambda x: x.to_dict(), when_used="json")
]

0 comments on commit 8454cf1

Please sign in to comment.