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

has2k1 / plotnine / 254 / 1
87%
master: 87%

Build:
DEFAULT BRANCH: master
Ran 21 Jun 2018 12:09PM UTC
Files 141
Run time 6s
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

21 Jun 2018 12:02PM UTC coverage: 86.966% (+0.002%) from 86.964%
JOB=UNITTEST FULL_DEPS=true

push

travis-ci

has2k1
utils.match: Speed up by ~45% by replacing `suppress(KeyError)` with `in`

Using a df with ~400K rows:
```py
>>> len(df)
399859
```

A simple `geom_bar` takes 3.1s:
```py
>>> %%prun -l10
... repr(df
...     .pipe(ggplot, aes(x='quality'))
...     + geom_bar()
... )
         3912976 function calls (3907115 primitive calls) in 3.050 seconds

   Ordered by: internal time
   List reduced from 2489 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        7    1.210    0.173    1.617    0.231 utils.py:104(match)
        5    0.293    0.059    0.293    0.059 {pandas._libs.lib.maybe_convert_objects}
        2    0.270    0.135    0.270    0.135 {built-in method matplotlib._png.write_png}
  1199783    0.185    0.000    0.185    0.000 contextlib.py:239(__init__)
  1199783    0.111    0.000    0.111    0.000 contextlib.py:245(__exit__)
      527    0.111    0.000    0.111    0.000 {method 'copy' of 'numpy.ndarray' objects}
4779/4704    0.110    0.000    0.120    0.000 {built-in method numpy.core.multiarray.array}
  1199783    0.096    0.000    0.096    0.000 contextlib.py:242(__enter__)
        1    0.091    0.091    0.190    0.190 layer.py:81(compute_aesthetics)
        1    0.059    0.059    0.059    0.059 missing.py:27(mask_missing) 
```

Doing the `groupby` manually reduces it to .72s:
```py
>>> %%prun -l10
... repr(df
...     .assign(n=1).groupby(['quality'])['n'].count().reset_index()
...     .pipe(ggplot, aes(x='quality', y='n'))
...     + geom_bar(stat='identity')
... )
         230436 function calls (225887 primitive calls) in 0.718 seconds

   Ordered by: internal time
   List reduced from 2382 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        2    0.264    0.132    0.264    0.132 {built-in method matplotlib._png.write_png}
      460    0.138    0.000    0.138    0.000 {method 'copy' of 'numpy.... (continued)

2023 of 2651 branches covered (76.31%)

Branch coverage included in aggregate %.

7812 of 8658 relevant lines covered (90.23%)

0.9 hits per line

Source Files on job 254.1 (JOB=UNITTEST FULL_DEPS=true)
  • Tree
  • List 0
  • Changed 20
  • Source Changed 20
  • Coverage Changed 19
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 233
  • Travis Job 254.1
  • 47f4e3ee on github
  • Prev Job for JOB=UNITTEST FULL_DEPS=true on master (#253.1)
  • Next Job for JOB=UNITTEST FULL_DEPS=true on master (#257.1)
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