Skip to content

Commit 9f75fa8

Browse files
committed
Remove dead code from margin and element_text setup
margin.setup() assigned themeable_name to self but the attribute was never read anywhere in the repo, and element_text.setup() reassigned m to the return value of m.setup(...) which is None. Both are no-ops that only work because margin.setup mutates in place.
1 parent 0976614 commit 9f75fa8

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

plotnine/themes/elements/element_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def setup(self, theme: theme, themeable_name: str):
189189
Setup the theme_element before drawing
190190
"""
191191
if m := self.properties.get("margin"):
192-
m = m.setup(theme, themeable_name)
192+
m.setup(theme, themeable_name)
193193

194194
def _translate_hjust(
195195
self, just: float

plotnine/themes/elements/margin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def setup(self, theme: theme, themeable_name: str):
7070
convert them to different units as is required. Here we get
7171
all the parameters that we shall need to do the conversions.
7272
"""
73-
self.themeable_name = themeable_name
7473
self.fontsize = theme.getp((themeable_name, "size"), 11)
7574
self.figure_size = theme.getp("figure_size")
7675
self._is_setup = True

0 commit comments

Comments
 (0)