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