(obj)
| 41 | |
| 42 | |
| 43 | def unpack_array(obj): |
| 44 | if b"__ndarray__" in obj: |
| 45 | return np.ndarray(buffer=obj[b"data"], dtype=np.dtype(obj[b"dtype"]), shape=obj[b"shape"]) |
| 46 | |
| 47 | if b"__npgeneric__" in obj: |
| 48 | return np.dtype(obj[b"dtype"]).type(obj[b"data"]) |
| 49 | |
| 50 | return obj |
| 51 | |
| 52 | |
| 53 | Packer = functools.partial(msgpack.Packer, default=pack_array) |
nothing calls this directly
no outgoing calls
no test coverage detected