• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hgrecco / pint / 1399 / 9
92%
master: 91%

Build:
Build:
LAST BUILD BRANCH: fix-nonmult-doc
DEFAULT BRANCH: master
Ran 18 Dec 2019 09:05PM UTC
Files 17
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Dec 2019 09:00PM UTC coverage: 87.483% (-0.1%) from 87.631%
PKGS="python=3.8 numpy=1.17"

push

travis-ci

web-flow
Merge #933

933: Pretty print - once more, this time with feeling r=hgrecco a=crusaderky

I found out how those ``<sup>`` tags worked before I removed them in #928.

My previous PR fixed units with underscores when you have a numpy magnitude *and broke them when you don't*. It *also* broke exponential representation. :tired_face:

New manual test:
```python
import pint
from IPython.display import display_html, display_latex

for f in ("{!s}", "{!r}", "{:P}", display_html, display_latex):
    print('-------------')
    print(f.__name__ if callable(f) else f)
    print('-------------')
    if isinstance(f, str):
        s = f
        f = lambda x: print(s.format(x))

    f(pint.Unit("kg * m^2 / s"))
    f(pint.Quantity(1, "kg * m^2 / s"))
    f(pint.Quantity([1, 2], "kg * m^2 / s"))
    f(pint.Quantity(1, "kg * m^2 / s").plus_minus(1))
    f(pint.Quantity([1, 2], "kg * m^2 / s"))
    f(pint.Unit("oil_barrel"))
    f(pint.Quantity(1, "oil_barrel"))
    f(pint.Quantity(1, "oil_barrel").plus_minus(1))
    f(pint.Quantity([1, 2], "oil_barrel"))
    f(pint.Quantity(3e20, "m"))
    f(pint.Quantity(3e-20, "m"))
    f(pint.Quantity(3e20, "m").plus_minus(1e19))
    f(pint.Quantity(3e-20, "m").plus_minus(1e-21))
```

Output:
Before #928: https://www.dropbox.com/s/tr4dplosrhzfn40/Before_928.html?dl=0
After this PR: https://www.dropbox.com/s/nfjzy45vhkne7jn/After_933.html?dl=0

**Note:** github has trouble rendering the HTML version. My first attempt was to upload the notebook to gist, but it didn't go well for this reason. You'll need to click "direct download" in the links above. Sorry for the inconvenience.

Co-authored-by: Guido Imperiale <crusaderky@gmail.com>

3194 of 3651 relevant lines covered (87.48%)

0.87 hits per line

Source Files on job 1399.9 (PKGS="python=3.8 numpy=1.17")
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1292
  • Travis Job 1399.9
  • 4c3114c7 on github
  • Prev Job for PKGS="python=3.8 numpy=1.17" on staging (#1392.9)
  • Next Job for PKGS="python=3.8 numpy=1.17" on staging (#1405.9)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc