Opened 12 months ago
Closed 11 months ago
#31880 closed enhancement (fixed)
RealSet, InternalRealInterval: Improve _repr_ and add _latex_ method
Reported by:  mkoeppe  Owned by:  

Priority:  major  Milestone:  sage9.4 
Component:  manifolds  Keywords:  
Cc:  yzh, ghmjungmath, tscrim, chapoton  Merged in:  
Authors:  Matthias Koeppe  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  011f59a (Commits, GitHub, GitLab)  Commit:  011f59a15f0d7f59e92c91655a8855aafa3c2b97 
Dependencies:  Stopgaps: 
Description (last modified by )
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#diffb4cd72590a22494dab392e336268a3c94ea5b0adeb6b5864bda0e2ad87c65323
Change History (17)
comment:1 Changed 12 months ago by
 Branch set to u/mkoeppe/realset__internalrealinterval__add__latex__method
comment:2 Changed 12 months ago by
 Commit set to dbdfc068f2d2ac39ae8171ea8737b2b1a535e021
comment:3 Changed 12 months ago by
 Description modified (diff)
 Summary changed from RealSet, InternalRealInterval: Add _latex_ method to RealSet, InternalRealInterval: Improve _repr_ and add _latex_ method
comment:4 Changed 12 months ago by
 Status changed from new to needs_review
comment:5 Changed 12 months ago by
 Reviewers set to Travis Scrimshaw
Trivial failures due to change in output:
sage t long randomseed=0 src/sage/functions/piecewise.py # 4 doctests failed
Once fixed, you can set it to a positive review.
comment:6 Changed 12 months ago by
 Commit changed from dbdfc068f2d2ac39ae8171ea8737b2b1a535e021 to 7f563381617c2b016a8b849f83d3387ccc25d621
Branch pushed to git repo; I updated commit sha1. New commits:
7f56338  PiecewiseFunction: Adjust doctests for changed RealSet repr

comment:8 Changed 12 months ago by
 Commit changed from 7f563381617c2b016a8b849f83d3387ccc25d621 to 8abdc8b16f9762041c1c60bcb4672fefea12f4b4
 Status changed from positive_review to needs_review
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
8abdc8b  src/sage/functions/piecewise.py: Add coding header

comment:9 Changed 12 months ago by
 Status changed from needs_review to positive_review
Added the header as requested in https://trac.sagemath.org/ticket/31927#comment:8
comment:10 Changed 11 months ago by
 Status changed from positive_review to needs_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 followup: ↓ 12 Changed 11 months ago by
For the record: Python 8 defaults to UTF8 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 UTF8 (in Python 3) should not have an encoding declaration.
comment:12 in reply to: ↑ 11 Changed 11 months ago by
 Cc chapoton added
Replying to vbraun:
For the record: Python 8 defaults to UTF8 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 UTF8 (in Python 3) should not have an encoding declaration.
Thanks. I have removed the non_ascii
patchbot plugin in https://github.com/sagemath/sagepatchbot/commit/af55241865faf2a7f89a2b6cc40caa5ce483ff67
comment:13 Changed 11 months ago by
 Commit changed from 8abdc8b16f9762041c1c60bcb4672fefea12f4b4 to 011f59a15f0d7f59e92c91655a8855aafa3c2b97
Branch pushed to git repo; I updated commit sha1. New commits:
011f59a  src/sage/docs/conf.py: Add more \DeclareUnicodeCharacter

comment:14 Changed 11 months ago by
 Status changed from needs_work to needs_review
comment:15 Changed 11 months ago by
 Status changed from needs_review to positive_review
comment:16 Changed 11 months ago by
Thanks!
comment:17 Changed 11 months ago by
 Branch changed from u/mkoeppe/realset__internalrealinterval__add__latex__method to 011f59a15f0d7f59e92c91655a8855aafa3c2b97
 Resolution set to fixed
 Status changed from positive_review to closed
Branch pushed to git repo; I updated commit sha1. New commits:
RealSet._repr_: Use unicode cup sign instead of +
InternalRealInterval, RealSet: Remove extra whitespace in latex, add documentation