#31880 closed enhancement (fixed)

RealSet, InternalRealInterval: Improve _repr_ and add _latex_ method

Reported by: Matthias Köppe Owned by:
Priority: major Milestone: sage-9.4
Component: manifolds Keywords:
Cc: Yuan Zhou, Michael Jung, Travis Scrimshaw, Frédéric Chapoton Merged in:
Authors: Matthias Koeppe Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 011f59a (Commits, GitHub, GitLab) Commit: 011f59a15f0d7f59e92c91655a8855aafa3c2b97
Dependencies: Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

We implement this TODO item in RealSet._repr_:

# Switch to u'\u222A' (cup sign) with Python 3

We also add _latex_ methods to RealSet and InternalRealInterval, upstreaming and extending the change in https://github.com/mkoeppe/cutgeneratingfunctionology/commit/4c7fb7df9a92cdb2435028c7eb19d186ab4b58ee#diff-b4cd72590a22494dab392e336268a3c94ea5b0adeb6b5864bda0e2ad87c65323

Change History (17)

comment:1 Changed 19 months ago by Matthias Köppe

Branch: u/mkoeppe/realset__internalrealinterval__add__latex__method

comment:2 Changed 19 months ago by git

Commit: dbdfc068f2d2ac39ae8171ea8737b2b1a535e021

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

69ca854RealSet._repr_: Use unicode cup sign instead of +
dbdfc06InternalRealInterval, RealSet: Remove extra whitespace in latex, add documentation

comment:3 Changed 19 months ago by Matthias Köppe

Description: modified (diff)
Summary: RealSet, InternalRealInterval: Add _latex_ methodRealSet, InternalRealInterval: Improve _repr_ and add _latex_ method

comment:4 Changed 19 months ago by Matthias Köppe

Authors: Matthias Koeppe
Status: newneeds_review

comment:5 Changed 19 months ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw

Trivial failures due to change in output:

sage -t --long --random-seed=0 src/sage/functions/piecewise.py  # 4 doctests failed

Once fixed, you can set it to a positive review.

comment:6 Changed 19 months ago by git

Commit: dbdfc068f2d2ac39ae8171ea8737b2b1a535e0217f563381617c2b016a8b849f83d3387ccc25d621

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

7f56338PiecewiseFunction: Adjust doctests for changed RealSet repr

comment:7 Changed 19 months ago by Matthias Köppe

Status: needs_reviewpositive_review

Thanks!

comment:8 Changed 18 months ago by git

Commit: 7f563381617c2b016a8b849f83d3387ccc25d6218abdc8b16f9762041c1c60bcb4672fefea12f4b4
Status: positive_reviewneeds_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

8abdc8bsrc/sage/functions/piecewise.py: Add coding header

comment:9 Changed 18 months ago by Matthias Köppe

Status: needs_reviewpositive_review

Added the header as requested in https://trac.sagemath.org/ticket/31927#comment:8

comment:10 Changed 18 months ago by Volker Braun

Status: positive_reviewneeds_work
[docpdf] ! Package inputenc Error: Unicode character ∪ (U+222A)
[docpdf] (inputenc)                not set up for use with LaTeX.
[docpdf] 
[docpdf] See the inputenc package documentation for explanation.
[docpdf] Type  H <return>  for immediate help.
[docpdf]  ...                                              
[docpdf]                                                   
[docpdf] l.3311 ...YGZhy{}oo, \PYGZhy{}1] ∪ [1, +oo); x)}
[docpdf]                                                   
[docpdf] ? 
[docpdf] ! Emergency stop.
[docpdf]  ...                                              
[docpdf]                                                   
[docpdf] l.3311 ...YGZhy{}oo, \PYGZhy{}1] ∪ [1, +oo); x)}
[docpdf]                                                   
[docpdf] !  ==> Fatal error occurred, no output PDF file produced!

comment:11 Changed 18 months ago by Volker Braun

For the record: Python 8 defaults to UTF-8 source coding, so the #coding header is just cargo cult from when Python2 defaulted to the (in hindsight) wrong encoding. Nowadays the # coding header is superfluous. Pep8 says:

Files using ASCII (in Python 2) or UTF-8 (in Python 3) should not have an encoding declaration.

comment:12 in reply to:  11 Changed 18 months ago by Matthias Köppe

Cc: Frédéric Chapoton added

Replying to vbraun:

For the record: Python 8 defaults to UTF-8 source coding, so the #coding header is just cargo cult from when Python2 defaulted to the (in hindsight) wrong encoding. Nowadays the # coding header is superfluous. Pep8 says:

Files using ASCII (in Python 2) or UTF-8 (in Python 3) should not have an encoding declaration.

Thanks. I have removed the non_ascii patchbot plugin in https://github.com/sagemath/sage-patchbot/commit/af55241865faf2a7f89a2b6cc40caa5ce483ff67

comment:13 Changed 18 months ago by git

Commit: 8abdc8b16f9762041c1c60bcb4672fefea12f4b4011f59a15f0d7f59e92c91655a8855aafa3c2b97

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

011f59asrc/sage/docs/conf.py: Add more \DeclareUnicodeCharacter

comment:14 Changed 18 months ago by Matthias Köppe

Status: needs_workneeds_review

comment:15 Changed 18 months ago by Travis Scrimshaw

Status: needs_reviewpositive_review

comment:16 Changed 18 months ago by Matthias Köppe

Thanks!

comment:17 Changed 18 months ago by Volker Braun

Branch: u/mkoeppe/realset__internalrealinterval__add__latex__method011f59a15f0d7f59e92c91655a8855aafa3c2b97
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.