ENH: improved, faster algorithm for array padding

Stéfan van der Walt stefan at sun.ac.za
Mon May 20 05:56:40 EDT 2013


Kudos to Josh Warner for getting this patch into NumPy so quickly!

---------- Forwarded message ----------
From: GitHub
Date: Sun, May 19, 2013 at 9:50 PM
Subject: [Numpy-svn] [numpy/numpy] 246c06: ENH: improved, faster
algorithm for array padding

  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 246c06d2475718ec36ba193494444464e497c69a
      https://github.com/numpy/numpy/commit/246c06d2475718ec36ba193494444464e497c69a
  Author: Josh Warner (Mac) <warner.joshua at mayo.edu>
  Date:   2013-05-19 (Sun, 19 May 2013)

  Changed paths:
    M doc/release/1.8.0-notes.rst
    M numpy/lib/arraypad.py
    M numpy/lib/tests/test_arraypad.py

  Log Message:
  -----------
  ENH: improved, faster algorithm for array padding

New padding method which scales much better with dimensionality.
This new implementation is fully vectorized, builds each abstracted
n-dimensional padding block in a single step, and takes advantage
of separability. The API is completely preserved, and the old
algorithm is used if a vector function is input for `mode`.

The new algorithm is faster for all tested combinations of inputs,
and scales much better with dimensionality. Execution time reductions
from ~25% for small rank 1 arrays to >99% for rank 4+ arrays observed.


  Commit: 7d188bf1c9ac5bf7ee41e0794d59771802b345bf
      https://github.com/numpy/numpy/commit/7d188bf1c9ac5bf7ee41e0794d59771802b345bf
  Author: Charles Harris <charlesr.harris at gmail.com>
  Date:   2013-05-19 (Sun, 19 May 2013)

  Changed paths:
    M doc/release/1.8.0-notes.rst
    M numpy/lib/arraypad.py
    M numpy/lib/tests/test_arraypad.py

  Log Message:
  -----------
  Merge pull request #3329 from JDWarner/faster_arraypad

ENH: improved, faster algorithm for array padding


Compare: https://github.com/numpy/numpy/compare/5b28d185a494...7d188bf1c9ac



More information about the scikit-image mailing list