You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
In Python 3 (not 2 because in 2 keys() returns a list),
produces
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 convertsome_dict.keys()
to a list or something friendlier?The text was updated successfully, but these errors were encountered: