You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought about this, and calculating the repr is indeed a hard problem, but it becomes easy if we exclude distributed/chunked arrays.
What I propose is:
every meta array have a __array_meta__(): duck_array which returns the inner array (as one can see for distributed arrays, this could require materialising the array).
In addition, there should be an __array_attrs__(html: bool): Dict[str, Union[int, bool, float, np.generic, str]] which should be on ALL arrays that want to be included into meta-arrays. This method returns a dict containing the elements it would like displayed. One can then use an implementation like the following:
For a chunked representation, one could also have a third slot, __attr_aggregate__(attr_name): Callable[[Iterable[Union[int, bool, float, np.generic, str]]], Union[int, bool, float, np.generic, str]] which could aggregate the given attribute. This way, Dask (or other distributed/chunked array libraries) could easily aggregate the attrs.
I thought about this, and calculating the repr is indeed a hard problem, but it becomes easy if we exclude distributed/chunked arrays.
What I propose is:
__array_meta__(): duck_array
which returns the inner array (as one can see for distributed arrays, this could require materialising the array).__array_attrs__(html: bool): Dict[str, Union[int, bool, float, np.generic, str]]
which should be on ALL arrays that want to be included into meta-arrays. This method returns adict
containing the elements it would like displayed. One can then use an implementation like the following:The text was updated successfully, but these errors were encountered: