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

Deprecate FiniteEnumeratedSet in the global namespace, add method is_subset to Sets.ParentMethods #34398

Open
mkoeppe opened this issue Aug 20, 2022 · 8 comments · May be fixed by #37527
Open

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2022

We unify the classes Set_object_enumerated and FiniteEnumeratedSet.

The only difference should be that one uses a frozenset (fast look ups, slow indexing via iteration), the other uses a tuple (slow look ups, fast indexing). And we should have the option to get both operations fast. We get this for free by the category FiniteEnumeratedSets.

We add to the methods provided by Sets.ParentMethods:

We add to the methods provided by FiniteEnumeratedSets.ParentMethods:

  • frozenset (to complement list)
  • specialization of is_subset etc. by iteration or delegating to frozenset
  • alternate spellings issubset etc. used by the Python library) for finite enumerated sets - for interoperability with Python set, frozenset

Then we deprecate the import of FiniteEnumeratedSet in the global namespace in favor of using the constructor Set.

CC: @tscrim

Component: combinatorics

Branch/Commit: u/mkoeppe/deprecate_finiteenumeratedset_in_the_global_namespace @ cca78af

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

@mkoeppe mkoeppe added this to the sage-9.7 milestone Aug 20, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 20, 2022

Changed dependencies from #34376 to #34376, #34400

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 21, 2022

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 21, 2022

Last 10 new commits:

e63e4f0Set_object.is_finite: Check category
970d467Set_object.cardinality: Check category
e58d2abSet_object_intersection.cardinality: Remove; move delegation to super to Set_object
f0ca8e1Merge #34376
bf55dafEnumeratedSets.ParentMethods.tuple: New, replace many uses of list
d573cbfInfiniteEnumeratedSets.ParentMethods.tuple: New
192a5a2src/sage/categories/enumerated_sets.py: Add doc
d62fe4csrc/sage/categories/enumerated_sets.py: Fix _tuple_from_iterator
ab3f1d7Merge #34400
cca78afsrc/sage/categories/enumerated_sets.py: Add parent methods frozenset, is_subset

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 21, 2022

Commit: cca78af

@mkoeppe mkoeppe changed the title Deprecate FiniteEnumeratedSet in the global namespace Deprecate FiniteEnumeratedSet in the global namespace, add method is_subset to EnumeratedSets Aug 21, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 1, 2022

Changed dependencies from #34376, #34400 to none

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Deprecate FiniteEnumeratedSet in the global namespace, add method is_subset to EnumeratedSets Deprecate FiniteEnumeratedSet in the global namespace, add method is_subset to Sets.ParentMethods Sep 1, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe modified the milestones: sage-10.0, sage-10.1 Apr 30, 2023
@mkoeppe mkoeppe removed this from the sage-10.1 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant