-
Notifications
You must be signed in to change notification settings - Fork 40
TypeError in Chain.communication_classes() #22
Copy link
Copy link
Open
Description
When running Chain.communication_classes(), a TypeError is thrown: TypeError: unhashable type: 'set'.
The issue seems to be having nested sets, since the interior sets are mutable. One fix would be to use frozenset() for the nested sets. Alternatively, the return could be changed to a list of sets, nested lists, or something similar.
Exact error:
In [1]: run pykov.py
In [2]: Chain({(0, 1): 1, (1, 0): 1}).communication_classes()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-cc5c171ee32c> in <module>()
----> 1 Chain({(0, 1): 1, (1, 0): 1}).communication_classes()
/home/rwb/python/Pykov/pykov.py in communication_classes(self)
1347 if row[0, el] == 1:
1348 comm_class.add(pos2el[el])
-> 1349 res.add(comm_class)
1350 return res
1351
TypeError: unhashable type: 'set'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels