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

matplotlib / matplotlib / 12455
36%

Build:
DEFAULT BRANCH: master
Ran 24 Jul 2016 08:00PM UTC
Jobs 6
Files 98
Run time 18min
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
12455

Pull #6821

travis-ci

web-flow
Break reference cycle Line2D <-> Line2D._lineFunc.

Upon drawing, Line2D objects would store a reference to one of their own
bound methods as their `_lineFunc` argument.  This would lead to them
being gc'ed not when going out of scope, but only when the "true" gc
kicks in; additionally this led to some pickle-related bugs (#3627).

One can easily sidestep this problem by not storing this bound method.

To check the behavior, try (py3.4+ only):

```
import gc
import weakref
from matplotlib import pyplot as plt

def f():
    fig, ax = plt.subplots()
    img = ax.imshow([[0, 1], [2, 3]])
    weakref.finalize(img, print, "gc'ing image")
    l, = plt.plot([0, 1])
    weakref.finalize(l, print, "gc'ing line")
    fig.canvas.draw()
    img.remove()
    l.remove()

f()
print("we have left the function")
gc.collect()
print("and cleaned up our mess")
```

Before the patch, the AxesImage is gc'ed when the function exits but the
Line2D only upon explicit garbage collection.  After the patch, both are
collected immediately.
Pull Request #6821: Break reference cycle Line2D <-> Line2D._lineFunc.

30161 of 42876 relevant lines covered (70.34%)

0.7 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
72
100.0
lib/matplotlib/lines.py
Jobs
ID Job ID Ran Files Coverage
1 12455.1 (MOCK=mock NUMPY=numpy==1.6) 24 Jul 2016 08:06PM UTC 0
Travis Job 12455.1
2 12455.2 (PYTHON_ARGS=-OO) 24 Jul 2016 08:07PM UTC 0
Travis Job 12455.2
3 12455.3 (PANDAS=pandas NOSE_ARGS=--with-coverage) 24 Jul 2016 08:15PM UTC 0
70.34
Travis Job 12455.3
4 12455.4 (TEST_ARGS=--pep8) 24 Jul 2016 08:00PM UTC 0
Travis Job 12455.4
6 12455.6 (PRE=--pre) 24 Jul 2016 08:09PM UTC 0
Travis Job 12455.6
7 12455.7 (MOCK=mock NOSE_ARGS=) 24 Jul 2016 08:19PM UTC 0
Travis Job 12455.7
Source Files on build 12455
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #12455
  • Pull Request #6821
  • PR Base - master (#12435)
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