Skip to content

Commit 7dd8f87

Browse files
Merge pull request #195 from PermutaTriangle/develop
Version 2.3.0
2 parents 1fb948a + 32cfb32 commit 7dd8f87

29 files changed

+453
-1329
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-python@v2
1414
with:
15-
python-version: 3.8
15+
python-version: "3.10"
1616
- name: install dependencies
1717
run: |
1818
python -m pip install --upgrade pip

.github/workflows/test.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
include:
12-
- python: 3.8
12+
- python: "3.11"
1313
toxenv: flake8
1414
os: ubuntu-latest
15-
- python: 3.8
15+
- python: "3.11"
1616
toxenv: mypy
1717
os: ubuntu-latest
18-
- python: 3.8
18+
- python: "3.11"
1919
toxenv: pylint
2020
os: ubuntu-latest
21-
- python: 3.8
21+
- python: "3.11"
2222
toxenv: black
2323
os: ubuntu-latest
2424

25-
- python: 3.7
26-
toxenv: py37
27-
os: ubuntu-latest
2825
- python: 3.8
2926
toxenv: py38
3027
os: ubuntu-latest
@@ -34,25 +31,31 @@ jobs:
3431
- python: "3.10"
3532
toxenv: py310
3633
os: ubuntu-latest
37-
- python: pypy-3.7
38-
toxenv: pypy37
34+
- python: "3.11"
35+
toxenv: py311
36+
os: ubuntu-latest
37+
- python: "3.12"
38+
toxenv: py312
39+
os: ubuntu-latest
40+
- python: 'pypy3.9'
41+
toxenv: pypy39
3942
os: ubuntu-latest
4043

41-
- python: 3.8
42-
toxenv: py38
44+
- python: "3.11"
45+
toxenv: py311
4346
os: macos-latest
44-
- python: 3.8
45-
toxenv: py38
47+
- python: "3.11"
48+
toxenv: py311
4649
os: windows-latest
4750

4851
runs-on: ${{ matrix.os }}
4952
steps:
50-
- uses: actions/checkout@v2
51-
- uses: actions/setup-python@v2
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-python@v5
5255
with:
5356
python-version: ${{ matrix.python }}
5457
- name: install dependencies
55-
run: python -m pip install --upgrade pip tox
58+
run: python -m pip install --upgrade pip tox setuptools wheel
5659
- name: run
5760
env:
5861
TOXENV: ${{ matrix.toxenv }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 21.9b0
3+
rev: 22.10.0
44
hooks:
55
- id: black

.pylintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ ignore-patterns=test_.*?py,
77
bisc_subfunctions.py
88
ignore= tests
99
init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc())+'/permuta')"
10-
disable=bad-continuation,
11-
missing-module-docstring,
10+
disable=missing-module-docstring,
1211
fixme,
1312
unsubscriptable-object,
1413
unspecified-encoding

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7-
## Unreleased
7+
## Unreleased
8+
9+
## 2.3.0 - 2024-04-03
10+
### Changed
11+
- Updated dependency on automata-lib to version 7.0.1
12+
- Perm.avoids/contains will raise a TypeError if input is not an iterable of Patt
13+
14+
### Added
15+
- Now testing on Python 3.11
16+
- 'simple' to the permtool command for checking if finitely many simples in a class
17+
18+
### Fixed
19+
- bug in autobisc during setup
820

921
## 2.2.0 - 2021-10-21
1022
### Added
@@ -29,6 +41,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2941
### Changed
3042
- Functions for ascents and descents now take an optional argument to specify what step size to calculate.
3143
- Moved sorting functions from `permuta/bisc/perm_properties.py` to `permuta/patterns/perm.py`.
44+
- If you pass an iterable (that is not a perm) to a contains method, then it will now raise an error.
45+
These should be passed with the splat '*'.
3246

3347
## 2.0.3 - 2021-04-28
3448
### Added

README.rst

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ permuta
1818
.. image:: https://requires.io/github/PermutaTriangle/Permuta/requirements.svg?branch=master
1919
:target: https://requires.io/github/PermutaTriangle/Permuta/requirements/?branch=master
2020
:alt: Requirements Status
21-
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4725759.svg
22-
:target: https://doi.org/10.5281/zenodo.4725759
21+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4725758.svg
22+
:target: https://doi.org/10.5281/zenodo.4725758
2323

2424
Permuta is a Python library for working with perms (short for permutations),
2525
patterns, and mesh patterns.
@@ -114,6 +114,21 @@ Printing perms gives zero-based strings.
114114
>>> print(Perm((6, 2, 10, 9, 3, 8, 0, 1, 5, 11, 4, 7)))
115115
(6)(2)(10)(9)(3)(8)(0)(1)(5)(11)(4)(7)
116116
117+
To get an iterator of all permutations of a certain length you can use
118+
119+
.. code-block:: python
120+
121+
>>> Perms4 = Perm.of_length(4)
122+
123+
You can run a for-loop over this iterator if you need to do something with all
124+
the permutations of this size. If you just want a specific permutation of this
125+
size you might be better off using the unrank function.
126+
127+
.. code-block:: python
128+
129+
>>> Perm.unrank(23,4)
130+
Perm((3, 2, 1, 0))
131+
117132
The avoids, contains, and occurrence methods enable working with patterns:
118133

119134
.. code-block:: python
@@ -206,6 +221,11 @@ given class.
206221
>>> for strat in find_strategies(basis):
207222
... print(strat.reference())
208223
Enumeration of Permutation Classes and Weighted Labelled Independent Sets: Corollary 4.3
224+
>>> basis = [Perm((1, 3, 0, 2)), Perm((2, 0, 3, 1))]
225+
>>> for strat in find_strategies(basis):
226+
... print(strat.reference())
227+
Enumeration of Permutation Classes and Weighted Labelled Independent Sets: Corollary 4.6
228+
The class contains only finitely many simple permutations
209229
210230
Permutation statistics
211231
######################
@@ -506,6 +526,6 @@ Citing
506526
If you found this library helpful with your research and would like to cite us,
507527
you can use the following `BibTeX`_ or go to `Zenodo`_ for alternative formats.
508528

509-
.. _BibTex: https://zenodo.org/record/4725759/export/hx#.YImTibX7SUk
529+
.. _BibTex: https://zenodo.org/record/4945792/export/hx#.YImTibX7SUk
510530

511-
.. _Zenodo: https://doi.org/10.5281/zenodo.4725759
531+
.. _Zenodo: https://doi.org/10.5281/zenodo.4725758

mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[mypy]
2+
check_untyped_defs = True
23
warn_return_any = True
34
warn_unused_configs = True
45
warn_no_return = False

permuta/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from .patterns import BivincularPatt, CovincularPatt, MeshPatt, Perm, VincularPatt
22
from .perm_sets.permset import Av, Basis, MeshBasis
33

4-
__version__ = "2.2.0"
4+
__version__ = "2.3.0"
55

66
__all__ = [
77
"Perm",

permuta/bisc/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# type: ignore
2+
13
from .bisc import auto_bisc, bisc, create_bisc_input, read_bisc_file, write_bisc_files
24
from .bisc_subfunctions import (
35
patterns_suffice_for_bad,

permuta/bisc/bisc.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# type: ignore
2+
13
import json
24
import os
35
import types
@@ -17,7 +19,6 @@
1719

1820

1921
def bisc(A, m, n=None, report=False):
20-
2122
if isinstance(A, list):
2223
D = defaultdict(list)
2324
for perm in A:
@@ -54,7 +55,6 @@ def bisc(A, m, n=None, report=False):
5455

5556

5657
def auto_bisc(prop):
57-
5858
L = 8 # Want to sanity check on at least S8, and one above n
5959
n = 4
6060
m = 2
@@ -69,10 +69,10 @@ def auto_bisc(prop):
6969
if L not in A.keys():
7070
print("You should have permutations up to length at least 8")
7171
return
72-
for i in range(L + 1):
73-
for perm in Perm.of_length(i):
74-
if perm not in A[i]:
75-
B[i].append(perm)
72+
for i in range(max(L + 1, max(A.keys()) + 1)):
73+
if i > 7:
74+
print("Populating the dictionary of bad perms of length ", i)
75+
B[i] = [perm for perm in Perm.of_length(i) if perm not in A[i]]
7676

7777
elif isinstance(prop, types.FunctionType):
7878
# If a property is passed in then we use it to populate both
@@ -212,7 +212,7 @@ def auto_bisc(prop):
212212
oldL = L
213213
if L < n + 1:
214214
L = n + 1
215-
if isinstance(prop, list) and L > max(A.keys):
215+
if isinstance(prop, list) and L > max(A.keys()):
216216
print("You need to input a longer list of permutations")
217217
return
218218

@@ -272,7 +272,6 @@ def create_bisc_input(N, prop):
272272
A, B = {}, {}
273273

274274
for n in range(N + 1):
275-
276275
An, Bn = [], []
277276

278277
for perm in Perm.of_length(n):

0 commit comments

Comments
 (0)