summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_arraypad.py
Commit message (Collapse)AuthorAgeFilesLines
* Clarify signature of numpy.pad.Antony Lee2015-08-071-1/+1
| | | | | `mode` is a required argument so just declare it as such. This does not prevent it from being passed as a keyword argument.
* ENH: Improve arg handling & enhance test suite for np.padJosh Warner (Mac)2015-01-061-9/+496
|
* STY: PEP8 compliance for numpy/lib/tests.Charles Harris2014-07-311-181/+181
| | | | | | | The possibly controversial part of this is making the nested array value lists PEP8 compliant, as there is something to be said aligning the values for clarity. In the end, it seemed like the easiest thing to do was to make them PEP8 compliant. The eye can get used to that.
* STY: Make numpy/lib/test/*.py PEP8 compliant.Charles Harris2013-09-031-342/+363
| | | | | | | Run autopep8 over the test files in numpy/lib/test and make fixes to the result. Also remove Python5 workaround.
* TST: New test to ensure np.pad allows pad_width of zero.Jostein Bø Fløystad2013-07-051-0/+8
|
* ENH: improved, faster algorithm for array paddingJosh Warner (Mac)2013-05-191-15/+15
| | | | | | | | | | | | 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.
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-3/+4
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* ENH: Add module containing functions for padding n-dimensional arrays.tim cera2012-04-041-0/+530
The various padding functions are exposed as options to a public 'pad' function. Example: pad(a, 5, mode='mean') Current modes are 'constant', 'edge', 'linear_ramp', 'maximum', 'mean', 'median', 'minimum', 'reflect', 'symmetric', 'wrap', and <function> This commit includes unit tests and doctests and is based on feature request ticket #655.