Skip to content

Commit

Permalink
Corrected downset
Browse files Browse the repository at this point in the history
  • Loading branch information
engenmt committed Nov 6, 2023
1 parent fe2c2e0 commit ec06b42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/permpy/permset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`."""
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/permpy/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit ec06b42

Please sign in to comment.