Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#26837 closed enhancement (fixed)

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

Reported by: vklein Owned by:
Priority: major Milestone: sage-8.5
Component: python3 Keywords:
Cc: chapoton Merged in:
Authors: Vincent Klein Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 069a55f (Commits) Commit:
Dependencies: Stopgaps:

Description (last modified by vklein)

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

Change History (9)

comment:1 Changed 11 months ago by vklein

  • Branch set to u/vklein/26837

comment:2 Changed 11 months ago by vklein

  • Commit set to 069a55ffb1c3f0f460b78d5d6ef37a9b86f821f1
  • Description modified (diff)
  • Status changed from new to needs_review
  • Summary changed from py3: Fix combinat.designs module for python3 to py3: Fix combinat.designs module for python3 (final)

New commits:

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

comment:3 Changed 11 months ago by vklein

  • Description modified (diff)
  • Reviewers set to chapoton

comment:4 Changed 11 months ago by vklein

  • Cc chapoton added
  • Reviewers chapoton deleted

comment:5 Changed 11 months ago by chapoton

  • Reviewers set to Frédéric Chapoton

green patchbot => positive review

comment:6 Changed 11 months ago by chapoton

  • Status changed from needs_review to positive_review

ok

comment:7 Changed 11 months ago by vklein

Merci!

comment:8 Changed 11 months ago by vbraun

  • Branch changed from u/vklein/26837 to 069a55ffb1c3f0f460b78d5d6ef37a9b86f821f1
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:9 Changed 11 months ago by jdemeyer

  • Commit 069a55ffb1c3f0f460b78d5d6ef37a9b86f821f1 deleted

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.

Note: See TracTickets for help on using tickets.