(cls,arr,info={})
| 24 | # Defines a generic np.ndarray subclass, that stores some metadata |
| 25 | # in the dictionary `info`. |
| 26 | def __new__(cls,arr,info={}): |
| 27 | x = np.asanyarray(arr).view(cls) |
| 28 | x.info = info.copy() |
| 29 | return x |
| 30 | |
| 31 | def __array_finalize__(self, obj): |
| 32 | super().__array_finalize__(obj) |