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

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

Build:
DEFAULT BRANCH: master
Ran 17 Aug 2020 03:51AM UTC
Files 18
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

17 Aug 2020 03:36AM UTC coverage: 87.305% (+0.2%) from 87.111%
PKGS="python=3.8 numpy=1.17 matplotlib"

push

travis-ci

web-flow
Merge #1133

1133: Change HTML repr away from LaTeX to a Sparse/Dask-like repr r=hgrecco a=jthielen

While I've never been a big fan of Pint's LaTeX repr in JupyterLab/Jupyter Notebook due to working with large arrays that would crash the renderer, I've recently been working a lot with various wrapping combinations of xarray, Pint, Dask, and Sparse, in which Pint's LaTeX repr performs particularly poorly. Even if Pint's repr were elided (#765), it would still poorly nest with the other HTML reprs.

This motivated me to implement an alternative HTML repr for Pint using a simple HTML table similar to what both Dask and Sparse use. As shown in [this demonstration notebook](https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/jlgqm6s92kzvagi/pint_html_repr_demo.ipynb), this allows much better nesting of HTML reprs. A quick example image is below:

![](https://www.meteor.iastate.edu/~jthielen/Screenshot%20from%202020-07-14%2017-07-51.png)

This doesn't quite take care of [xarray's unit repr discussions](https://github.com/pydata/xarray/issues/2773) (since this only shows up when expanding the data in a dataset), but I still think it is a worthwhile improvement for the expanded view. @keewis do you have any thoughts on this particular interaction?

Marking as a WIP/draft for now to see if this is a welcome format for the HTML repr first before I dig too much into optimizing the implementation and writing tests for it.

- [x] Closes #654 (even though it was already closed in favor of #765, I think the are related but separate issues)
- [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors
- [x] The change is fully covered by automated unit tests
- [x] Documented in docs/ as appropriate
- [x] Added an entry to the CHANGES file

Tagging @nbren12, @hgrecco, @jondoesntgit, @natezb, @ipcoder, @keewis, and @TomNicholas for input based on past issues (#654, #765, and https://github.com/xarray-contrib/pint-xarray/issues/6).


Co-aut... (continued)

3638 of 4167 relevant lines covered (87.31%)

0.87 hits per line

Source Files on job 1869.10 (PKGS="python=3.8 numpy=1.17 matplotlib")
  • Tree
  • List 0
  • Changed 5
  • Source Changed 4
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1735
  • Travis Job 1869.10
  • dea623a7 on github
  • Prev Job for PKGS="python=3.8 numpy=1.17 matplotlib" on master (#1860.10)
  • Next Job for PKGS="python=3.8 numpy=1.17 matplotlib" on master (#1873.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