Skip to content

Commit 8849a98

Browse files
committed
CLN: reorder terminal/screen related methods
1 parent 92c10ab commit 8849a98

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pandas/io/formats/format.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -654,10 +654,6 @@ def _initialize_colspace(
654654
def max_rows_displayed(self) -> int:
655655
return min(self.max_rows or len(self.frame), len(self.frame))
656656

657-
def _is_in_terminal(self) -> bool:
658-
"""Check if the output is to be shown in terminal."""
659-
return bool(self.max_cols == 0 or self.max_rows == 0)
660-
661657
@property
662658
def max_cols_adj(self) -> Optional[int]:
663659
"""Number of columns fitting the screen."""
@@ -677,12 +673,6 @@ def max_cols_adj(self) -> Optional[int]:
677673
self._max_cols_adj = self.max_cols
678674
return self._max_cols_adj
679675

680-
def _is_screen_narrow(self, max_width) -> bool:
681-
return bool(self.max_cols == 0 and len(self.frame.columns) > max_width)
682-
683-
def _is_screen_short(self, max_height) -> bool:
684-
return bool(self.max_rows == 0 and len(self.frame) > max_height)
685-
686676
@property
687677
def max_rows_adj(self) -> Optional[int]:
688678
"""Number of rows fitting the screen."""
@@ -706,6 +696,16 @@ def max_rows_adj(self) -> Optional[int]:
706696
max_rows = min(self.min_rows, max_rows)
707697
return max_rows
708698

699+
def _is_in_terminal(self) -> bool:
700+
"""Check if the output is to be shown in terminal."""
701+
return bool(self.max_cols == 0 or self.max_rows == 0)
702+
703+
def _is_screen_narrow(self, max_width) -> bool:
704+
return bool(self.max_cols == 0 and len(self.frame.columns) > max_width)
705+
706+
def _is_screen_short(self, max_height) -> bool:
707+
return bool(self.max_rows == 0 and len(self.frame) > max_height)
708+
709709
def _get_number_of_auxillary_rows(self) -> int:
710710
"""Get number of rows occupied by prompt, dots and dimension info."""
711711
dot_row = 1

0 commit comments

Comments
 (0)