(self, obj)
| 12 | """Convert numpy classes to JSON serializable objects.""" |
| 13 | |
| 14 | def default(self, obj): |
| 15 | if isinstance(obj, (np.integer, np.floating, np.bool_)): |
| 16 | return obj.item() |
| 17 | elif isinstance(obj, np.ndarray): |
| 18 | return obj.tolist() |
| 19 | else: |
| 20 | return super(JsonEncoder, self).default(obj) |
| 21 | |
| 22 | |
| 23 | def serialize(obj, max_depth=5, compress=False): |
nothing calls this directly
no outgoing calls
no test coverage detected