Commit a62543d
Release Manager
gh-35582: Fix discrepancy in partitions between provided number and starting partition
### 📚 Description
The behavior of `Partitions(n, starting=mu)` is confusing. It iterates
over partitions starting with `mu`, but it is not required that `mu` be
a partition of `n`. For example:
```
sage: P = Partitions(5, starting=[3,1]); print(P); list(P)
Partitions of the integer 5 starting with [3, 1]
[[3, 1], [2, 2], [2, 1, 1], [1, 1, 1, 1]]
```
These are partitions of `4` not of `5`. The change is to add a
`ValueError` in `Partitions_starting` to assert that `n`
must agree with the weight of `mu`.
The example above was drawn from the tests, so a few tests are changed
so that they now pass.
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation accordingly.
### ⌛ Dependencies
<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
URL: #35582
Reported by: trevorkarn
Reviewer(s): Travis Scrimshaw, trevorkarn
2 files changed
+57
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | | - | |
814 | | - | |
| 813 | + | |
| 814 | + | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
| 817 | + | |
| 818 | + | |
824 | 819 | | |
825 | 820 | | |
826 | 821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7451 | 7451 | | |
7452 | 7452 | | |
7453 | 7453 | | |
| 7454 | + | |
| 7455 | + | |
| 7456 | + | |
| 7457 | + | |
| 7458 | + | |
| 7459 | + | |
| 7460 | + | |
| 7461 | + | |
| 7462 | + | |
| 7463 | + | |
| 7464 | + | |
| 7465 | + | |
| 7466 | + | |
| 7467 | + | |
| 7468 | + | |
| 7469 | + | |
7454 | 7470 | | |
7455 | 7471 | | |
7456 | 7472 | | |
| |||
7497 | 7513 | | |
7498 | 7514 | | |
7499 | 7515 | | |
| 7516 | + | |
| 7517 | + | |
| 7518 | + | |
| 7519 | + | |
| 7520 | + | |
| 7521 | + | |
| 7522 | + | |
| 7523 | + | |
7500 | 7524 | | |
7501 | | - | |
| 7525 | + | |
| 7526 | + | |
| 7527 | + | |
| 7528 | + | |
| 7529 | + | |
| 7530 | + | |
| 7531 | + | |
| 7532 | + | |
| 7533 | + | |
7502 | 7534 | | |
7503 | 7535 | | |
7504 | 7536 | | |
| |||
7545 | 7577 | | |
7546 | 7578 | | |
7547 | 7579 | | |
| 7580 | + | |
| 7581 | + | |
7548 | 7582 | | |
7549 | 7583 | | |
7550 | 7584 | | |
| |||
7554 | 7588 | | |
7555 | 7589 | | |
7556 | 7590 | | |
| 7591 | + | |
7557 | 7592 | | |
7558 | 7593 | | |
7559 | 7594 | | |
| |||
7590 | 7625 | | |
7591 | 7626 | | |
7592 | 7627 | | |
| 7628 | + | |
| 7629 | + | |
7593 | 7630 | | |
| 7631 | + | |
| 7632 | + | |
7594 | 7633 | | |
7595 | 7634 | | |
7596 | 7635 | | |
7597 | 7636 | | |
7598 | 7637 | | |
7599 | 7638 | | |
7600 | 7639 | | |
7601 | | - | |
| 7640 | + | |
| 7641 | + | |
| 7642 | + | |
| 7643 | + | |
7602 | 7644 | | |
7603 | 7645 | | |
7604 | 7646 | | |
7605 | 7647 | | |
| 7648 | + | |
| 7649 | + | |
7606 | 7650 | | |
| 7651 | + | |
7607 | 7652 | | |
7608 | 7653 | | |
7609 | | - | |
| 7654 | + | |
| 7655 | + | |
| 7656 | + | |
| 7657 | + | |
| 7658 | + | |
| 7659 | + | |
7610 | 7660 | | |
7611 | 7661 | | |
7612 | 7662 | | |
| |||
0 commit comments