Skip to content

Commit 66ce5e8

Browse files
chore: update pre-commit hooks (#32)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](astral-sh/ruff-pre-commit@v0.1.14...v0.2.0) * style: pre-commit fixes * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Luis Antonio Obis Aparicio <[email protected]>
1 parent ad6df85 commit 66ce5e8

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
- id: black
3232

3333
- repo: https://github.com/astral-sh/ruff-pre-commit
34-
rev: v0.1.14
34+
rev: v0.2.0
3535
hooks:
3636
- id: ruff
3737
args: [--fix-only, --show-fixes]

src/geant4_python_application/application.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,23 @@ def run(self, primaries: int | ak.Array):
183183
for key in events[0].keys()
184184
}
185185
# make sure they all have the same length
186-
for key in concatenated_dict.keys():
186+
for key in concatenated_dict:
187187
if len(concatenated_dict[key]) != len(
188188
concatenated_dict[list(concatenated_dict.keys())[0]]
189189
):
190190
raise ValueError(f"Length mismatch for key {key}")
191191

192192
keys_to_remove = set()
193193
step_array_dict = {}
194-
for key in concatenated_dict.keys():
194+
for key in concatenated_dict:
195195
prefix = "step_"
196196
if key.startswith(prefix):
197197
new_key = key[len(prefix) :]
198198
step_array_dict[new_key] = concatenated_dict[key]
199199
keys_to_remove.add(key)
200200

201201
track_array_dict = {}
202-
for key in concatenated_dict.keys():
202+
for key in concatenated_dict:
203203
prefix = "track_"
204204
if key.startswith(prefix):
205205
new_key = key[len(prefix) :]
@@ -211,9 +211,7 @@ def run(self, primaries: int | ak.Array):
211211
**{
212212
key: concatenated_dict[key]
213213
for key in [
214-
key
215-
for key in concatenated_dict.keys()
216-
if key not in keys_to_remove
214+
key for key in concatenated_dict if key not in keys_to_remove
217215
]
218216
},
219217
**(
@@ -222,15 +220,15 @@ def run(self, primaries: int | ak.Array):
222220
{
223221
**{
224222
key: track_array_dict[key]
225-
for key in track_array_dict.keys()
223+
for key in track_array_dict
226224
},
227225
**(
228226
{
229227
"step": ak.Array(
230228
{
231229
**{
232230
key: step_array_dict[key]
233-
for key in step_array_dict.keys()
231+
for key in step_array_dict
234232
}
235233
},
236234
with_name="step",

0 commit comments

Comments
 (0)