Skip to content

Commit 4794d98

Browse files
committed
FMT: Fix new format failures
1 parent fa973c2 commit 4794d98

File tree

13 files changed

+17
-25
lines changed

13 files changed

+17
-25
lines changed

plotnine/doctools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def dict_to_table(header: tuple[str, str], contents: dict[str, str]) -> str:
188188
fill `None`
189189
"""
190190
rows = [
191-
(name, value if value == "" else f"`{value!r}`" "{.py}")
191+
(name, value if value == "" else f"`{value!r}`{{.py}}")
192192
for name, value in contents.items()
193193
]
194194
return table_function(rows, headers=header, tablefmt="grid")

plotnine/facets/facet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,7 @@ def combine_vars(
477477
has_all = [x.shape[1] == len(vars) for x in values]
478478
if not any(has_all):
479479
raise PlotnineError(
480-
"At least one layer must contain all variables "
481-
"used for facetting"
480+
"At least one layer must contain all variables used for facetting"
482481
)
483482
base = pd.concat([x for i, x in enumerate(values) if has_all[i]], axis=0)
484483
base = base.drop_duplicates()

plotnine/facets/facet_grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def parse_grid_facets_old(
302302
"((var1, var2), (var3, var4))",
303303
]
304304
error_msg_s = (
305-
"Valid sequences for specifying 'facets' look like" f" {valid_seqs}"
305+
f"Valid sequences for specifying 'facets' look like {valid_seqs}"
306306
)
307307

308308
valid_forms = [
@@ -314,7 +314,7 @@ def parse_grid_facets_old(
314314
". ~ func(var1) + func(var2)",
315315
". ~ func(var1+var3) + func(var2)",
316316
] + valid_seqs
317-
error_msg_f = "Valid formula for 'facet_grid' look like" f" {valid_forms}"
317+
error_msg_f = f"Valid formula for 'facet_grid' look like {valid_forms}"
318318

319319
if not isinstance(facets, str):
320320
if len(facets) == 1:

plotnine/facets/facet_wrap.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ def check_dimensions(
198198
if nrow is not None:
199199
if nrow < 1:
200200
warn(
201-
"'nrow' must be greater than 0. "
202-
"Your value has been ignored.",
201+
"'nrow' must be greater than 0. Your value has been ignored.",
203202
PlotnineWarning,
204203
)
205204
nrow = None
@@ -209,8 +208,7 @@ def check_dimensions(
209208
if ncol is not None:
210209
if ncol < 1:
211210
warn(
212-
"'ncol' must be greater than 0. "
213-
"Your value has been ignored.",
211+
"'ncol' must be greater than 0. Your value has been ignored.",
214212
PlotnineWarning,
215213
)
216214
ncol = None
@@ -241,7 +239,7 @@ def parse_wrap_facets_old(facets: str | Sequence[str]) -> Sequence[str]:
241239
This handles the old & silently deprecated r-style formulas
242240
"""
243241
valid_forms = ["~ var1", "~ var1 + var2"]
244-
error_msg = "Valid formula for 'facet_wrap' look like" f" {valid_forms}"
242+
error_msg = f"Valid formula for 'facet_wrap' look like {valid_forms}"
245243

246244
if isinstance(facets, (list, tuple)):
247245
return facets

plotnine/geoms/geom_crossbar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ def flat(*args: pd.Series[Any]) -> npt.NDArray[Any]:
110110

111111
if any(ynotchlower < ymin) or any(ynotchupper > ymax):
112112
warn(
113-
"Notch went outside the hinges. "
114-
"Try setting notch=False.",
113+
"Notch went outside the hinges. Try setting notch=False.",
115114
PlotnineWarning,
116115
)
117116

plotnine/positions/position_dodge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def setup_params(self, data):
6161
and ("xmax" not in data)
6262
and (self.params["width"] is None)
6363
):
64-
msg = "Width not defined. " "Set with `position_dodge(width = ?)`"
64+
msg = "Width not defined. Set with `position_dodge(width = ?)`"
6565
raise PlotnineError(msg)
6666

6767
params = copy(self.params)

plotnine/positions/position_dodge2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def setup_params(self, data):
6464
and ("xmax" not in data)
6565
and (self.params["width"] is None)
6666
):
67-
msg = "Width not defined. " "Set with `position_dodge2(width = ?)`"
67+
msg = "Width not defined. Set with `position_dodge2(width = ?)`"
6868
raise PlotnineError(msg)
6969

7070
params = copy(self.params)

plotnine/positions/position_stack.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def setup_params(self, data):
3939
if "ymax" in data:
4040
if any((data["ymin"] != 0) & (data["ymax"] != 0)):
4141
warn(
42-
"Stacking not well defined when not "
43-
"anchored on the axis.",
42+
"Stacking not well defined when not anchored on the axis.",
4443
PlotnineWarning,
4544
)
4645
var = "ymax"

plotnine/qplot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ def get_facet_type(facets: str) -> Literal["grid", "wrap", "null"]:
180180
return "wrap"
181181

182182
warn(
183-
"Could not determine the type of faceting, "
184-
"therefore no faceting.",
183+
"Could not determine the type of faceting, therefore no faceting.",
185184
PlotnineWarning,
186185
)
187186
return "null"

plotnine/stats/binning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def breaks_from_binwidth(
7373

7474
if boundary is not None and center is not None:
7575
raise PlotnineError(
76-
"Only one of 'boundary' and 'center' " "may be specified."
76+
"Only one of 'boundary' and 'center' may be specified."
7777
)
7878
elif boundary is None:
7979
# When center is None, put the min and max of data in outer

0 commit comments

Comments
 (0)