Skip to content

Commit ba56b81

Browse files
ArmavicaricardoV94
authored andcommitted
Fix RUF015
1 parent 07a14f2 commit ba56b81

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

pymc/backends/mcbackend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def get_sampler_stats(
169169
is_ragged = True
170170
continue
171171
else:
172-
stats_arrays.append(tuple(sd.values())[0])
172+
stats_arrays.append(next(iter(sd.values())))
173173

174174
if is_ragged:
175175
_log.debug("Stat '%s' was not recorded by all samplers.", stat_name)

pymc/distributions/truncated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def loop_fn(truncated_rv, reject_draws, lower, upper, rng, *rv_inputs):
247247
return TruncatedRV(
248248
base_rv_op=dist.owner.op,
249249
inputs=graph_inputs_,
250-
outputs=[tuple(updates.values())[0], truncated_rv_],
250+
outputs=[next(iter(updates.values())), truncated_rv_],
251251
ndim_supp=0,
252252
max_n_steps=max_n_steps,
253253
)(*graph_inputs)

tests/logprob/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_factorized_joint_logprob_basic():
7171
a_value_var = a.clone()
7272

7373
a_logp = conditional_logp({a: a_value_var})
74-
a_logp_comb = tuple(a_logp.values())[0]
74+
a_logp_comb = next(iter(a_logp.values()))
7575
a_logp_exp = logp(a, a_value_var)
7676

7777
assert equal_computations([a_logp_comb], [a_logp_exp])

tests/test_pytensorf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def step_wo_update(x, rng):
583583
n_steps=10,
584584
)
585585

586-
assert collect_default_updates([ys]) == {rng: tuple(next_rng.values())[0]}
586+
assert collect_default_updates([ys]) == {rng: next(iter(next_rng.values()))}
587587

588588
fn = compile_pymc([], ys, random_seed=1)
589589
assert not (set(fn()) & set(fn()))

0 commit comments

Comments
 (0)