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

hgrecco / pint / 1400 / 10
91%
master: 91%

Build:
DEFAULT BRANCH: master
Ran 18 Dec 2019 09:12PM UTC
Files 17
Run time 2s
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.118% (+0.08%) from 87.042%
PKGS="python=3.6 numpy=1.14 uncertainties=3.0"

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>

3111 of 3571 relevant lines covered (87.12%)

0.87 hits per line

Source Files on job 1400.10 (PKGS="python=3.6 numpy=1.14 uncertainties=3.0")
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1293
  • Travis Job 1400.10
  • 4c3114c7 on github
  • Prev Job for PKGS="python=3.6 numpy=1.14 uncertainties=3.0" on master (#1393.10)
  • Next Job for PKGS="python=3.6 numpy=1.14 uncertainties=3.0" on master (#1406.10)
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