Skip to content

Commit 449828a

Browse files
authored
Only sparse arrays should print capacity in repr (#1811)
Capacity is not applicable to dense arrays and has no effect.
1 parent 8eadeb7 commit 449828a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tiledb/array_schema.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ def __repr__(self):
394394
f" cell_order='{self.cell_order}',\n"
395395
f" tile_order={repr(self.tile_order)},\n"
396396
)
397-
output.write(f" capacity={self.capacity},\n")
397+
if self.sparse:
398+
output.write(f" capacity={self.capacity},\n")
398399
output.write(f" sparse={self.sparse},\n")
399400
if self.sparse:
400401
output.write(f" allows_duplicates={self.allows_duplicates},\n")
@@ -434,8 +435,9 @@ def _repr_html_(self):
434435
output.write("<tr><th>Tile Order</th></tr>")
435436
output.write(f"<tr><td>{self.tile_order}</td></tr>")
436437

437-
output.write("<tr><th>Capacity</th></tr>")
438-
output.write(f"<tr><td>{self.capacity}</td></tr>")
438+
if self.sparse:
439+
output.write("<tr><th>Capacity</th></tr>")
440+
output.write(f"<tr><td>{self.capacity}</td></tr>")
439441

440442
output.write("<tr><th>Sparse</th></tr>")
441443
output.write(f"<tr><td>{self.sparse}</td></tr>")

0 commit comments

Comments
 (0)