Skip to content

Commit f732cc9

Browse files
committed
Type cleanup
1 parent 990388b commit f732cc9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/omnipy/data/_display/dimensions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ def _calculate_proportionality(self, dims, frame_dims) -> Proportionally:
8282
return Proportionally.THINNER
8383

8484
@property
85-
def width(self):
85+
def width(self) -> bool | None:
8686
return self._width
8787

8888
@property
89-
def height(self):
89+
def height(self) -> bool | None:
9090
return self._height
9191

9292
@property
93-
def proportionality(self):
93+
def proportionality(self) -> Proportionally | None:
9494
return self._proportionality
9595

9696
@property
97-
def both(self):
97+
def both(self) -> bool | None:
9898
if self.width is None or self.height is None:
9999
return None
100100
else:

tests/data/display/panel/test_draft.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
from omnipy.data._display.config import OutputConfig
66
from omnipy.data._display.constraints import Constraints
77
from omnipy.data._display.dimensions import Dimensions
8-
from omnipy.data._display.frame import empty_frame, Frame, FrameWithWidthAndHeight, UndefinedFrame
8+
from omnipy.data._display.frame import (AnyFrame,
9+
empty_frame,
10+
Frame,
11+
FrameWithWidthAndHeight,
12+
UndefinedFrame)
913
from omnipy.data._display.layout import Layout
1014
from omnipy.data._display.panel.draft.base import DraftPanel
1115
from omnipy.data._display.panel.draft.layout import ResizedLayoutDraftPanel
@@ -166,15 +170,15 @@ def test_draft_panel_render_next_stage_with_repr(
166170

167171
def test_draft_panel_render_next_stage_with_layout(
168172
skip_test_if_not_default_data_config_values: Annotated[None, pytest.fixture]) -> None:
169-
draft_panel = DraftPanel(Layout())
173+
draft_panel: DraftPanel[Layout, AnyFrame] = DraftPanel(Layout())
170174
assert_next_stage_panel(
171175
this_panel=draft_panel,
172176
next_stage=draft_panel.render_next_stage(),
173177
next_stage_panel_cls=ResizedLayoutDraftPanel,
174178
exp_content=Layout(),
175179
)
176180

177-
draft_panel_complex = DraftPanel(
181+
draft_panel_complex: DraftPanel[Layout, FrameWithWidthAndHeight] = DraftPanel(
178182
Layout(tuple=MockPanel('(1, 2, 3)'), text=MockPanel('Here is some text')),
179183
frame=Frame(Dimensions(21, 5)),
180184
constraints=Constraints(container_width_per_line_limit=10),

0 commit comments

Comments
 (0)