Skip to article frontmatterSkip to article content

gdsfactory.technology.LayerView

class gdsfactory.technology.LayerView(gds_layer: int | None = None, gds_datatype: int | None = None, color: ColorType | None = None, brightness: int | None = None, *, name: str | None = None, info: str | None = None, layer: tuple[int, int] | None = None, layer_in_name: bool = False, frame_color: ~pydantic_extra_types.color.Color | None = None, fill_color: ~pydantic_extra_types.color.Color | None = None, frame_brightness: int = 0, fill_brightness: int = 0, hatch_pattern: str | ~gdsfactory.technology.layer_views.HatchPattern | None = None, line_style: str | ~gdsfactory.technology.layer_views.LineStyle | None = None, valid: bool = True, visible: bool = True, transparent: bool = False, width: int | None = None, marked: bool = False, xfill: bool = False, animation: int = 0, group_members: dict[str, ~gdsfactory.technology.layer_views.LayerView] = <factory>)

KLayout layer properties.

Docstrings adapted from KLayout documentation: https://www.klayout.de/lyp_format.html

name

Layer name.

Type

str | None

info

Extra info to include in the LayerView.

Type

str | None

layer

GDSII layer.

Type

tuple[int, int] | None

layer_in_name

Whether to display the name as ‘name layer/datatype’ rather than just the layer.

Type

bool

width

This is the line width of the frame in pixels (or empty for the default which is 1).

Type

int | None

line_style

This is the number of the line style used to draw the shape boundaries. An empty string is “solid line”. The values are “Ix” for one of the built-in styles where “I0” is “solid”, “I1” is “dotted” etc.

Type

str | gdsfactory.technology.layer_views.LineStyle | None

hatch_pattern

This is the number of the dither pattern used to fill the shapes. The values are “Ix” for one of the built-in pattern where “I0” is “solid” and “I1” is “clear”.

Type

str | gdsfactory.technology.layer_views.HatchPattern | None

fill_color

Display color of the layer fill.

Type

pydantic_extra_types.color.Color | None

frame_color

Display color of the layer frame. Accepts Pydantic Color types. See: https://docs.pydantic.dev/usage/types/#color-type for more info.

Type

pydantic_extra_types.color.Color | None

fill_brightness

Brightness of the fill.

Type

int

frame_brightness

Brightness of the frame.

Type

int

animation

This is a value indicating the animation mode. 0 is “none”, 1 is “scrolling”, 2 is “blinking” and 3 is “inverse blinking”. (Only applies to KLayout layer properties)

Type

int

xfill

Whether boxes are drawn with a diagonal cross. (Only applies to KLayout layer properties)

Type

bool

marked

Whether the entry is marked (drawn with small crosses). (Only applies to KLayout layer properties)

Type

bool

transparent

Whether the entry is transparent.

Type

bool

visible

Whether the entry is visible.

Type

bool

valid

Whether the entry is valid. Invalid layers are drawn but you can’t select shapes on those layers. (Only applies to KLayout layer properties)

Type

bool

group_members

Add a list of group members to the LayerView.

Type

dict[str, gdsfactory.technology.layer_views.LayerView]

__init__(gds_layer: int | None = None, gds_datatype: int | None = None, color: tuple[int, int, int] | tuple[int, int, int, float] | str | None = None, brightness: int | None = None, **data: Any)None

Initialize LayerView object.

Methods

__init__([gds_layer, gds_datatype, color, ...])

Initialize LayerView object.

construct([_fields_set])

copy(*[, include, exclude, update, deep])

Returns a copy of the model.

dict(*[, include, exclude, by_alias, ...])

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

from_orm(obj)

from_xml_element(element, layer_pattern)

Read properties from .lyp XML and generate LayerViews from them.

get_alpha()

get_color_dict()

json(*[, include, exclude, by_alias, ...])

model_construct([_fields_set])

Creates a new instance of the Model class with validated data.

model_copy(*[, update, deep])

!!! abstract "Usage Documentation"

model_dump(*[, mode, include, exclude, ...])

!!! abstract "Usage Documentation"

model_dump_json(*[, indent, include, ...])

!!! abstract "Usage Documentation"

model_json_schema([by_alias, ref_template, ...])

Generates a JSON schema for a model class.

model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

model_post_init(context, /)

Override this method to perform additional initialization after __init__ and model_construct.

model_rebuild(*[, force, raise_errors, ...])

Try to rebuild the pydantic-core schema for the model.

model_validate(obj, *[, strict, ...])

Validate a pydantic model instance.

model_validate_json(json_data, *[, strict, ...])

!!! abstract "Usage Documentation"

model_validate_strings(obj, *[, strict, ...])

Validate the given object with string data against the Pydantic model.

parse_file(path, *[, content_type, ...])

parse_obj(obj)

parse_raw(b, *[, content_type, encoding, ...])

schema([by_alias, ref_template])

schema_json(*[, by_alias, ref_template])

to_klayout_xml(custom_hatch_patterns, ...)

Return an XML representation of the LayerView.

update_forward_refs(**localns)

validate(value)

Attributes

model_computed_fields

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

name

info

layer

layer_in_name

frame_color

fill_color

frame_brightness

fill_brightness

hatch_pattern

line_style

valid

visible

transparent

width

marked

xfill

animation

group_members