File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
utbot-python-executor/src/main/python/utbot_executor/utbot_executor/deep_serialization Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ def get_constructor_info(constructor: object, obj: object) -> TypeInfo:
95
95
96
96
97
97
def has_reduce (py_object : object ) -> bool :
98
+ if get_kind (py_object ).module == "numpy" :
99
+ return False
98
100
reduce = getattr (py_object , "__reduce__" , None )
99
101
if reduce is None :
100
102
return False
@@ -161,6 +163,10 @@ def check_eval(py_object: object) -> bool:
161
163
except Exception :
162
164
return False
163
165
166
+ try :
167
+ import numpy as np
168
+ except ImportError :
169
+ pass
164
170
165
171
def has_repr (py_object : object ) -> bool :
166
172
reprable_types = [
@@ -171,11 +177,13 @@ def has_repr(py_object: object) -> bool:
171
177
bytes ,
172
178
bytearray ,
173
179
str ,
174
- # tuple,
175
- # list,
176
- # dict,
177
- # set,
178
- # frozenset,
180
+ np .int64 ,
181
+ np .int32 ,
182
+ np .int16 ,
183
+ np .int8 ,
184
+ np .float32 ,
185
+ np .float16 ,
186
+ np .float64 ,
179
187
type ,
180
188
]
181
189
if type (py_object ) in reprable_types :
You can’t perform that action at this time.
0 commit comments