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.

datatype

The suffix datatype

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.

datatype

Return the suffix datatype.

direction

Return the suffix direction.

export_enabled

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

import_enabled

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

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