Skip to content

Commit 1ddb400

Browse files
Apply ruff fixes
1 parent ec8ce8e commit 1ddb400

6 files changed

Lines changed: 32 additions & 31 deletions

File tree

test/python/all_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def __init__(self, config):
4949

5050
assert len(config["some_objects"]) == 3
5151
expected = [
52-
{'a': 'b', 'c': 'd', 'e': 'f'},
53-
{'g': 'h', 'i': 'j', 'k': 'l'},
54-
{'m': 'n', 'o': 'p', 'q': 'r'},
52+
{"a": "b", "c": "d", "e": "f"},
53+
{"g": "h", "i": "j", "k": "l"},
54+
{"m": "n", "o": "p", "q": "r"},
5555
]
5656
for i in range(3):
5757
assert config["some_objects"][i] == expected[i]
@@ -60,10 +60,10 @@ def __init__(self, config):
6060
assert config["empty"] == ()
6161

6262
try:
63-
config[42] # should raise
63+
config[42] # should raise
6464
assert not "did not raise TypeError"
6565
except TypeError:
66-
pass # all good as exception was raised
66+
pass # all good as exception was raised
6767

6868
def __call__(self, i: int, j: int) -> None:
6969
"""Dummy routine to do something.

test/python/reducer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,13 @@ def PHLEX_REGISTER_ALGORITHMS(m, config):
7474
{"creator": "reduce0", "layer": "event", "suffix": "sum0"},
7575
{"creator": "reduce1", "layer": "event", "suffix": "sum1"},
7676
]
77-
m.transform(
78-
add_sum01, name="reduce01", input_family=input_family01, output_products=["sum01"]
79-
)
77+
m.transform(add_sum01, name="reduce01", input_family=input_family01, output_products=["sum01"])
8078

8179
input_family01 = [
8280
{"creator": "reduce2", "layer": "event", "suffix": "sum2"},
8381
{"creator": "reduce3", "layer": "event", "suffix": "sum3"},
8482
]
85-
m.transform(
86-
add_sum23, name="reduce23", input_family=input_family01, output_products=["sum23"]
87-
)
83+
m.transform(add_sum23, name="reduce23", input_family=input_family01, output_products=["sum23"])
8884

8985
# once more (and the configuration will add a verifier)
9086
input_family_final = [

test/python/sumit.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def PHLEX_REGISTER_ALGORITHMS(m, config):
6363
None
6464
"""
6565
m.transform(collectify, input_family=config["input"], output_products=["my_pyarray"])
66-
m.transform(sum_array,
67-
input_family=[
68-
{"creator" : "collectify", "layer" : "event", "suffix" : "my_pyarray"}
69-
],
70-
output_products=config["output"])
66+
m.transform(
67+
sum_array,
68+
input_family=[{"creator": "collectify", "layer": "event", "suffix": "my_pyarray"}],
69+
output_products=config["output"],
70+
)

test/python/test_coverage.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ def PHLEX_REGISTER_ALGORITHMS(m, config):
4242
"""Register algorithms."""
4343
# We need to transform scalar inputs to lists first
4444
# i, f1, d1 come from cppsource4py
45-
tfs = ((collect_int, "input", "i", "l_int"),
46-
(collect_float, "input", "f1", "l_float"),
47-
(collect_double, "input", "d1", "l_double"),
48-
(list_int_func, collect_int.__name__, "l_int", "sum_int"),
49-
(list_float_func, collect_float.__name__, "l_float", "sum_float"),
50-
(list_double_func, collect_double.__name__, "l_double", "sum_double")
51-
)
45+
tfs = (
46+
(collect_int, "input", "i", "l_int"),
47+
(collect_float, "input", "f1", "l_float"),
48+
(collect_double, "input", "d1", "l_double"),
49+
(list_int_func, collect_int.__name__, "l_int", "sum_int"),
50+
(list_float_func, collect_float.__name__, "l_float", "sum_float"),
51+
(list_double_func, collect_double.__name__, "l_double", "sum_double"),
52+
)
5253

5354
for func, creator, suffix, output in tfs:
5455
input_family = [{"creator": creator, "layer": "event", "suffix": suffix}]

test/python/test_mismatch.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def PHLEX_REGISTER_ALGORITHMS(m, config):
1010
"""Register algorithms."""
1111
# input_family has 1 element, but function takes 2 arguments
1212
# This should trigger the error in modulewrap.cpp
13-
m.transform(mismatch_func,
14-
input_family=[{"creator": "input", "layer": "event", "suffix": "a"}],
15-
output_products=["sum"])
13+
m.transform(
14+
mismatch_func,
15+
input_family=[{"creator": "input", "layer": "event", "suffix": "a"}],
16+
output_products=["sum"],
17+
)

test/python/vectypes.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,13 @@ def PHLEX_REGISTER_ALGORITHMS(m, config):
259259
)
260260

261261
sum_kwargs = {
262-
"input_family": [{
263-
"creator": list_collect.__name__ if use_lists else arr_collect.__name__,
264-
"layer": "event",
265-
"suffix": arr_name
266-
}],
262+
"input_family": [
263+
{
264+
"creator": list_collect.__name__ if use_lists else arr_collect.__name__,
265+
"layer": "event",
266+
"suffix": arr_name,
267+
}
268+
],
267269
"output_products": config[out_key],
268270
}
269271
if sum_name:

0 commit comments

Comments
 (0)