Skip to content

Commit d1ffe30

Browse files
committed
Simplify comments for cleaner tracebacks
1 parent 7574767 commit d1ffe30

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

seaborn/_core/plot.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,12 +1255,8 @@ def _setup_scales(
12551255
except Exception as err:
12561256
raise PlotSpecError._during("Scale setup", var) from err
12571257

1258-
# Everything below here applies only to coordinate variables
1259-
# We additionally skip it when we're working with a value
1260-
# that is derived from a coordinate we've already processed.
1261-
# e.g., the Stat consumed y and added ymin/ymax. In that case,
1262-
# we've already setup the y scale and ymin/max are in scale space.
12631258
if axis is None or (var != coord and coord in p._variables):
1259+
# Everything below here applies only to coordinate variables
12641260
continue
12651261

12661262
# Set up an empty series to receive the transformed values.
@@ -1280,13 +1276,15 @@ def _setup_scales(
12801276

12811277
for layer, new_series in zip(layers, transformed_data):
12821278
layer_df = layer["data"].frame
1283-
if var in layer_df:
1284-
idx = self._get_subplot_index(layer_df, view)
1285-
try:
1286-
new_series.loc[idx] = view_scale(layer_df.loc[idx, var])
1287-
except Exception as err:
1288-
spec_error = PlotSpecError._during("Scaling operation", var)
1289-
raise spec_error from err
1279+
if var not in layer_df:
1280+
continue
1281+
1282+
idx = self._get_subplot_index(layer_df, view)
1283+
try:
1284+
new_series.loc[idx] = view_scale(layer_df.loc[idx, var])
1285+
except Exception as err:
1286+
spec_error = PlotSpecError._during("Scaling operation", var)
1287+
raise spec_error from err
12901288

12911289
# Now the transformed data series are complete, set update the layer data
12921290
for layer, new_series in zip(layers, transformed_data):

0 commit comments

Comments
 (0)