8000 Fix the right-border on unicode tables by orlitzky · Pull Request #39023 · sagemath/sage · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix the right-border on unicode tables #39023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 54 additions & 54 deletions src/sage/combinat/bijectionist.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,52 +69,52 @@
sage: a, b = bij.statistics_table()
sage: table(a, header_row=True, frame=True)
┌───────────┬────────┬────────┬────────┐
│ a | α_1(a) | α_2(a) | α_3(a) |
│ a α_1(a) α_2(a) α_3(a)
╞═══════════╪════════╪════════╪════════╡
│ [] | 0 | 0 | 0 |
│ [] 0 0 0
├───────────┼────────┼────────┼────────┤
│ [1] | 1 | 1 | 1 |
│ [1] 1 1 1
├───────────┼────────┼────────┼────────┤
│ [1, 2] | 2 | 2 | 2 |
│ [1, 2] 2 2 2
├───────────┼────────┼────────┼────────┤
│ [2, 1] | 2 | 1 | 0 |
│ [2, 1] 2 1 0
├───────────┼────────┼────────┼────────┤
│ [1, 2, 3] | 3 | 3 | 3 |
│ [1, 2, 3] 3 3 3
├───────────┼────────┼────────┼────────┤
│ [1, 3, 2] | 3 | 2 | 1 |
│ [1, 3, 2] 3 2 1
├───────────┼────────┼────────┼────────┤
│ [2, 1, 3] | 3 | 2 | 1 |
│ [2, 1, 3] 3 2 1
├───────────┼────────┼────────┼────────┤
│ [2, 3, 1] | 3 | 2 | 0 |
│ [2, 3, 1] 3 2 0
├───────────┼────────┼────────┼────────┤
│ [3, 1, 2] | 3 | 1 | 0 |
│ [3, 1, 2] 3 1 0
├───────────┼────────┼────────┼────────┤
│ [3, 2, 1] | 3 | 2 | 1 |
│ [3, 2, 1] 3 2 1
└───────────┴────────┴────────┴────────┘

sage: table(b, header_row=True, frame=True)
┌───────────┬───┬────────┬────────┬────────┐
│ b | τ | β_1(b) | β_2(b) | β_3(b) |
│ b τ β_1(b) β_2(b) β_3(b)
╞═══════════╪═══╪════════╪════════╪════════╡
│ [] | 0 | 0 | 0 | 0 |
│ [] 0 0 0 0
├───────────┼───┼────────┼────────┼────────┤
│ [1] | 1 | 1 | 1 | 1 |
│ [1] 1 1 1 1
├───────────┼───┼────────┼────────┼────────┤
│ [1, 2] | 2 | 2 | 1 | 0 |
│ [1, 2] 2 2 1 0
├───────────┼───┼────────┼────────┼────────┤
│ [2, 1] | 1 | 2 | 2 | 2 |
│ [2, 1] 1 2 2 2
├───────────┼───┼────────┼────────┼────────┤
│ [1, 2, 3] | 3 | 3 | 1 | 0 |
│ [1, 2, 3] 3 3 1 0
├───────────┼───┼────────┼────────┼────────┤
│ [1, 3, 2] | 2 | 3 | 2 | 1 |
│ [1, 3, 2] 2 3 2 1
├───────────┼───┼────────┼────────┼────────┤
│ [2, 1, 3] | 2 | 3 | 2 | 1 |
│ [2, 1, 3] 2 3 2 1
├───────────┼───┼────────┼────────┼────────┤
│ [2, 3, 1] | 2 | 3 | 2 | 1 |
│ [2, 3, 1] 2 3 2 1
├───────────┼───┼────────┼────────┼───── 10000 ──┤
│ [3, 1, 2] | 2 | 3 | 2 | 0 |
│ [3, 1, 2] 2 3 2 0
├───────────┼───┼────────┼────────┼────────┤
│ [3, 2, 1] | 1 | 3 | 3 | 3 |
│ [3, 2, 1] 1 3 3 3
└───────────┴───┴────────┴────────┴────────┘

sage: from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition
Expand Down Expand Up @@ -849,51 +849,51 @@
sage: a, b = bij.statistics_table()
sage: table(a, header_row=True, frame=True)
┌───────────┬────────┬────────┐
│ a | α_1(a) | α_2(a) |
│ a α_1(a) α_2(a)
╞═══════════╪════════╪════════╡
│ [] | 0 | 0 |
│ [] 0 0
├───────────┼────────┼────────┤
│ [1] | 1 | 1 |
│ [1] 1 1
├───────────┼────────┼────────┤
│ [1, 2] | 2 | 2 |
│ [1, 2] 2 2
├───────────┼────────┼────────┤
│ [2, 1] | 1 | 0 |
│ [2, 1] 1 0
├───────────┼────────┼────────┤
│ [1, 2, 3] | 3 | 3 |
│ [1, 2, 3] 3 3
├───────────┼────────┼────────┤
│ [1, 3, 2] | 2 | 1 |
│ [1, 3, 2] 2 1
├───────────┼────────┼────────┤
│ [2, 1, 3] | 2 | 1 |
│ [2, 1, 3] 2 1
├───────────┼────────┼────────┤
│ [2, 3, 1] | 2 | 0 |
│ [2, 3, 1] 2 0
├───────────┼────────┼────────┤
│ [3, 1, 2] | 1 | 0 |
│ [3, 1, 2] 1 0
├───────────┼────────┼────────┤
│ [3, 2, 1] | 2 | 1 |
│ [3, 2, 1] 2 1
└───────────┴────────┴────────┘
sage: table(b, header_row=True, frame=True)
┌───────────┬───┬────────┬────────┐
│ b | τ | β_1(b) | β_2(b) |
│ b τ β_1(b) β_2(b)
╞═══════════╪═══╪════════╪════════╡
│ [] | 0 | 0 | 0 |
│ [] 0 0 0
├───────────┼───┼────────┼────────┤
│ [1] | 1 | 1 | 1 |
│ [1] 1 1 1
├───────────┼───┼────────┼────────┤
│ [1, 2] | 2 | 1 | 0 |
│ [1, 2] 2 1 0
├───────────┼───┼────────┼────────┤
│ [2, 1] | 1 | 2 | 2 |
│ [2, 1] 1 2 2
├───────────┼───┼────────┼────────┤
│ [1, 2, 3] | 3 | 1 | 0 |
│ [1, 2, 3] 3 1 0
├───────────┼───┼────────┼────────┤
│ [1, 3, 2] | 2 | 2 | 1 |
│ [1, 3, 2] 2 2 1
├───────────┼───┼────────┼────────┤
│ [2, 1, 3] | 2 | 2 | 1 |
│ [2, 1, 3] 2 2 1
├───────────┼───┼────────┼────────┤
│ [2, 3, 1] | 2 | 2 | 1 |
│ [2, 3, 1] 2 2 1
├───────────┼───┼────────┼────────┤
│ [3, 1, 2] | 2 | 2 | 0 |
│ [3, 1, 2] 2 2 0
├───────────┼───┼────────┼────────┤
│ [3, 2, 1] | 1 | 3 | 3 |
│ [3, 2, 1] 1 3 3
└───────────┴───┴────────┴────────┘

TESTS:
Expand All @@ -906,27 +906,27 @@
sage: a, b = bij.statistics_table()
sage: table(a, header_row=True, frame=True)
┌────────┐
│ a |
│ a
╞════════╡
│ [] |
│ []
├────────┤
│ [1] |
│ [1]
├────────┤
│ [1, 2] |
│ [1, 2]
├────────┤
│ [2, 1] |
│ [2, 1]
└────────┘
sage: table(b, header_row=True, frame=True)
┌────────┬───┐
│ b | τ |
│ b τ
╞════════╪═══╡
│ [] | 0 |
│ [] 0
├────────┼───┤
│ [1] | 1 |
│ [1] 1
├────────┼───┤
│ [1, 2] | 2 |
│ [1, 2] 2
├────────┼───┤
│ [2, 1] | 1 |
│ [2, 1] 1
└────────┴───┘

We can omit the header::
Expand Down Expand Up @@ -3119,7 +3119,7 @@
sage: bij = Bijectionist(sum(As, []), sum(Bs, []))
sage: bij.set_statistics((lambda x: x[0], lambda x: x[0]))
sage: bij.set_intertwining_relations((2, c1, c1), (1, c2, c2))
sage: l = list(bij.solutions_iterator()); len(l) # long time -- (2.7 seconds with SCIP on AMD Ryzen 5 PRO 3500U w/ Radeon Vega Mobile Gfx)

Check warning on line 3122 in src/sage/combinat/bijectionist.py

View workflow job for this annotation

GitHub Actions / test-long (src/sage/[a-f]*)

Warning: slow doctest:

slow doctest:
64

A brute force check would be difficult::
Expand Down Expand Up @@ -3147,7 +3147,7 @@
sage: A = sum(As, [])
sage: respects_c1 = lambda s: all(c1(a1, a2) not in A or s[c1(a1, a2)] == c1(s[a1], s[a2]) for a1 in A for a2 in A)
sage: respects_c2 = lambda s: all(c2(a1) not in A or s[c2(a1)] == c2(s[a1]) for a1 in A)
sage: l2 = [s for s in it if respects_c1(s) and respects_c2(s)] # long time -- (17 seconds on AMD Ryzen 5 PRO 3500U w/ Radeon Vega Mobile Gfx)

Check warning on line 3150 in src/sage/combinat/bijectionist.py

View workflow job for this annotation

GitHub Actions / test-long (src/sage/[a-f]*)

Warning: slow doctest:

slow doctest:
sage: sorted(l1, key=lambda s: tuple(s.items())) == l2 # long time
True

Expand Down
Loading
Loading
0