Skip to content

Commit 35dd87a

Browse files
committed
Use list literals
1 parent ca13ed6 commit 35dd87a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pymc/variational/opvi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,11 @@ def collect_shared_to_list(params):
526526
List
527527
"""
528528
if isinstance(params, dict):
529-
return list(
529+
return [
530530
t[1]
531531
for t in sorted(params.items(), key=lambda t: t[0])
532532
if isinstance(t[1], pytensor.compile.SharedVariable)
533-
)
533+
]
534534
elif params is None:
535535
return []
536536
else:

tests/logprob/test_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ def test_intermediate_rv(self):
151151
res_ancestors = list(ancestors((res,)))
152152

153153
assert (
154-
len(list(n for n in res_ancestors if n.owner and isinstance(n.owner.op, MeasurableOp)))
155-
== 1
154+
len([n for n in res_ancestors if n.owner and isinstance(n.owner.op, MeasurableOp)]) == 1
156155
)
157156

158157
assert c_value_var in res_ancestors

0 commit comments

Comments
 (0)