Skip to content

Commit a731e98

Browse files
committed
linting
1 parent 5141930 commit a731e98

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

hypothesis-python/benchmark/graph.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
import click
1717

1818

19-
def plot_vega(vega_spec, data, *, to, parameters={}):
19+
def plot_vega(vega_spec, data, *, to, parameters=None):
2020
import vl_convert
2121

22+
parameters = parameters or {}
23+
2224
spec = json.loads(vega_spec.read_text())
2325
spec["data"].insert(0, {"name": "source", "values": data})
2426
if "signals" not in spec:
@@ -48,9 +50,11 @@ def _mean_difference_ci(n1, n2, *, confidence):
4850

4951
def _process_benchmark_data(data):
5052
assert set(data) == {"old", "new"}
51-
assert (old := set(data["old"]["calls"])) == (
52-
new := set(data["new"]["calls"])
53-
), old.symmetric_difference(new)
53+
old_calls = data["old"]["calls"]
54+
new_calls = data["new"]["calls"]
55+
assert set(old_calls) == set(new_calls), set(old_calls).symmetric_difference(
56+
set(new_calls)
57+
)
5458

5559
graph_data = []
5660

@@ -66,9 +70,9 @@ def _diff_times(old, new):
6670
return v
6771

6872
sums = {"old": 0, "new": 0}
69-
for node_id in data["old"]["calls"]:
70-
old = data["old"]["calls"][node_id]
71-
new = data["new"]["calls"][node_id]
73+
for node_id in old_calls:
74+
old = old_calls[node_id]
75+
new = new_calls[node_id]
7276
if set(old) | set(new) == {0} or len(old) != len(new):
7377
print(f"skipping {node_id}")
7478
continue

0 commit comments

Comments
 (0)