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

has2k1 / plotnine / 254
87%

Build:
DEFAULT BRANCH: master
Ran 21 Jun 2018 12:08PM UTC
Jobs 2
Files 141
Run time 20s
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
254

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)

2064 of 2714 branches covered (76.05%)

Branch coverage included in aggregate %.

7820 of 8658 relevant lines covered (90.32%)

1.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 254.1 (JOB=UNITTEST FULL_DEPS=true) 21 Jun 2018 12:09PM UTC 0
86.97
Travis Job 254.1
2 254.2 (JOB=UNITTEST FULL_DEPS=true) 21 Jun 2018 12:08PM UTC 0
86.75
Travis Job 254.2
Source Files on build 254
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #254
  • 47f4e3ee on github
  • Prev Build on master (#253)
  • Next Build on master (#257)
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