Skip to content

Commit 3890abd

Browse files
committed
Merge branch 'ig-minimumal-reindex' of github.com:ilan-gold/xarray into ig-minimumal-reindex
2 parents 421594d + 0509958 commit 3890abd

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

xarray/core/formatting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def inherited_coords_repr(node: DataTree, col_width=None, max_rows=None):
464464
)
465465

466466

467-
def inline_index_repr(index: pd.Index, max_width=None):
467+
def inline_index_repr(index: pd.Index, max_width: int) -> str:
468468
if hasattr(index, "_repr_inline_"):
469469
repr_ = index._repr_inline_(max_width=max_width)
470470
else:

xarray/core/formatting_html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def summarize_index(coord_names, index) -> str:
145145
name = "<br>".join([escape(str(n)) for n in coord_names])
146146

147147
index_id = f"index-{uuid.uuid4()}"
148-
preview = escape(inline_index_repr(index))
148+
preview = escape(inline_index_repr(index, max_width=70))
149149
details = short_index_repr_html(index)
150150

151151
data_icon = _icon("icon-database")

xarray/core/indexes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def _copy(self, deep: bool = True, memo: dict[int, Any] | None = None) -> Self:
479479
def __getitem__(self, indexer: Any) -> Self:
480480
raise NotImplementedError()
481481

482-
def _repr_inline_(self, max_width):
482+
def _repr_inline_(self, max_width: int) -> str:
483483
return self.__class__.__name__
484484

485485

xarray/tests/test_range_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,6 @@ def test_range_index_repr() -> None:
220220

221221
def test_range_index_repr_inline() -> None:
222222
index = RangeIndex.arange(0.0, 1.0, 0.1, dim="x")
223-
actual = index._repr_inline_(max_width=None)
223+
actual = index._repr_inline_(max_width=70)
224224
expected = "RangeIndex (start=0, stop=1, step=0.1)"
225225
assert actual == expected

0 commit comments

Comments
 (0)