cog-imperial / suspect

Special Structure Detection for Pyomo
https://cog-imperial.github.io/suspect/
Apache License 2.0
26 stars 4 forks source link

adding support for hierarchical models (i.e., models containing Blocks) #6

Closed michaelbynum closed 4 years ago

michaelbynum commented 4 years ago

The component_map method on Pyomo Block only provides components that live directly on that Block. It does not provide components that live on children blocks. This PR replaces the use of component_map with component_data_objects which has an option to descend into sub-blocks. Note that component_data_objects iterates over all of the ComponentData objects directly, so there is no need to worry about indexed objects.

fracek commented 4 years ago

Hi Michael, LGTM. Thanks for the PR.