Skip to content
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

add schema version for YAML #2050

Merged
merged 1 commit into from Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions gdsfactory/picmodel.py
Expand Up @@ -8,6 +8,8 @@

import gdsfactory as gf

SCHEMA_VERSION = 1


class CrossSection(RootModel):
root: str = Field(
Expand Down Expand Up @@ -96,6 +98,9 @@ class Route(BaseModel):


class PicYamlConfiguration(BaseModel):
schema_version: str = Field(
default=SCHEMA_VERSION, description="The version of the YAML syntax used."
)
schema: AnyUrl | None = Field(None, alias="$schema")
instances: dict[str, Instance] | None = None
placements: dict[str, Placement] | None = None
Expand Down Expand Up @@ -133,6 +138,9 @@ def to_yaml(self, filename) -> None:


class SchematicConfiguration(BaseModel):
schema_version: str = Field(
default=SCHEMA_VERSION, description="The version of the YAML syntax used."
)
schema: AnyUrl | None = Field(None, alias="$schema")
instances: dict[str, Instance] | None = None
schematic_placements: dict[str, Placement] | None = None
Expand Down
2 changes: 2 additions & 0 deletions gdsfactory/read/from_yaml.py
Expand Up @@ -90,6 +90,8 @@
"info",
"pdk",
"warnings",
"schema",
"schema_version",
]

valid_anchor_point_keywords = [
Expand Down