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
We need to either represent the prior not as a dict, or do something different with the dataclass implementation, because the the dict is not hashable.
Grammar enumeration, but probably other things too, expect a Meaning to be hashable. But as a frozen dataclass this means we can't use a dict to represent the prior over referents. E.g. https://github.com/CLMBRs/ultk/blob/main/src/ultk/language/grammar.py#L316
results in *** TypeError: unhashable type: 'dict'
The hashability of the list of referents is related to this. We assumed it could be an iterable, and our tests pass a list, but a list is not hashable. #26
Happy to represent the prior as simply a tuple, since I've proposed requiring referents to be a tuple. So recovering order for the mapping won't be a problem, and we can still have a function that returns the dict.
The text was updated successfully, but these errors were encountered:
We need to either represent the prior not as a dict, or do something different with the dataclass implementation, because the the dict is not hashable.
Grammar enumeration, but probably other things too, expect a Meaning to be hashable. But as a frozen dataclass this means we can't use a dict to represent the prior over referents. E.g.
https://github.com/CLMBRs/ultk/blob/main/src/ultk/language/grammar.py#L316
results in
*** TypeError: unhashable type: 'dict'
The hashability of the list of referents is related to this. We assumed it could be an iterable, and our tests pass a list, but a list is not hashable. #26
Happy to represent the prior as simply a tuple, since I've proposed requiring referents to be a tuple. So recovering order for the mapping won't be a problem, and we can still have a function that returns the dict.
The text was updated successfully, but these errors were encountered: