Skip to content

Commit 26d526f

Browse files
committed
Add code for merging duplicated dictionaries
1 parent 89e384c commit 26d526f

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ ignore = [
8686
### Edmund's preferences
8787
"UP009", # "UTF-8 encoding declaration is unnecessary". Adding UTF-8 pragmas is best practice
8888
"T201", # Allow print statements!
89+
"ERA001", # Don't remove commented out code
8990
"FIX002",
9091
"TD", # Allow TODOs in code (controversial, I know...)
9192
"INP001", # "Add an `__init__.py`". The `test` directory should be a namespace package (https://stackoverflow.com/a/8450858)!

src/hpc_multibench/yaml_model.py

+12
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ def matrix_iterator(self) -> Iterator[dict[str, Any]]:
138138
for key, values in self.matrix.items()
139139
]
140140
for combination in product(*shaped):
141+
# # Consider the case
142+
# # [sbatch_config, sbatch_config]:
143+
# # - [{"nodes": 2}, {"mem-per-cpu": 1000}]
144+
# #
145+
# variables = {}
146+
# for items in combination:
147+
# for item in items:
148+
# if item[0] in variables and isinstance(item[1], dict):
149+
# variables[item[0]].update(item[1])
150+
# else:
151+
# variables[item[0]] = item[1]
152+
# yield variables
141153
yield {item[0]: item[1] for items in combination for item in items}
142154

143155

yaml_examples/kudu_plan.yaml

+12-3
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,18 @@ benches:
119119
run_command:
120120
- "foo"
121121
- "bar"
122-
[args, sbatch_config]:
123-
- ["100 100 100", {"mem-per-cpu": 1000}]
124-
- ["200 200 200", {"mem-per-cpu": 2000}]
122+
# [args, sbatch_config]:
123+
# - ["100 100 100", {"mem-per-cpu": 1000}]
124+
# - ["200 200 200", {"mem-per-cpu": 2000}]
125+
126+
# sbatch_config:
127+
# - "nodes": 2
128+
# "mem-per-cpu": 1000
129+
# - "nodes": 1
130+
# "mem-per-cpu": 2000
131+
[sbatch_config, sbatch_config]:
132+
- [{"nodes": 2}, {"mem-per-cpu": 1000}]
133+
- [{"nodes": 1}, {"mem-per-cpu": 2000}]
125134
analysis:
126135
metrics:
127136
"name": "===== RUN (.*) ====="

0 commit comments

Comments
 (0)