'Pyomo: Any drawback using ScalarBlock instead of Block?

I wished to subclass the Block object from Pyomo.
This didn't work and this error message suggest a problem in subclassing:

AttributeError: 'subclassOfBlock' object has no attribute 'component_map'

Exploring what's on the shelf, I found ScalarBlock and SimpleBlock .
On my tiny test case, ScalarBlock seems to solve my problem.

Could you help me for one of those questions:

  1. Where could I find a documentation for ScalarBlock and SimpleBlock as well as eventually some comparison and discussion ?
  2. Would you know something about the drawback I could face using ScalarBlock instead of Block ?
  3. Would you know about some other way for creating a specialized Block-compatible class ?

Thanks,

Michel



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source