Suffixes

class pyomo.core.kernel.suffix.ISuffix(*args, **kwds)[source]

Bases: pyomo.common.collections.component_map.ComponentMap, pyomo.core.kernel.base.ICategorizedObject

The interface for suffixes.

property datatype

The suffix datatype

property direction

The suffix direction

pyomo.core.kernel.suffix.export_suffix_generator(blk, datatype=<object object>, active=True, descend_into=True)[source]

Generates an efficient traversal of all suffixes that have been declared for exporting data.

Parameters:
  • blk – A block object.
  • datatype – Restricts the suffixes included in the returned generator to those matching the provided suffix datatype.
  • active (True/None) – Controls whether or not to filter the iteration to include only the active part of the storage tree. The default is True. Setting this keyword to None causes the active status of objects to be ignored.
  • descend_into (bool, function) – Indicates whether or not to descend into a heterogeneous container. Default is True, which is equivalent to lambda x: True, meaning all heterogeneous containers will be descended into.
Returns:

iterator of suffixes

pyomo.core.kernel.suffix.import_suffix_generator(blk, datatype=<object object>, active=True, descend_into=True)[source]

Generates an efficient traversal of all suffixes that have been declared for importing data.

Parameters:
  • blk – A block object.
  • datatype – Restricts the suffixes included in the returned generator to those matching the provided suffix datatype.
  • active (True/None) – Controls whether or not to filter the iteration to include only the active part of the storage tree. The default is True. Setting this keyword to None causes the active status of objects to be ignored.
  • descend_into (bool, function) – Indicates whether or not to descend into a heterogeneous container. Default is True, which is equivalent to lambda x: True, meaning all heterogeneous containers will be descended into.
Returns:

iterator of suffixes

pyomo.core.kernel.suffix.local_suffix_generator(blk, datatype=<object object>, active=True, descend_into=True)[source]

Generates an efficient traversal of all suffixes that have been declared local data storage.

Parameters:
  • blk – A block object.
  • datatype – Restricts the suffixes included in the returned generator to those matching the provided suffix datatype.
  • active (True/None) – Controls whether or not to filter the iteration to include only the active part of the storage tree. The default is True. Setting this keyword to None causes the active status of objects to be ignored.
  • descend_into (bool, function) – Indicates whether or not to descend into a heterogeneous container. Default is True, which is equivalent to lambda x: True, meaning all heterogeneous containers will be descended into.
Returns:

iterator of suffixes

class pyomo.core.kernel.suffix.suffix(*args, **kwds)[source]

Bases: pyomo.core.kernel.suffix.ISuffix

A container for storing extraneous model data that can be imported to or exported from a solver.

clear_all_values()[source]

DEPRECATED.

Deprecated since version 5.3: suffix.clear_all_values is replaced with suffix.clear

clear_value(component)[source]

DEPRECATED.

Deprecated since version 5.3: suffix.clear_value will be removed in the future. Use ‘del suffix[key]’ instead.

property datatype

Return the suffix datatype.

property direction

Return the suffix direction.

property export_enabled

Returns True when this suffix is enabled for export to solvers.

get_datatype()[source]

DEPRECATED.

Deprecated since version 5.3: suffix.get_datatype is replaced with the property suffix.datatype

get_direction()[source]

DEPRECATED.

Deprecated since version 5.3: suffix.get_direction is replaced with the property suffix.direction

property import_enabled

Returns True when this suffix is enabled for import from solutions.

set_all_values(value)[source]

DEPRECATED.

Deprecated since version 5.3: suffix.set_all_values will be removed in the future.

set_datatype(datatype)[source]

DEPRECATED.

Deprecated since version 5.3: suffix.set_datatype is replaced with the property setter suffix.datatype

set_direction(direction)[source]

DEPRECATED.

Deprecated since version 5.3: suffix.set_direction is replaced with the property setter suffix.direction

class pyomo.core.kernel.suffix.suffix_dict(*args, **kwds)

Bases: pyomo.core.kernel.dict_container.DictContainer

A dict-style container for objects with category type ISuffix

pyomo.core.kernel.suffix.suffix_generator(blk, datatype=<object object>, active=True, descend_into=True)[source]

Generates an efficient traversal of all suffixes that have been declared.

Parameters:
  • blk – A block object.
  • datatype – Restricts the suffixes included in the returned generator to those matching the provided suffix datatype.
  • active (True/None) – Controls whether or not to filter the iteration to include only the active part of the storage tree. The default is True. Setting this keyword to None causes the active status of objects to be ignored.
  • descend_into (bool, function) – Indicates whether or not to descend into a heterogeneous container. Default is True, which is equivalent to lambda x: True, meaning all heterogeneous containers will be descended into.
Returns:

iterator of suffixes