(array)
| 668 | |
| 669 | |
| 670 | def short_array_repr(array): |
| 671 | from xarray.core.common import AbstractArray |
| 672 | |
| 673 | if isinstance(array, AbstractArray): |
| 674 | array = array.data |
| 675 | if isinstance(array, pd.api.extensions.ExtensionArray): |
| 676 | return repr(array) |
| 677 | array = to_duck_array(array) |
| 678 | |
| 679 | # default to lower precision so a full (abbreviated) line can fit on |
| 680 | # one line with the default display_width |
| 681 | options = { |
| 682 | "precision": 6, |
| 683 | "linewidth": OPTIONS["display_width"], |
| 684 | "threshold": OPTIONS["display_values_threshold"], |
| 685 | } |
| 686 | if array.ndim < 3: |
| 687 | edgeitems = 3 |
| 688 | elif array.ndim == 3: |
| 689 | edgeitems = 2 |
| 690 | else: |
| 691 | edgeitems = 1 |
| 692 | options["edgeitems"] = edgeitems |
| 693 | with set_numpy_options(**options): |
| 694 | return repr(array) |
| 695 | |
| 696 | |
| 697 | def short_data_repr(array): |
no test coverage detected
searching dependent graphs…