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

py3: Fix combinat.designs module for python3 (final) #26837

Closed
vinklein mannequin opened this issue Dec 5, 2018 · 14 comments
Closed

py3: Fix combinat.designs module for python3 (final) #26837

vinklein mannequin opened this issue Dec 5, 2018 · 14 comments

Comments

@vinklein
Copy link
Mannequin

vinklein mannequin commented Dec 5, 2018

Fix the remaining python3 errors in combinat.designs module :

  • fix interface bewteen python3 and expat xml parser.
  • replace some map usage with list comprehesion. The former map usage resulting in empty lists and therefore multiple errors.
  • fix sorting issues in IncidenceStructure.__init__

Errors fixed :

sage -t --long src/sage/combinat/designs/ext_rep.py  # 11 doctests failed
sage -t --long src/sage/combinat/designs/bibd.py  # 6 doctests failed
sage -t --long src/sage/combinat/designs/difference_family.py  # 6 doctests failed
sage -t --long src/sage/combinat/designs/database.py  # 6 doctests failed

CC: @fchapoton

Component: python3

Author: Vincent Klein

Branch: 069a55f

Reviewer: Frédéric Chapoton

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

@vinklein vinklein mannequin added this to the sage-8.5 milestone Dec 5, 2018
@vinklein vinklein mannequin added c: python3 labels Dec 5, 2018
@vinklein
Copy link
Mannequin Author

vinklein mannequin commented Dec 5, 2018

Branch: u/vklein/26837

@vinklein
Copy link
Mannequin Author

vinklein mannequin commented Dec 5, 2018

New commits:

069a55fTrac #26837: Fix combinat/designs module for python3:

@vinklein

This comment has been minimized.

@vinklein
Copy link
Mannequin Author

vinklein mannequin commented Dec 5, 2018

Commit: 069a55f

@vinklein vinklein mannequin changed the title py3: Fix combinat.designs module for python3 py3: Fix combinat.designs module for python3 (final) Dec 5, 2018
@vinklein vinklein mannequin added the s: needs review label Dec 5, 2018
@vinklein
Copy link
Mannequin Author

vinklein mannequin commented Dec 5, 2018

Reviewer: chapoton

@vinklein

This comment has been minimized.

@vinklein
Copy link
Mannequin Author

vinklein mannequin commented Dec 5, 2018

Changed reviewer from chapoton to none

@fchapoton
Copy link
Contributor

comment:5

green patchbot => positive review

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:6

ok

@vinklein
Copy link
Mannequin Author

vinklein mannequin commented Dec 6, 2018

comment:7

Merci!

@vbraun
Copy link
Member

vbraun commented Dec 8, 2018

Changed branch from u/vklein/26837 to 069a55f

@jdemeyer
Copy link

comment:9

This change doesn't quite work:

-                self._points = sorted(points)
-                if self._points == list(range(len(points))) and all(isinstance(x,(int,Integer)) for x in self._points):
+                # if points are tuple, sort None before int types and str after int types
+                sortkey = lambda e: [(0 if x is None else 2 if isinstance(x, str) else 1, x) for x in e]\
+                    if isinstance(e, tuple) else e
+                self._points = sorted(points, key=sortkey)

See #26938.

@jdemeyer
Copy link

Changed commit from 069a55f to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants