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
I believe this check fails because it's not using isinstance but checking for the type itself, which leads the code to try to invoke get_object_state, which then fails:
eliftype(obj) in (int, float, bool, str, complex):
byte_list.append(repr(obj).encode())
The numpy bool behaves very similarly to normal python bools and therefore I would consider this behavior very surprising and I believe it should be fixed. Maybe checking for isinstance(obj, bool) as the only check using isistance is valid? I think this would be a possible fix here. Or we just add all numpy types to the list that's checked there.
The text was updated successfully, but these errors were encountered:
would return the same value if repr is called but str(Foo('bar')) != str('bar'). Maybe this is more of an academic problem and to strict. Should we just accept that if a object is an instance of one these types and returns the same value it's ok to return the same hash? Any opinions?
Adding all numpy types is a bad idea since it would introduce a dependency to numpy slowing down the sisyphus startup process even if numpy is not even part of the recipes.
We could also make this configurable in the settings file and change the check to something like this (and use a better variable name):
elif type(obj) in (int, float, bool, str, complex) ortype(obj) ings.OTHER_ACCEPTED_HASH_TYPES:
I believe this check fails because it's not using
isinstance
but checking for the type itself, which leads the code to try to invokeget_object_state
, which then fails:sisyphus/sisyphus/hash.py
Lines 86 to 87 in 4c3b40f
The numpy bool behaves very similarly to normal python bools and therefore I would consider this behavior very surprising and I believe it should be fixed. Maybe checking for
isinstance(obj, bool)
as the only check usingisistance
is valid? I think this would be a possible fix here. Or we just add all numpy types to the list that's checked there.The text was updated successfully, but these errors were encountered: