Open
Description
In Python 3 (not 2 because in 2 keys() returns a list),
m = ConcreteModel()
some_dict = {1:2, 3:5, 5:8}
m.some_set = Set(initialize=some_dict.keys())
new = m.clone()
produces
ERROR: Unable to clone Pyomo component attribute. Component 'some_set'
contains an uncopyable field '_init_values' (<class
'pyomo.core.base.set.TuplizeValuesInitializer'>)
The original exception is swallowed, but it's a TypeError: can't pickle dict_keys objects
. It seems like at some point it is Set's job to convert some_dict.keys()
to a list or something friendlier?