Skip to content
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

Meta-ticket: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories #12913

Closed
nthiery opened this issue May 6, 2012 · 18 comments · Fixed by #37722
Closed

Meta-ticket: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories #12913

nthiery opened this issue May 6, 2012 · 18 comments · Fixed by #37722

Comments

@nthiery
Copy link
Contributor

nthiery commented May 6, 2012

All classes that currently inherit from CombinatorialClass should instead inherit from Parent and register themselves in one of the categories (*EnumeratedSets, *FiniteEnumeratedSets, or *InfiniteEnumeratedSets). For examples, see e.g. FiniteEnumeratedSets().example().

  • Expected benefits:
    • Uniform interface
    • Support for TestSuite
    • Support for conversions, coercions, and morphisms, in particular for bijections (as morphisms in the category of Sets with bijection, with properly defined domain and co-domain rather than python functions).
  • Steps:
    1. Let CombinatorialClass inherits from Parent (mostly done Have CombinatorialClass inherits from Parent #8910)
    2. For each CombinatorialClass C:
    • Have C inherit directly from Parent
    • Ensure that C.__init__ sets up the proper category (Finite|Infinite)...
    • Add TestSuite(C).run() to the doctests and make all the tests pass
    • Have a properly setup attribute C.Element and use C.element_class (as defined by the categories) when constructing elements
    • Ensure proper unique representation behavior by having C inherit both from UniqueRepresentation and Parent
    1. Deprecate and remove CombinatorialClass
    2. Turn all the factory functions into factory classes by mean of ClasscallMetaClass; see PerfectMatching and Trees for an advanced example.

See also: http://wiki.sagemath.org/CombinatorialClass

CC: @sagetrac-sage-combinat

Component: combinatorics

Issue created by migration from https://trac.sagemath.org/ticket/12913

@nthiery

This comment has been minimized.

@tscrim
Copy link
Collaborator

tscrim commented Feb 6, 2013

comment:2

Part of the work is done in #13605 (partition.py) and #14063 (compositions). More to come.

@tscrim
Copy link
Collaborator

tscrim commented Mar 7, 2013

comment:3

More work:

@tscrim
Copy link
Collaborator

tscrim commented Jun 28, 2013

comment:4

Permutations in #14772.

@tscrim
Copy link
Collaborator

tscrim commented Jul 8, 2013

comment:5

Integer vectors in #12453.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@fchapoton
Copy link
Contributor

comment:10

Status

git grep -c "import.*CombinatorialClass"
src/sage/categories/enumerated_sets.py:1
src/sage/combinat/all.py:1
src/sage/combinat/cartesian_product.py:1
src/sage/combinat/combination.py:1
src/sage/combinat/finite_class.py:1
src/sage/combinat/graph_path.py:1
src/sage/combinat/multichoose_nk.py:1
src/sage/combinat/necklace.py:1
src/sage/combinat/non_decreasing_parking_function.py:1
src/sage/combinat/parking_functions.py:1
src/sage/combinat/partition.py:1
src/sage/combinat/restricted_growth.py:1
src/sage/combinat/root_system/root_lattice_realizations.py:1
src/sage/combinat/sf/ns_macdonald.py:1
src/sage/combinat/species/structure.py:1
src/sage/combinat/symmetric_group_representations.py:1
src/sage/combinat/tuple.py:1
src/sage/combinat/words/shuffle_product.py:1
src/sage/dynamics/flat_surfaces/strata.py:2
src/sage/graphs/linearextensions.py:1
src/sage/sets/family.py:1

@fchapoton fchapoton modified the milestones: sage-6.4, sage-8.0 Jun 1, 2017
@tscrim
Copy link
Collaborator

tscrim commented Jun 2, 2017

comment:11

That's actually slightly worse than I thought, but it is good progress. I suspect most of them should be easy changes. From a quick look:

src/sage/combinat/root_system/root_lattice_realizations.py

is easy to fix as per the comment there (which really moves the issue to the EnumeratedSets category).

However

src/sage/combinat/symmetric_group_representations.py

is harder as the CombinatorialClass is behaving something between a category and a parent. At least its elements are morphisms from the SGA to a matrix space, but not with the same codomain. Also, I think of a representation as a vector space with an action together. Well, representation theory in Sage is sorely lacking currently and is something I've only been able to work on in a limited capacity so far.

@fchapoton
Copy link
Contributor

comment:12

see #23422

@fchapoton
Copy link
Contributor

comment:13

see #24485 for necklaces

and #24486 for "restricted growth arrays"

@fchapoton
Copy link
Contributor

comment:14

#26384 for non-decreasing parking functions

@fchapoton
Copy link
Contributor

comment:15

@fchapoton
Copy link
Contributor

comment:16

remains now

  • sage/categories/enumerated_sets.py:1
  • sage/combinat/combination.py:1
  • ~~sage/combinat/graph_path.py:1
  • sage/combinat/parking_functions.py:1
  • ~~sage/combinat/shuffle.py:1
  • sage/combinat/species/structure.py:1
  • ~~sage/combinat/symmetric_group_representations.py:1
  • sage/combinat/words/shuffle_product.py:1
  • sage/sets/family.py:1 (easy removal, but must be done at the end)

@fchapoton
Copy link
Contributor

comment:17

@mantepse
Copy link
Contributor

comment:18

@fchapoton: concerning the species problem, would you be interested in participating in an online species workshop in February - both as mathematician and as sagemath aficionado?

@fchapoton
Copy link
Contributor

comment:19

Oh, there seems to remains more with sub-classes (including MapCombinatorialClass) in

src/sage/categories/enumerated_sets.py
src/sage/combinat/combinat.py

@fchapoton
Copy link
Contributor

comment:20

deprecating the unused variants in #31545

@mkoeppe mkoeppe changed the title Deprecate CombinatorialClass in favor of the EnumeratedSet's categories Meta-ticket: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories Jul 4, 2021
@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 4, 2021

comment:22

I have opened #32121 for MapCombinatorialClass.

@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 19, 2022

comment:23

#33384: Deprecate global imports of CombinatorialObject, CombinatorialClass, MapCombinatorialClass

@mkoeppe mkoeppe removed this from the sage-8.0 milestone Dec 29, 2022
vbraun pushed a commit to vbraun/sage that referenced this issue Apr 20, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

- Fixes sagemath#36133
- Fixes sagemath#33384
- Fixes sagemath#19474
- Fixes sagemath#12913

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37722
Reported by: Matthias Köppe
Reviewer(s): Martin Rubey, Matthias Köppe, Travis Scrimshaw
@vbraun vbraun closed this as completed in 46b7ec2 May 2, 2024
@mkoeppe mkoeppe added this to the sage-10.4 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants