ComponentBase

(class from pyomo.core.base.component)

class pyomo.core.base.component.ComponentBase[source]

Bases: PyomoObject

A base class for Component and ComponentData

This class defines some fundamental methods and properties that are expected for all Component-like objects. They are centralized here to avoid repeated code in the Component and ComponentData classes.

__init__()

Methods

__init__()

cname(*args, **kwds)

DEPRECATED.

is_component_type()

Return True if this class is a Pyomo component

is_expression_type([expression_system])

Return True if this numeric value is an expression

is_logical_type()

Return True if this class is a Pyomo Boolean object.

is_named_expression_type()

Return True if this numeric value is a named expression

is_numeric_type()

Return True if this class is a Pyomo numeric object

is_parameter_type()

Return False unless this class is a parameter object

is_reference()

Return True if this object is a reference.

is_variable_type()

Return False unless this class is a variable object

pprint([ostream, verbose, prefix])

Print component information

Attributes

active

Return the active attribute

local_name

Get the component name only within the context of the immediate parent container.

name

Get the fully qualified component name.

Member Documentation

cname(*args, **kwds)[source]

DEPRECATED.

Deprecated since version 5.0: The cname() method has been renamed to getname(). The preferred method of obtaining a component name is to use the .name property, which returns the fully qualified component name. The .local_name property will return the component name only within the context of the immediate parent container.

is_component_type()[source]

Return True if this class is a Pyomo component

is_expression_type(expression_system=None)

Return True if this numeric value is an expression

is_logical_type()

Return True if this class is a Pyomo Boolean object.

Boolean objects include constants, variables, or logical expressions.

is_named_expression_type()

Return True if this numeric value is a named expression

is_numeric_type()

Return True if this class is a Pyomo numeric object

is_parameter_type()

Return False unless this class is a parameter object

is_reference()

Return True if this object is a reference.

is_variable_type()

Return False unless this class is a variable object

pprint(ostream=None, verbose=False, prefix='')[source]

Print component information

Note that this method is generally only reachable through ComponentData objects in an IndexedComponent container. Components, including unindexed Component derivatives and both scalar and indexed IndexedComponent derivatives will see Component.pprint()

property active

Return the active attribute

property local_name

Get the component name only within the context of the immediate parent container.

property name

Get the fully qualified component name.