| 1349 | return self.format_array(a) |
| 1350 | |
| 1351 | def format_array(self, a): |
| 1352 | if np.ndim(a) == 0: |
| 1353 | return self.format_function(a) |
| 1354 | |
| 1355 | if self.summary_insert and a.shape[0] > 2*self.edge_items: |
| 1356 | formatted = ( |
| 1357 | [self.format_array(a_) for a_ in a[:self.edge_items]] |
| 1358 | + [self.summary_insert] |
| 1359 | + [self.format_array(a_) for a_ in a[-self.edge_items:]] |
| 1360 | ) |
| 1361 | else: |
| 1362 | formatted = [self.format_array(a_) for a_ in a] |
| 1363 | |
| 1364 | return "[" + ", ".join(formatted) + "]" |
| 1365 | |
| 1366 | |
| 1367 | class StructuredVoidFormat: |