Skip to content

Commit ebea3df

Browse files
committed
remove redundant casts to set
1 parent 27b5f97 commit ebea3df

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

bilby/core/prior/dict.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,11 +887,12 @@ def rescale(self, keys, theta):
887887
distname = self[key].dist.distname
888888
names = set(self[key].dist.names)
889889
if distname not in joint:
890-
joint[distname] = [key]
890+
joint[distname] = {key}
891891
elif isinstance(self[key], JointPrior):
892-
joint[distname].append(key)
892+
joint[distname].add(key)
893893
# only when all names have been rescaled, we can set the values
894-
if set(names) == set(joint[distname]):
894+
# we use sets because the order does not matter here
895+
if names == joint[distname]:
895896
for name, value in zip(names, result[key]):
896897
result[name] = value
897898
self[name].least_recently_sampled = value

0 commit comments

Comments
 (0)