interfaces

Submodules

permuta.interfaces.Displayable module

class permuta.interfaces.Displayable.Displayable

Bases: object

display()

Display on screen.

export()

Export to file.

plot()

Plot a la matplotlib.

Returns a matplotlib Axes object or None.

permuta.interfaces.Flippable module

class permuta.interfaces.Flippable.Flippable

Bases: abc.ABC

flip_antidiagonal()

Return self flipped along the antidiagonal.

flip_diagonal()

Return self flipped along the diagonal.

flip_horizontal()

Return self flipped horizontally.

flip_vertical()

Return self flipped vertically.

permuta.interfaces.Patt module

class permuta.interfaces.Patt.Patt

Bases: abc.ABC

avoided_by(*perms)

Check if self is avoided by perms.

Parameters:
  • self – A classical/mesh pattern.
  • perms – [permuta.Permutation] A list of permutations.
Returns: bool
True if and only if every permutation in perms avoids self.
contained_in(*perms)

Check if self is a pattern of perms.

Parameters:
  • self – A classical/mesh pattern.
  • perms – [permuta.Permutation] A list of permutations.
Returns: bool
True if and only if self is a pattern of all permutations in perms.
count_occurrences_in(perm)

Count the number of occurrences of self in perm.

Parameters:
  • self – A classical/mesh pattern.
  • perm – permuta.Permutation A permutation.
Returns: int
The number of times self occurs in perm.
occurrences_in(perm)

Find all indices of occurrences of self in perm.

permuta.interfaces.Rotatable module

class permuta.interfaces.Rotatable.Rotatable

Bases: abc.ABC

rotate(times=1)

Return self rotated 90 degrees to the right.

rotate_left(times=1)

Return self rotated 90 degrees to the left.

rotate_right(times=1)

Return self rotated 90 degrees to the right.

permuta.interfaces.Shiftable module

class permuta.interfaces.Shiftable.Shiftable

Bases: abc.ABC

shift_down(times=1)

Return self shifted times steps down.

If times is negative, shifted up.

shift_left(times=1)

Return self shifted times steps to the left.

If times is negative, shifted to the right.

shift_right(times=1)

Return self shifted times steps to the right.

If shift is negative, shifted to the left.

shift_up(times=1)

Return self shifted times steps up.

If times is negative, shifted down.

Module contents