simetrix.GraphProperty

class simetrix.GraphProperty

Bases: object

Property for a GraphObject. GraphProperty objects may have one of five types of value as defined in the following table:

Type

Description

String

Simple string value

Real

Scalar real value

GraphObject

Reference to a GraphObject

List of Strings

List of string values

List of GraphObjects

List of references to GraphObject objects

For more details see Graph Objects and their Properties

Methods

Attributes

name

Property name.

object

Set to a graph object if the graph property is of type GRAPHOBJECT.

objects

Set to a list of graph objects if the graph property is of type GRAPHOBJECTLIST.

protected

True if the property is read-only.

readOnly

True if the property is read-only.

real

Set to a real value if the graph property is of type REAL.

string

Set to a string value if the graph property is of type STRING.

strings

Set to a list of strings if the graph property is of type STRINGLIST.

type

Data type of property

valid

Returns True if the property is valid.

value

Property value.

property name: str

Property name.

property object: GraphObject

Set to a graph object if the graph property is of type GRAPHOBJECT. Otherwise throws a run time error exception.

property objects: list[GraphObject]

Set to a list of graph objects if the graph property is of type GRAPHOBJECTLIST. Otherwise throws a run time error exception.

property protected: bool

True if the property is read-only. (Identical to readOnly()).

property readOnly: bool

True if the property is read-only. (Identical to protected()).

property real: float

Set to a real value if the graph property is of type REAL. Otherwise throws a run time error exception.

property string: str

Set to a string value if the graph property is of type STRING. Otherwise throws a run time error exception.

property strings: list[str]

Set to a list of strings if the graph property is of type STRINGLIST. Otherwise throws a run time error exception.

property type: GraphPropertyType

Data type of property

property valid: bool

Returns True if the property is valid. A False value will be returned, for example, if the GraphObject.property() method is called specifying a non-existent property.

property value: str | float | GraphObject | list[str] | list[GraphObject]

Property value. May be one of the five types described in the table above. Note that objects of class GraphObject are polymorphic which means that the actual type returned will be a class derived from GraphObject such as a Curve or Graph.

Usually it is better to use one of the specialised value properties, namely objects, object, real, strings and string