(self, obj)
| 281 | """Helper to encode things with Numpy objects.""" |
| 282 | |
| 283 | def default(self, obj): |
| 284 | if isinstance(obj, np.ndarray): |
| 285 | return obj.tolist() |
| 286 | if np.issubdtype(obj, np.integer): |
| 287 | return int(obj) |
| 288 | if np.issubdtype(obj, float): |
| 289 | return float(obj) |
| 290 | if np.issubdtype(obj, bool): |
| 291 | return bool(obj) |
| 292 | return json.JSONEncoder.default(self, obj) |
nothing calls this directly
no outgoing calls
no test coverage detected