Skip to content

Commit 7b3db38

Browse files
committed
Fixed TODO comments
Signed-off-by: Maria Teresa Ortega <teresa.ortega0903@gmail.com>
1 parent 6336cc0 commit 7b3db38

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/lambkin/common/named_product.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
def named_product(**parameters):
2525
"""Generate all combinations of named parameters.
2626
27-
Takes keyword arguments where each value is a list of options
27+
Takes parameters where each value is a list of options
2828
and returns a list of dictionaries representing every possible
2929
combination, one dictionary per benchmark run configuration.
3030
@@ -44,7 +44,7 @@ def named_product(**parameters):
4444
# values = ( [likelihood_field,beam],[1, 10, 1000, 2000] )
4545
values = list(parameters.values())
4646

47-
# TO_DO: Empty list exception
47+
# TODO(teresa-ortega): Empty list exception
4848

4949
# Make combinations
5050
combinations = itertools.product(*values)
@@ -55,6 +55,6 @@ def named_product(**parameters):
5555
# Re-attach the parameter labels to the generated values.
5656
# zip() pairs keys with values; dict() creates the mapping.
5757
variant = dict(zip(keys, combination, strict=True))
58-
# TO_DO : combination fails
58+
# TODO(teresa-ortega) : combination fails
5959
variants.append(variant)
6060
return variants

test/common/test_named_product.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@pytest.mark.parametrize(
2323
"parameters, expected_combinations , expected_len",
2424
[
25-
( # Two parameters with 2 values each 2×2 = 4 combinations
25+
( # Two parameters with 2 values each -> 2×2 = 4 combinations
2626
{"sensor_model": ["likelihood_field", "beam"], "num_particles": [1, 10]},
2727
[
2828
{"sensor_model": "likelihood_field", "num_particles": 1},
@@ -32,21 +32,21 @@
3232
],
3333
4,
3434
),
35-
( # Single parameter with 2 values 2 combinations
35+
( # Single parameter with 2 values -> 2 combinations
3636
{"sensor_model": ["likelihood_field", "beam"]},
3737
[
3838
{"sensor_model": "likelihood_field"},
3939
{"sensor_model": "beam"},
4040
],
4141
2,
4242
),
43-
( # No parameters at all 1 combination: a single empty dict
43+
( # No parameters at all -> 1 combination: a single empty dict
4444
{},
4545
[{}],
4646
1,
4747
),
48-
( # One parameter with an empty list no combinations can be formed
49-
# TO_DO: if the user introduce a empty list -> Exception
48+
( # One parameter with an empty list -> no combinations can be formed
49+
# TODO(teresa-ortega): if the user introduce a empty list -> Exception
5050
{"sensor_model": [], "num_particles": [1]},
5151
[],
5252
0,

0 commit comments

Comments
 (0)