Skip to content
Snippets Groups Projects
Commit fa079f60 authored by Timo Birr's avatar Timo Birr :rage:
Browse files

Merge branch 'fix/assert-error' into 'master'

fix by TB: microphone_to_memory does not work otherwise

See merge request !96
parents 90708c2f 08b73e2a
No related branches found
No related tags found
1 merge request!96fix by TB: microphone_to_memory does not work otherwise
Pipeline #22504 passed
...@@ -28,10 +28,12 @@ def pythonic_to_aron_ice( ...@@ -28,10 +28,12 @@ def pythonic_to_aron_ice(
return AronDataIceTypes.bool(value) return AronDataIceTypes.bool(value)
elif isinstance(value, np.int64): elif isinstance(value, np.int64):
return AronDataIceTypes.long(int(value)) return AronDataIceTypes.long(int(value))
elif isinstance(value, int) or isinstance(value, np.int32): elif isinstance(value, np.int32):
return AronIceTypes.int(int(value))
elif isinstance(value, int):
# because python is treating int and long the same, we need to differentiate between the two # because python is treating int and long the same, we need to differentiate between the two
assert(isinstance(value, int)), value
if 'invalid value - expected int' in str(AronIceTypes.int(int(value))): if 'invalid value - expected int' in str(AronIceTypes.int(int(value))):
# try to convert it to AronInt -> if it fails this is a long
assert 'invalid value - expected int' not in str(AronIceTypes.long(int(value))), \ assert 'invalid value - expected int' not in str(AronIceTypes.long(int(value))), \
f'Casting {value} to long failed. Did you intend to use np.int64 instead, ' \ f'Casting {value} to long failed. Did you intend to use np.int64 instead, ' \
'but assigned a plain int value, or converted the value somewhere in the meantime?' 'but assigned a plain int value, or converted the value somewhere in the meantime?'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment