Skip to content

Commit 523bcd8

Browse files
committed
Remove compose.has_layout
1 parent ad4a7c4 commit 523bcd8

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

plotnine/composition/_compose.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,8 @@ def layout(self, value: plot_layout):
147147
"""
148148
Add (or merge) a plot_layout to this composition
149149
"""
150-
if self.has_layout:
151-
_new_layout = copy(self.layout)
152-
_new_layout.update(value)
153-
else:
154-
_new_layout = value
155-
156-
self._layout = _new_layout
150+
self._layout = copy(self.layout)
151+
self._layout.update(value)
157152

158153
@property
159154
def nrow(self) -> int:
@@ -163,10 +158,6 @@ def nrow(self) -> int:
163158
def ncol(self) -> int:
164159
return cast("int", self.layout.ncol)
165160

166-
@property
167-
def has_layout(self) -> bool:
168-
return hasattr(self, "_layout")
169-
170161
@abc.abstractmethod
171162
def __or__(self, rhs: ggplot | Compose) -> Compose:
172163
"""

0 commit comments

Comments
 (0)