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

hgrecco / pint / 1330
92%
master: 91%

Build:
Build:
LAST BUILD BRANCH: fix-nonmult-doc
DEFAULT BRANCH: master
Ran 09 Dec 2019 06:47PM UTC
Jobs 11
Files 160
Run time 4min
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

pending completion
1330

push

travis-ci

web-flow
Merge #923

923: Preserve caches on context switch v2 r=hgrecco a=crusaderky

Fix bug in #909 where, every time a context is reactivated, it creates a brand new entry in UnitRegistry._caches - thus not only nullifying the whole point of the PR, but also creating a nasty memory leak for users that invoke ``.to`` with an inline context many times.

Not sure what went wrong with the first PR - if I rerun the included benchmark, it doesn't reproduce the same results anymore and clearly shows that nothing is cached.

Same benchmark with this PR:
```python
import pint
ureg = pint.UnitRegistry()
src = ureg('1 m')
dst = ureg.Unit('km')
%timeit src.to(dst)
%timeit -n 1 -r 1 src.to(dst, 'chemistry')
%timeit src.to(dst, 'chemistry')
ureg.enable_contexts('chemistry')
%timeit src.to(dst)
```
29.9 µs ± 1.4 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
57.3 ms ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)
76.9 µs ± 1.69 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
43.7 µs ± 955 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)

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

29110 of 33854 relevant lines covered (85.99%)

9.31 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1330.1 (PKGS="python=3.6") 09 Dec 2019 06:47PM UTC 0
77.79
Travis Job 1330.1
2 1330.2 (PKGS="python=3.7") 09 Dec 2019 06:47PM UTC 0
77.79
Travis Job 1330.2
3 1330.3 (PKGS="python=3.8") 09 Dec 2019 06:47PM UTC 0
78.16
Travis Job 1330.3
4 1330.4 (PKGS="python=3.6 uncertainties=3.0") 09 Dec 2019 06:47PM UTC 0
87.92
Travis Job 1330.4
5 1330.5 (PKGS="python=3.7 uncertainties=3.0") 09 Dec 2019 06:47PM UTC 0
87.92
Travis Job 1330.5
6 1330.6 (PKGS="python=3.6 numpy=1.14") 09 Dec 2019 06:49PM UTC 0
86.06
Travis Job 1330.6
7 1330.7 (PKGS="python=3.7 numpy=1.14") 09 Dec 2019 06:49PM UTC 0
85.97
Travis Job 1330.7
8 1330.8 (PKGS="python=3.8 numpy=1.17") 09 Dec 2019 06:50PM UTC 0
86.27
Travis Job 1330.8
9 1330.9 (PKGS="python=3.6 numpy=1.14 uncertainties=3.0") 09 Dec 2019 06:49PM UTC 0
87.92
Travis Job 1330.9
10 1330.10 (PKGS="python=3.7 numpy=1.14 uncertainties=3.0") 09 Dec 2019 06:50PM UTC 0
87.92
Travis Job 1330.10
12 1330.12 (PKGS="python=3.7 numpy uncertainties") 09 Dec 2019 06:51PM UTC 0
87.92
Travis Job 1330.12
Source Files on build 1330
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1330
  • a741670e on github
  • Prev Build on staging (#1315)
  • Next Build on staging (#1335)
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