Opened 3 years ago

Closed 2 years ago

#27081 closed enhancement (fixed)

Section for composite maps

Reported by: soehms Owned by:
Priority: major Milestone: sage-8.9
Component: categories Keywords: section map
Cc: Merged in:
Authors: Sebastian Oehms Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: bb25f16 (Commits, GitHub, GitLab) Commit: bb25f1664654e85e4eddee8e356dfd8d876b916d
Dependencies: Stopgaps:

Status badges

Description

Currently, a section method for the class FormalCompositeMap is not implemented. This ticket supplies a section in cases, where all factors of the composite map have section implemented.

Examples which will be improved are:

sage: P.<x> = QQ[]
sage: P.coerce_map_from(ZZ).section() is None
True
sage: k = GF(47)
sage: R.<x> = PolynomialRing(k)
sage: R.coerce_map_from(ZZ).section() is None
True

Change History (9)

comment:1 Changed 3 years ago by soehms

  • Branch set to u/soehms/section_of_composite_map_27081

comment:2 Changed 3 years ago by soehms

  • Commit set to 3fd303ece2b1cefc9bcec69e67de88391d7d8038
  • Status changed from new to needs_review

New commits:

3fd303e27081: initial version

comment:3 Changed 3 years ago by embray

  • Milestone changed from sage-8.7 to sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

comment:4 Changed 2 years ago by embray

  • Milestone changed from sage-8.8 to sage-8.9

Moving tickets from the Sage 8.8 milestone that have been actively worked on in the last six months to the next release milestone (optimistically).

comment:5 Changed 2 years ago by tscrim

  • Reviewers set to Travis Scrimshaw

Sorry for letting my review of this take so long. Once these changes are done, then it is a positive review:

-        Compute a section map from sections of the factors of self if they have been implemented
+        Compute a section map from sections of the factors of
+        ``self`` if they have been implemented.

I would write this with short-circuiting and the reversal already built-in:

        sections = []
        for m in reversed(self):
            try:
                sec = m.section()
            except TypeError:
                return None
            if sec is None:
                return None
            sections.append(m)

        from sage.categories.homset import Hom
        from sage.categories.sets_with_partial_maps import SetsWithPartialMaps
        H = Hom(self.codomain(), self.domain(), category=SetsWithPartialMaps())
        return FormalCompositeMap(H, sections)

Capitalize the beginning of the .. NOTE:: in polynomial_element.pyx.

comment:6 Changed 2 years ago by git

  • Commit changed from 3fd303ece2b1cefc9bcec69e67de88391d7d8038 to bb25f1664654e85e4eddee8e356dfd8d876b916d

Branch pushed to git repo; I updated commit sha1. New commits:

c049ce9Merge branch 'u/soehms/section_of_composite_map_27081' of git://trac.sagemath.org/sage into section_of_composite_map_27081
bb25f1627081: corrections according to review

comment:7 Changed 2 years ago by soehms

thanks, Travis! I'll be waiting for the patchbot!

comment:8 Changed 2 years ago by tscrim

  • Status changed from needs_review to positive_review

Thank you.

comment:9 Changed 2 years ago by vbraun

  • Branch changed from u/soehms/section_of_composite_map_27081 to bb25f1664654e85e4eddee8e356dfd8d876b916d
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.