From ec06b4224f3bd45d5c94d34505611b60ce314453 Mon Sep 17 00:00:00 2001 From: Michael Engen Date: Sun, 5 Nov 2023 21:26:10 -0500 Subject: [PATCH] Corrected downset --- src/permpy/permset.py | 4 ++-- src/permpy/permutation.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/permpy/permset.py b/src/permpy/permset.py index 48648bb..49549c0 100644 --- a/src/permpy/permset.py +++ b/src/permpy/permset.py @@ -58,7 +58,7 @@ def union(self, other): def get_random(self): """Return a random element from the set.""" - return random.sample(list(self), 1)[0] + return random.sample(self, 1)[0] def by_length(self): """Return a dictionary stratifying the permutations in `self`.""" @@ -169,7 +169,7 @@ def upset(self, up_to_length): return upset - def downset(self): + def downset(self, min_size): """Return the downset of `self` as a list.""" bottom_edge = PermSet() bottom_edge.update(self) diff --git a/src/permpy/permutation.py b/src/permpy/permutation.py index dd15d79..708e0bd 100644 --- a/src/permpy/permutation.py +++ b/src/permpy/permutation.py @@ -1031,7 +1031,7 @@ def downset(self, min_length=0): else: new_perms[tau] = i - downset.append(new_perms) + downset.append(set(new_perms.keys())) return downset[::-1]