Skip to content

Commit 0072ad0

Browse files
committed
Fix formatting for get_computed_values implementation
1 parent b8b4889 commit 0072ad0

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

plotly/basedatatypes.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,10 +1447,12 @@ def _select_layout_subplots_by_prefix(
14471447

14481448
layout_keys_filters = [
14491449
lambda k: k.startswith(prefix) and self.layout[k] is not None,
1450-
lambda k: row is None
1451-
or container_to_row_col.get(k, (None, None, None))[0] == row,
1452-
lambda k: col is None
1453-
or container_to_row_col.get(k, (None, None, None))[1] == col,
1450+
lambda k: (
1451+
row is None or container_to_row_col.get(k, (None, None, None))[0] == row
1452+
),
1453+
lambda k: (
1454+
col is None or container_to_row_col.get(k, (None, None, None))[1] == col
1455+
),
14541456
lambda k: (
14551457
secondary_y is None
14561458
or container_to_row_col.get(k, (None, None, None))[2] == secondary_y

tests/test_core/test_update_objects/test_get_computed_values.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from unittest.mock import MagicMock
32
import importlib.metadata
43

@@ -29,11 +28,11 @@ def test_get_computed_axis_ranges_basic(self):
2928
computed = fig.get_computed_values(include=["axis_ranges"])
3029

3130
# Verify results
32-
expected = {
33-
"axis_ranges": {"xaxis": [0.8, 3.2], "yaxis": [8.0, 32.0]}
34-
}
31+
expected = {"axis_ranges": {"xaxis": [0.8, 3.2], "yaxis": [8.0, 32.0]}}
3532
self.assertEqual(computed, expected)
36-
fig.full_figure_for_development.assert_called_once_with(warn=False, as_dict=True)
33+
fig.full_figure_for_development.assert_called_once_with(
34+
warn=False, as_dict=True
35+
)
3736

3837
def test_get_computed_axis_ranges_multi_axis(self):
3938
# Create a figure with multiple axes
@@ -85,7 +84,8 @@ def test_invalid_include_parameter(self):
8584

8685
# Test unsupported key and deterministic error message
8786
with self.assertRaisesRegex(
88-
ValueError, r"Unsupported key 'invalid'.*Supported keys are: \['axis_ranges'\]"
87+
ValueError,
88+
r"Unsupported key 'invalid'.*Supported keys are: \['axis_ranges'\]",
8989
):
9090
fig.get_computed_values(include=["invalid"])
9191

@@ -103,7 +103,5 @@ def test_safe_extraction_handling(self):
103103

104104
computed = fig.get_computed_values(include=["axis_ranges"])
105105

106-
expected = {
107-
"axis_ranges": {"xaxis2": [1, 2]}
108-
}
106+
expected = {"axis_ranges": {"xaxis2": [1, 2]}}
109107
self.assertEqual(computed, expected)

0 commit comments

Comments
 (0)