gdsfactory.technology.LayerView#
- class gdsfactory.technology.LayerView(gds_layer=None, gds_datatype=None, color=None, brightness=None, *, name=None, info=None, layer=None, layer_in_name=False, frame_color=None, fill_color=None, frame_brightness=0, fill_brightness=0, hatch_pattern=None, line_style=None, valid=True, visible=True, transparent=False, width=None, marked=False, xfill=False, animation=0, group_members=<factory>)[source]#
KLayout layer properties.
Docstrings adapted from KLayout documentation: https://www.klayout.de/lyp_format.html
- Parameters:
gds_layer (int | None)
gds_datatype (int | None)
color (ColorType | None)
brightness (int | None)
name (str | None)
info (str | None)
layer (tuple[int, int] | None)
layer_in_name (bool)
frame_color (Color | None)
fill_color (Color | None)
frame_brightness (int)
fill_brightness (int)
hatch_pattern (str | HatchPattern | None)
line_style (str | LineStyle | None)
valid (bool)
visible (bool)
transparent (bool)
width (int | None)
marked (bool)
xfill (bool)
animation (int)
group_members (dict[str, LayerView])
- name#
Layer name.
- Type:
str | None
- info#
Extra info to include in the LayerView.
- Type:
str | None
- layer#
GDSII layer.
- Type:
Layer | 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 | 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 | HatchPattern | None
- fill_color#
Display color of the layer fill.
- Type:
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:
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
- __init__(gds_layer=None, gds_datatype=None, color=None, brightness=None, **data)[source]#
Initialize LayerView object.
- Parameters:
gds_layer (int | None)
gds_datatype (int | None)
color (tuple[int, int, int] | tuple[int, int, int, float] | str | None)
brightness (int | None)
data (Any)
- Return type:
None
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.