Skip to content

rdbcore

KLayout core module 'rdb'

__all__ module

__all__ = ['__doc__', '__version__', 'RdbReference', 'RdbCell', 'RdbCategory', 'RdbItemValue', 'RdbItem', 'ReportDatabase']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

__doc__ module

__doc__ = "KLayout core module 'rdb'"

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__file__ module

__file__ = '/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/klayout/rdbcore.cpython-311-x86_64-linux-gnu.so'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__name__ module

__name__ = 'klayout.rdbcore'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__package__ module

__package__ = 'klayout'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__version__ module

__version__ = '0.29.8'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

RdbCategory

@brief A category inside the report database Every item in the report database is assigned to a category. A category is a DRC rule check for example. Categories can be organized hierarchically, i.e. a category may have sub-categories. Item counts are summarized for categories and items belonging to sub-categories of one category can be browsed together for example. As a general rule, categories not being leaf categories (having child categories) may not have items.

__doc__ class

__doc__ = '@brief A category inside the report database\nEvery item in the report database is assigned to a category. A category is a DRC rule check for example. Categories can be organized hierarchically, i.e. a category may have sub-categories. Item counts are summarized for categories and items belonging to sub-categories of one category can be browsed together for example. As a general rule, categories not being leaf categories (having child categories) may not have items. '

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__gsi_id__ class

__gsi_id__ = 23

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

__module__ class

__module__ = 'klayout.rdbcore'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__weakref__ class

__weakref__ = <attribute '__weakref__' of 'RdbCategory' objects>

list of weak references to the object

description class

description: str = <attribute 'description' of 'RdbCategory' objects>

@brief Gets the category description @return The description string

@brief Sets the category description @param description The description string

__init__ method descriptor

__init__() -> None

@brief Creates a new object of this class

create method descriptor

create() -> None

@brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

database method descriptor

database() -> ReportDatabase

@brief Gets the database object that category is associated with

This method has been introduced in version 0.23.

destroy method descriptor

destroy() -> None

@brief Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed method descriptor

destroyed() -> bool

@brief Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

each_item method descriptor

each_item() -> Iterator[RdbItem]
each_item() -> Iterator[RdbItem]
each_item()

@brief Iterates over all items inside the database which are associated with this category (non-const version)

This method has been introduced in version 0.29.

each_sub_category method descriptor

each_sub_category() -> Iterator[RdbCategory]
each_sub_category() -> Iterator[RdbCategory]
each_sub_category()

@brief Iterates over all sub-categories (non-const version)

is_const_object method descriptor

is_const_object() -> bool

@brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self.

name method descriptor

name() -> str

@brief Gets the category name The category name is an string that identifies the category in the context of a parent category or inside the database when it is a top level category. The name is not the path name which is a path to a child category and incorporates all names of parent categories. @return The category name

new builtin

new() -> RdbCategory

@brief Creates a new object of this class

num_items method descriptor

num_items() -> int

@brief Gets the number of items in this category The number of items includes the items in sub-categories of this category.

num_items_visited method descriptor

num_items_visited() -> int

@brief Gets the number of visited items in this category The number of items includes the items in sub-categories of this category.

parent method descriptor

parent() -> RdbCategory
parent() -> RdbCategory
parent()

@brief Gets the parent category of this category (non-const version) @return The parent category or nil if this category is a top-level category

path method descriptor

path() -> str

@brief Gets the category path The category path is the category name for top level categories. For child categories, the path contains the names of all parent categories separated by a dot. @return The path for this category

rdb_id method descriptor

rdb_id() -> int

@brief Gets the category ID The category ID is an integer that uniquely identifies the category. It is used for referring to a category in \RdbItem for example. @return The category ID

scan_collection method descriptor

scan_collection(cell: RdbCell, trans: db.CplxTrans, edge_pairs: db.EdgePairs, flat: Optional[bool] = ..., with_properties: Optional[bool] = ...) -> None
scan_collection(cell: RdbCell, trans: db.CplxTrans, edges: db.Edges, flat: Optional[bool] = ..., with_properties: Optional[bool] = ...) -> None
scan_collection(cell: RdbCell, trans: db.CplxTrans, region: db.Region, flat: Optional[bool] = ..., with_properties: Optional[bool] = ...) -> None
scan_collection(cell: RdbCell, trans: db.CplxTrans, texts: db.Texts, flat: Optional[bool] = ..., with_properties: Optional[bool] = ...) -> None
scan_collection()

@brief Turns the given edge pair collection into a hierarchical or flat report database This a another flavour of \scan_collection accepting a text collection.

This method has been introduced in version 0.28.

scan_layer method descriptor

scan_layer() -> None

@brief Scans a layer from a layout into this category, starting with a given cell and a depth specification Creates RDB items for each polygon or edge shape read from the cell and its children in the layout on the given layer and puts them into this category. New cells will be generated when required. "levels" is the number of hierarchy levels to take the child cells from. 0 means to use only "cell" and don't descend, -1 means "all levels". Other settings like database unit, description, top cell etc. are not made in the RDB.

If 'with_properties' is true, user properties will be turned into tagged values as well.

This method has been introduced in version 0.23. The 'with_properties' argument has been added in version 0.28.

scan_shapes method descriptor

scan_shapes() -> None

@brief Scans the polygon or edge shapes from the shape iterator into the category Creates RDB items for each polygon or edge shape read from the iterator and puts them into this category. A similar, but lower-level method is \ReportDatabase#create_items with a \RecursiveShapeIterator argument. In contrast to \ReportDatabase#create_items, 'scan_shapes' can also produce hierarchical databases if the \flat argument is false. In this case, the hierarchy the recursive shape iterator traverses is copied into the report database using sample references.

If 'with_properties' is true, user properties will be turned into tagged values as well.

This method has been introduced in version 0.23. The flat mode argument has been added in version 0.26. The 'with_properties' argument has been added in version 0.28.

RdbCell

@brief A cell inside the report database This class represents a cell in the report database. There is not necessarily a 1:1 correspondence of RDB cells and layout database cells. Cells have an ID, a name, optionally a variant name and a set of references which describe at least one example instantiation in some parent cell. The references do not necessarily map to references or cover all references in the layout database.

__doc__ class

__doc__ = '@brief A cell inside the report database\nThis class represents a cell in the report database. There is not necessarily a 1:1 correspondence of RDB cells and layout database cells. Cells have an ID, a name, optionally a variant name and a set of references which describe at least one example instantiation in some parent cell. The references do not necessarily map to references or cover all references in the layout database.'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__gsi_id__ class

__gsi_id__ = 22

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

__module__ class

__module__ = 'klayout.rdbcore'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__weakref__ class

__weakref__ = <attribute '__weakref__' of 'RdbCell' objects>

list of weak references to the object

__init__ method descriptor

__init__() -> None

@brief Creates a new object of this class

add_reference method descriptor

add_reference() -> None

@brief Adds a reference to the references of this cell @param ref The reference to add.

clear_references method descriptor

clear_references() -> None

@brief Removes all references from this cell

create method descriptor

create() -> None

@brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

database method descriptor

database() -> ReportDatabase
database() -> ReportDatabase
database()

@brief Gets the database object that category is associated with (non-const version)

This method has been introduced in version 0.29.

destroy method descriptor

destroy() -> None

@brief Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed method descriptor

destroyed() -> bool

@brief Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

each_item method descriptor

each_item() -> Iterator[RdbItem]
each_item() -> Iterator[RdbItem]
each_item()

@brief Iterates over all items inside the database which are associated with this cell (non-const version)

This method has been introduced in version 0.29.

each_reference method descriptor

each_reference() -> Iterator[RdbReference]
each_reference() -> Iterator[RdbReference]
each_reference()

@brief Iterates over all references (non-const version)

This method has been introduced in version 0.23.

is_const_object method descriptor

is_const_object() -> bool

@brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self.

layout_name method descriptor

layout_name() -> str

@brief Gets the name of the layout cell For variants, this string is the name of the actual layout cell. If empty, the cell is assume to be called 'name'. @return The layout cell name This read-only attribute has been added in version 0.29.1.

name method descriptor

name() -> str

@brief Gets the cell name The cell name is an string that identifies the category in the database. Additionally, a cell may carry a variant identifier which is a string that uniquely identifies a cell in the context of its variants. The "qualified name" contains both the cell name and the variant name. Cell names are also used to identify report database cells with layout cells. For variants, the layout cell name can be specified explicitly with the \layout_name attribute (see \RdbDatabase#create_cell). The latter is available since version 0.29.1. @return The cell name

new builtin

new() -> RdbCell

@brief Creates a new object of this class

num_items method descriptor

num_items() -> int

@brief Gets the number of items for this cell

num_items_visited method descriptor

num_items_visited() -> int

@brief Gets the number of visited items for this cell

qname method descriptor

qname() -> str

@brief Gets the qualified name of the cell The qualified name is a combination of the cell name and optionally the variant name. It is used to identify the cell by name in a unique way. @return The qualified name

rdb_id method descriptor

rdb_id() -> int

@brief Gets the cell ID The cell ID is an integer that uniquely identifies the cell. It is used for referring to a cell in \RdbItem for example. @return The cell ID

variant method descriptor

variant() -> str

@brief Gets the cell variant name A variant name additionally identifies the cell when multiple cells with the same name are present. A variant name is either assigned automatically or set when creating a cell. @return The cell variant name

RdbItem

@brief An item inside the report database An item is the basic information entity in the RDB. It is associated with a cell and a category. It can be assigned values which encapsulate other objects such as strings and geometrical objects. In addition, items can be assigned an image (i.e. a screenshot image) and tags which are basically boolean flags that can be defined freely.

__doc__ class

__doc__ = '@brief An item inside the report database\nAn item is the basic information entity in the RDB. It is associated with a cell and a category. It can be assigned values which encapsulate other objects such as strings and geometrical objects. In addition, items can be assigned an image (i.e. a screenshot image) and tags which are basically boolean flags that can be defined freely.'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__gsi_id__ class

__gsi_id__ = 25

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

__module__ class

__module__ = 'klayout.rdbcore'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__weakref__ class

__weakref__ = <attribute '__weakref__' of 'RdbItem' objects>

list of weak references to the object

comment class

comment: str = <attribute 'comment' of 'RdbItem' objects>

@brief Gets the common associated with this item as a string @return The comment string The comment string is an arbitrary string added by the user to the item.

This attribute has been added in version 0.29.1.

@brief Sets the common associated with this item as a string See \comment for a description of that attribute.

This attribute has been added in version 0.29.1.

image class

image: None = <attribute 'image' of 'RdbItem' objects>

@brief Sets the attached image from a PixelBuffer object

This method has been added in version 0.28.

image_str class

image_str: str = <attribute 'image_str' of 'RdbItem' objects>

@brief Gets the image associated with this item as a string @return A base64-encoded image file (in PNG format)

@brief Sets the image from a string @param image A base64-encoded image file (preferably in PNG format)

tags_str class

tags_str: str = <attribute 'tags_str' of 'RdbItem' objects>

@brief Returns a string listing all tags of this item @return A comma-separated list of tags

@brief Sets the tags from a string @param tags A comma-separated list of tags

__copy__ method descriptor

__copy__() -> RdbItem

@brief Creates a copy of self

__deepcopy__ method descriptor

__deepcopy__() -> RdbItem

@brief Creates a copy of self

__init__ method descriptor

__init__() -> None

@brief Creates a new object of this class

add_tag method descriptor

add_tag() -> None

@brief Adds a tag with the given id to the item Each tag can be added once to the item. The tags of an item thus form a set. If a tag with that ID already exists, this method does nothing.

add_value method descriptor

add_value(shape: db.Shape, trans: db.CplxTrans) -> None
add_value(value: RdbItemValue) -> None
add_value(value: db.DBox) -> None
add_value(value: db.DEdge) -> None
add_value(value: db.DEdgePair) -> None
add_value(value: db.DPolygon) -> None
add_value(value: float) -> None
add_value(value: str) -> None
add_value()

@brief Adds a geometrical value object from a shape @param value The shape object from which to take the geometrical object. @param trans The transformation to apply.

The transformation can be used to convert database units to micron units.

This method has been introduced in version 0.25.3.

assign method descriptor

assign() -> None

@brief Assigns another object to self

category_id method descriptor

category_id() -> int

@brief Gets the category ID Returns the ID of the category that this item is associated with. @return The category ID

cell_id method descriptor

cell_id() -> int

@brief Gets the cell ID Returns the ID of the cell that this item is associated with. @return The cell ID

clear_values method descriptor

clear_values() -> None

@brief Removes all values from this item

create method descriptor

create() -> None

@brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

database method descriptor

database() -> ReportDatabase

@brief Gets the database object that item is associated with

This method has been introduced in version 0.23.

destroy method descriptor

destroy() -> None

@brief Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed method descriptor

destroyed() -> bool

@brief Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup method descriptor

dup() -> RdbItem

@brief Creates a copy of self

each_value method descriptor

each_value() -> Iterator[RdbItemValue]

@brief Iterates over all values

has_image method descriptor

has_image() -> bool

@brief Gets a value indicating that the item has an image attached See \image_str how to obtain the image.

This method has been introduced in version 0.28.

has_tag method descriptor

has_tag() -> bool

@brief Returns a value indicating whether the item has a tag with the given ID @return True, if the item has a tag with the given ID

image_pixels method descriptor

image_pixels() -> lay.PixelBuffer

@brief Gets the attached image as a PixelBuffer object

This method has been added in version 0.28.

is_const_object method descriptor

is_const_object() -> bool

@brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self.

is_visited method descriptor

is_visited() -> bool

@brief Gets a value indicating whether the item was already visited @return True, if the item has been visited already

new builtin

new() -> RdbItem

@brief Creates a new object of this class

remove_tag method descriptor

remove_tag() -> None

@brief Remove the tag with the given id from the item If a tag with that ID does not exists on this item, this method does nothing.

remove_tags method descriptor

remove_tags() -> None

@brief Removes all tags from the item This method has been introduced in version 0.29.1.

RdbItemValue

@brief A value object inside the report database Value objects are attached to items to provide markers. An arbitrary number of such value objects can be attached to an item. Currently, a value can represent a box, a polygon or an edge. Geometrical objects are represented in micron units and are therefore "D" type objects (DPolygon, DEdge and DBox).

__doc__ class

__doc__ = '@brief A value object inside the report database\nValue objects are attached to items to provide markers. An arbitrary number of such value objects can be attached to an item.\nCurrently, a value can represent a box, a polygon or an edge. Geometrical objects are represented in micron units and are therefore "D" type objects (DPolygon, DEdge and DBox). '

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__gsi_id__ class

__gsi_id__ = 24

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

__module__ class

__module__ = 'klayout.rdbcore'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__weakref__ class

__weakref__ = <attribute '__weakref__' of 'RdbItemValue' objects>

list of weak references to the object

tag_id class

tag_id: int = <attribute 'tag_id' of 'RdbItemValue' objects>

@brief Gets the tag ID if the value is a tagged value or 0 if not @return The tag ID See \tag_id= for details about tagged values.

Tagged values have been added in version 0.24.

@brief Sets the tag ID to make the value a tagged value or 0 to reset it @param id The tag ID To get a tag ID, use \RdbDatabase#user_tag_id (preferred) or \RdbDatabase#tag_id (for internal use). Tagged values have been added in version 0.24. Tags can be given to identify a value, for example to attache measurement values to an item. To attach a value for a specific measurement, a tagged value can be used where the tag ID describes the measurement made. In that way, multiple values for different measurements can be attached to an item.

This variant has been introduced in version 0.24

__copy__ method descriptor

__copy__() -> RdbItemValue

@brief Creates a copy of self

__deepcopy__ method descriptor

__deepcopy__() -> RdbItemValue

@brief Creates a copy of self

__init__ method descriptor

__init__(b: db.DBox) -> None
__init__(e: db.DEdge) -> None
__init__(ee: db.DEdgePair) -> None
__init__(f: float) -> None
__init__(p: db.DPath) -> None
__init__(p: db.DPolygon) -> None
__init__(s: str) -> None
__init__(t: db.DText) -> None
__init__()

@brief Creates a value representing a DBox object

__repr__ method descriptor

__repr__() -> str

@brief Converts a value to a string The string can be used by the string constructor to create another object from it. @return The string

__str__ method descriptor

__str__() -> str

@brief Converts a value to a string The string can be used by the string constructor to create another object from it. @return The string

assign method descriptor

assign() -> None

@brief Assigns another object to self

box method descriptor

box() -> db.DBox

@brief Gets the box if the value represents one. @return The \DBox object or nil

create method descriptor

create() -> None

@brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

destroy method descriptor

destroy() -> None

@brief Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed method descriptor

destroyed() -> bool

@brief Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup method descriptor

dup() -> RdbItemValue

@brief Creates a copy of self

edge method descriptor

edge() -> db.DEdge

@brief Gets the edge if the value represents one. @return The \DEdge object or nil

edge_pair method descriptor

edge_pair() -> db.DEdgePair

@brief Gets the edge pair if the value represents one. @return The \DEdgePair object or nil

float method descriptor

float() -> float

@brief Gets the numeric value. @return The numeric value or 0 This method has been introduced in version 0.24.

from_s builtin

from_s() -> RdbItemValue

@brief Creates a value object from a string The string format is the same than obtained by the to_s method.

is_box method descriptor

is_box() -> bool

@brief Returns true if the value object represents a box

is_const_object method descriptor

is_const_object() -> bool

@brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self.

is_edge method descriptor

is_edge() -> bool

@brief Returns true if the value object represents an edge

is_edge_pair method descriptor

is_edge_pair() -> bool

@brief Returns true if the value object represents an edge pair

is_float method descriptor

is_float() -> bool

@brief Returns true if the value object represents a numeric value This method has been introduced in version 0.24.

is_path method descriptor

is_path() -> bool

@brief Returns true if the value object represents a path

This method has been introduced in version 0.22.

is_polygon method descriptor

is_polygon() -> bool

@brief Returns true if the value object represents a polygon

is_string method descriptor

is_string() -> bool

@brief Returns true if the object represents a string value

is_text method descriptor

is_text() -> bool

@brief Returns true if the value object represents a text

This method has been introduced in version 0.22.

new builtin

new(b: db.DBox) -> RdbItemValue
new(e: db.DEdge) -> RdbItemValue
new(ee: db.DEdgePair) -> RdbItemValue
new(f: float) -> RdbItemValue
new(p: db.DPath) -> RdbItemValue
new(p: db.DPolygon) -> RdbItemValue
new(s: str) -> RdbItemValue
new(t: db.DText) -> RdbItemValue
new()

@brief Creates a value representing a DBox object

path method descriptor

path() -> db.DPath

@brief Gets the path if the value represents one. @return The \DPath object This method has been introduced in version 0.22.

polygon method descriptor

polygon() -> db.DPolygon

@brief Gets the polygon if the value represents one. @return The \DPolygon object

string method descriptor

string() -> str

@brief Gets the string representation of the value. @return The stringThis method will always deliver a valid string, even if \is_string? is false. The objects stored in the value are converted to a string accordingly.

text method descriptor

text() -> db.DText

@brief Gets the text if the value represents one. @return The \DText object This method has been introduced in version 0.22.

to_s method descriptor

to_s() -> str

@brief Converts a value to a string The string can be used by the string constructor to create another object from it. @return The string

RdbReference

@brief A cell reference inside the report database This class describes a cell reference. Such reference object can be attached to cells to describe instantiations of them in parent cells. Not necessarily all instantiations of a cell in the layout database are represented by references and in some cases there might even be no references at all. The references are merely a hint how a marker must be displayed in the context of any other, potentially parent, cell in the layout database.

__doc__ class

__doc__ = '@brief A cell reference inside the report database\nThis class describes a cell reference. Such reference object can be attached to cells to describe instantiations of them in parent cells. Not necessarily all instantiations of a cell in the layout database are represented by references and in some cases there might even be no references at all. The references are merely a hint how a marker must be displayed in the context of any other, potentially parent, cell in the layout database.'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__gsi_id__ class

__gsi_id__ = 21

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

__module__ class

__module__ = 'klayout.rdbcore'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__weakref__ class

__weakref__ = <attribute '__weakref__' of 'RdbReference' objects>

list of weak references to the object

parent_cell_id class

parent_cell_id: int = <attribute 'parent_cell_id' of 'RdbReference' objects>

@brief Gets parent cell ID for this reference @return The parent cell ID

@brief Sets the parent cell ID for this reference

trans class

trans: DCplxTrans = <attribute 'trans' of 'RdbReference' objects>

@brief Gets the transformation for this reference The transformation describes the transformation of the child cell into the parent cell. In that sense that is the usual transformation of a cell reference. @return The transformation

@brief Sets the transformation for this reference

__copy__ method descriptor

__copy__() -> RdbReference

@brief Creates a copy of self

__deepcopy__ method descriptor

__deepcopy__() -> RdbReference

@brief Creates a copy of self

__init__ method descriptor

__init__() -> None

@brief Creates a reference with a given transformation and parent cell ID

assign method descriptor

assign() -> None

@brief Assigns another object to self

create method descriptor

create() -> None

@brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

database method descriptor

database() -> ReportDatabase
database() -> ReportDatabase
database()

@brief Gets the database object that category is associated with (non-const version)

This method has been introduced in version 0.29.

destroy method descriptor

destroy() -> None

@brief Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed method descriptor

destroyed() -> bool

@brief Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup method descriptor

dup() -> RdbReference

@brief Creates a copy of self

is_const_object method descriptor

is_const_object() -> bool

@brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self.

new builtin

new() -> RdbReference

@brief Creates a reference with a given transformation and parent cell ID

ReportDatabase

@brief The report database object A report database is organized around a set of items which are associated with cells and categories. Categories can be organized hierarchically by created sub-categories of other categories. Cells are associated with layout database cells and can come with a example instantiation if the layout database does not allow a unique association of the cells. Items in the database can have a variety of attributes: values, tags and an image object. Values are geometrical objects for example. Tags are a set of boolean flags and an image can be attached to an item to provide a screenshot for visualization for example. This is the main report database object. The basic use case of this object is to create one inside a \LayoutView and populate it with items, cell and categories or load it from a file. Another use case is to create a standalone ReportDatabase object and use the methods provided to perform queries or to populate it.

__doc__ class

__doc__ = '@brief The report database object\nA report database is organized around a set of items which are associated with cells and categories. Categories can be organized hierarchically by created sub-categories of other categories. Cells are associated with layout database cells and can come with a example instantiation if the layout database does not allow a unique association of the cells.\nItems in the database can have a variety of attributes: values, tags and an image object. Values are geometrical objects for example. Tags are a set of boolean flags and an image can be attached to an item to provide a screenshot for visualization for example.\nThis is the main report database object. The basic use case of this object is to create one inside a \\LayoutView and populate it with items, cell and categories or load it from a file. Another use case is to create a standalone ReportDatabase object and use the methods provided to perform queries or to populate it.\n'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__gsi_id__ class

__gsi_id__ = 26

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

__module__ class

__module__ = 'klayout.rdbcore'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

__weakref__ class

__weakref__ = <attribute '__weakref__' of 'ReportDatabase' objects>

list of weak references to the object

description class

description: str = <attribute 'description' of 'ReportDatabase' objects>

@brief Gets the databases description The description is a general purpose string that is supposed to further describe the database and its content in a human-readable form. @return The description string

@brief Sets the databases description @param desc The description string

generator class

generator: str = <attribute 'generator' of 'ReportDatabase' objects>

@brief Gets the databases generator The generator string describes how the database was created, i.e. DRC tool name and tool options. In a later version this will allow re-running the tool that created the report. @return The generator string

@brief Sets the generator string @param generator The generator string

original_file class

original_file: str = <attribute 'original_file' of 'ReportDatabase' objects>

@brief Gets the original file name and path The original file name is supposed to describe the file from which this report database was generated. @return The original file name and path

@brief Sets the original file name and path @param path The path

top_cell_name class

top_cell_name: str = <attribute 'top_cell_name' of 'ReportDatabase' objects>

@brief Gets the top cell name The top cell name identifies the top cell of the design for which the report was generated. This property must be set to establish a proper hierarchical context for a hierarchical report database. @return The top cell name

@brief Sets the top cell name string @param cell_name The top cell name

__copy__ method descriptor

__copy__() -> ReportDatabase

@brief Creates a copy of self

__deepcopy__ method descriptor

__deepcopy__() -> ReportDatabase

@brief Creates a copy of self

__init__ method descriptor

__init__() -> None

@brief Creates a report database @param name The name of the database The name of the database will be used in the user interface to refer to a certain database.

apply method descriptor

apply() -> None

@brief Transfers item attributes from one database to another for identical items This method will identify items that are identical between the two databases and transfer item attributes from the 'other' database to this database. Transferable attributes are:

@ul @li Images @/li @li Item tags @/li @/ul

Existing attributes in this database are overwritten.

Items are identical if

@ul @li They belong to the same cell (by qname) @/li @li They belong to the same category (by name) @/li @li Their values are identical @/li @/ul

Values are identical if their individual values and (optional) value tags are identical. Values tagged with a tag unknown to the other database are ignored. The order of values matters during the compare. So the value pair (17.0, 'abc') is different from ('abc', 17.0).

The intended application for this method is use for error waiving: as the waived attribute is a transferable attribute, it is possible to apply the waived flag from from a waiver database (the 'other' database) using this method.

This method has been added in version 0.29.1.

assign method descriptor

assign() -> None

@brief Assigns another object to self

category_by_id method descriptor

category_by_id(id: int) -> RdbCategory
category_by_id(id: int) -> RdbCategory
category_by_id()

@brief Gets a category by ID (non-const version) @return The (const) category object or nil if the ID is not valid

This non-const variant has been introduced in version 0.29.

category_by_path method descriptor

category_by_path(path: str) -> RdbCategory
category_by_path(path: str) -> RdbCategory
category_by_path()

@brief Gets a category by path (non-const version) @param path The full path to the category starting from the top level (subcategories separated by dots) @return The (const) category object or nil if the name is not valid

This non-const variant has been introduced in version 0.29.

cell_by_id method descriptor

cell_by_id(id: int) -> RdbCell
cell_by_id(id: int) -> RdbCell
cell_by_id()

@brief Returns the cell for a given ID (non-const version) @param id The ID of the cell @return The cell object or nil if no cell with that ID exists

This non-const variant has been added version 0.29.

cell_by_qname method descriptor

cell_by_qname(qname: str) -> RdbCell
cell_by_qname(qname: str) -> RdbCell
cell_by_qname()

@brief Returns the cell for a given qualified name (non-const version) @param qname The qualified name of the cell (name plus variant name optionally) @return The cell object or nil if no such cell exists

This non-const variant has been added version 0.29.

create method descriptor

create() -> None

@brief Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

create_category method descriptor

create_category(name: str) -> RdbCategory
create_category(parent: RdbCategory, name: str) -> RdbCategory
create_category()

@brief Creates a new sub-category @param parent The category under which the category should be created @param name The name of the category Since version 0.29.1, 'parent' can be nil. In that case, a top-level category is created.

create_cell method descriptor

create_cell(name: str) -> RdbCell
create_cell(name: str, variant: str, layout_name: Optional[str] = ...) -> RdbCell
create_cell()

@brief Creates a new cell, potentially as a variant for a cell with the same name @param name The name of the cell @param variant The variant name of the cell @param layout_name For variants, this is the name of the layout cell. If empty, 'name' is used for the layout cell name. The 'layout_name' argument has been added in version 0.29.1.

create_item method descriptor

create_item(cell: RdbCell, category: RdbCategory) -> RdbItem
create_item(cell_id: int, category_id: int) -> RdbItem
create_item(cell_id: int, category_id: int, trans: db.CplxTrans, shape: db.Shape, with_properties: Optional[bool] = ...) -> None
create_item()

@brief Creates a new item from a single shape This method produces an item from the given shape. It accepts various kind of shapes, such as texts, polygons, boxes and paths and converts them to a corresponding item. The transformation argument can be used to supply the transformation that applies the database unit for example.

This method has been introduced in version 0.25.3. The 'with_properties' argument has been added in version 0.28.

@param cell_id The ID of the cell to which the item is associated @param category_id The ID of the category to which the item is associated @param shape The shape to take the geometrical object from @param trans The transformation to apply @param with_properties If true, user properties will be turned into tagged values as well

create_items method descriptor

create_items(cell_id: int, category_id: int, iter: db.RecursiveShapeIterator, with_properties: Optional[bool] = ...) -> None
create_items(cell_id: int, category_id: int, trans: db.CplxTrans, array: Sequence[db.EdgePair]) -> None
create_items(cell_id: int, category_id: int, trans: db.CplxTrans, array: Sequence[db.Edge]) -> None
create_items(cell_id: int, category_id: int, trans: db.CplxTrans, array: Sequence[db.Polygon]) -> None
create_items(cell_id: int, category_id: int, trans: db.CplxTrans, edge_pairs: db.EdgePairs) -> None
create_items(cell_id: int, category_id: int, trans: db.CplxTrans, edges: db.Edges) -> None
create_items(cell_id: int, category_id: int, trans: db.CplxTrans, region: db.Region) -> None
create_items(cell_id: int, category_id: int, trans: db.CplxTrans, shapes: db.Shapes, with_properties: Optional[bool] = ...) -> None
create_items()

@brief Creates new edge pair items for the given cell/category combination For each edge pair a single item will be created. The value of the item will be this edge pair. A transformation can be supplied which can be used for example to convert the object's dimensions to micron units by scaling by the database unit.

This method has been introduced in version 0.23.

@param cell_id The ID of the cell to which the item is associated @param category_id The ID of the category to which the item is associated @param trans The transformation to apply @param edge_pairs The list of edge_pairs for which the items are created

destroy method descriptor

destroy() -> None

@brief Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed method descriptor

destroyed() -> bool

@brief Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup method descriptor

dup() -> ReportDatabase

@brief Creates a copy of self

each_category method descriptor

each_category() -> Iterator[RdbCategory]
each_category() -> Iterator[RdbCategory]
each_category()

@brief Iterates over all top-level categories (non-const version)

The non-const variant has been added in version 0.29.

each_cell method descriptor

each_cell() -> Iterator[RdbCell]
each_cell() -> Iterator[RdbCell]
each_cell()

@brief Iterates over all cells (non-const version)

This non-const variant has been added version 0.29.

each_item method descriptor

each_item() -> Iterator[RdbItem]
each_item() -> Iterator[RdbItem]
each_item()

@brief Iterates over all items inside the database (non-const version)

This non-const variant has been added in version 0.29.

each_item_per_category method descriptor

each_item_per_category(category_id: int) -> Iterator[RdbItem]
each_item_per_category(category_id: int) -> Iterator[RdbItem]
each_item_per_category()

@brief Iterates over all items inside the database which are associated with the given category (non-const version) @param category_id The ID of the category for which all associated items should be retrieved

This non-const variant has been added in version 0.29.

each_item_per_cell method descriptor

each_item_per_cell(cell_id: int) -> Iterator[RdbItem]
each_item_per_cell(cell_id: int) -> Iterator[RdbItem]
each_item_per_cell()

@brief Iterates over all items inside the database which are associated with the given cell (non-const version) @param cell_id The ID of the cell for which all associated items should be retrieved

This non-const variant has been added in version 0.29.

each_item_per_cell_and_category method descriptor

each_item_per_cell_and_category(cell_id: int, category_id: int) -> Iterator[RdbItem]
each_item_per_cell_and_category(cell_id: int, category_id: int) -> Iterator[RdbItem]
each_item_per_cell_and_category()

@brief Iterates over all items inside the database which are associated with the given cell and category @param cell_id The ID of the cell for which all associated items should be retrieved @param category_id The ID of the category for which all associated items should be retrieved

This non-const variant has been added in version 0.29.

filename method descriptor

filename() -> str

@brief Gets the file name and path where the report database is stored This property is set when a database is saved or loaded. It cannot be set manually. @return The file name and path

is_const_object method descriptor

is_const_object() -> bool

@brief Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self.

is_modified method descriptor

is_modified() -> bool

@brief Returns a value indicating whether the database has been modified

load method descriptor

load() -> None

@brief Loads the database from the given file @param filename The file from which to load the database The reader recognizes the format automatically and will choose the appropriate decoder. 'gzip' compressed files are uncompressed automatically.

name method descriptor

name() -> str

@brief Gets the database name The name of the database is supposed to identify the database within a layout view context. The name is modified to be unique when a database is entered into a layout view. @return The database name

new builtin

new() -> ReportDatabase

@brief Creates a report database @param name The name of the database The name of the database will be used in the user interface to refer to a certain database.

num_items method descriptor

num_items() -> int
num_items(cell_id: int, category_id: int) -> int
num_items()

@brief Returns the number of items inside the database for a given cell/category combination @param cell_id The ID of the cell for which to retrieve the number @param category_id The ID of the category for which to retrieve the number @return The total number of items for the given cell and the given category

num_items_visited method descriptor

num_items_visited() -> int
num_items_visited(cell_id: int, category_id: int) -> int
num_items_visited()

@brief Returns the number of items visited already for a given cell/category combination @param cell_id The ID of the cell for which to retrieve the number @param category_id The ID of the category for which to retrieve the number @return The total number of items visited for the given cell and the given category

reset_modified method descriptor

reset_modified() -> None

@brief Reset the modified flag

save method descriptor

save() -> None

@brief Saves the database to the given file @param filename The file to which to save the database The database is always saved in KLayout's XML-based format.

set_item_visited method descriptor

set_item_visited() -> None

@brief Modifies the visited state of an item @param item The item to modify @param visited True to set the item to visited state, false otherwise

set_tag_description method descriptor

set_tag_description() -> None

@brief Sets the tag description for the given tag ID @param tag_id The ID of the tag @param description The description string See \tag_id for a details about tags.

tag_description method descriptor

tag_description() -> str

@brief Gets the tag description for the given tag ID @param tag_id The ID of the tag @return The description string See \tag_id for a details about tags.

tag_id method descriptor

tag_id() -> int

@brief Gets the tag ID for a given tag name @param name The tag name @return The corresponding tag ID Tags are used to tag items in the database and to specify tagged (named) values. This method will always succeed and the tag will be created if it does not exist yet. Tags are basically names. There are user tags (for free assignment) and system tags which are used within the system. Both are separated to avoid name clashes.

\tag_id handles system tags while \user_tag_id handles user tags.

tag_name method descriptor

tag_name() -> str

@brief Gets the tag name for the given tag ID @param tag_id The ID of the tag @return The name of the tag See \tag_id for a details about tags.

This method has been introduced in version 0.24.10.

user_tag_id method descriptor

user_tag_id() -> int

@brief Gets the tag ID for a given user tag name @param name The user tag name @return The corresponding tag ID This method will always succeed and the tag will be created if it does not exist yet. See \tag_id for a details about tags.

This method has been added in version 0.24.

variants method descriptor

variants() -> List[int]

@brief Gets the variants for a given cell name @param name The basic name of the cell @return An array of ID's representing cells that are variants for the given base name