summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #3191 from charris/2to3-apply-imports-fixerCharles Harris2013-04-0611-286/+314
|\ | | | | 2to3: Apply `imports` fixer.
| * 2to3: Apply `imports` fixer.Charles Harris2013-04-0211-286/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `imports` fixer deals with the standard packages that have been renamed, removed, or methods that have moved. cPickle -- removed, use pickle commands -- removed, getoutput, getstatusoutput moved to subprocess urlparse -- removed, urlparse moved to urllib.parse cStringIO -- removed, use StringIO or io.StringIO copy_reg -- renamed copyreg _winreg -- renamed winreg ConfigParser -- renamed configparser __builtin__ -- renamed builtins In the case of `cPickle`, it is imported as `pickle` when python < 3 and performance may be a consideration, but otherwise plain old `pickle` is used. Dealing with `StringIO` is a bit tricky. There is an `io.StringIO` function in the `io` module, available since Python 2.6, but it expects unicode whereas `StringIO.StringIO` expects ascii. The Python 3 equivalent is then `io.BytesIO`. What I have done here is used BytesIO for anything that is emulating a file for testing purposes. That is more explicit than using a redefined StringIO as was done before we dropped support for Python 2.4 and 2.5. Closes #3180.
* | Merge pull request #460 from endolith/regex_formattingCharles Harris2013-04-039-12/+12
|\ \ | |/ |/| DOC: Formatting fixes using regex
| * DOC: regex-assisted fixes of definition list formattingendolith2013-03-194-5/+6
| |
| * DOC: Used regex to find colons missing spaces which render wrong online, ↵endolith2013-03-195-7/+6
| | | | | | | | also other spacing or formatting mistakes
* | Merge pull request #3178 from charris/2to3-apply-import-fixernjsmith2013-04-0241-69/+69
|\ \ | | | | | | 2to3 apply import fixer
| * | 2to3: Use absolute imports.Charles Harris2013-03-2841-69/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge pull request #3104 from seberg/nditer-allow-0dCharles Harris2013-04-011-24/+1
|\ \ \ | |/ / |/| | Make AdvancedNew iter more 0-d aware
| * | MAINT: Remove np.ndindex 0-d hack.Sebastian Berg2013-03-031-24/+1
| | |
* | | 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-279-15/+15
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* | TST: Get rid of a ResourceWarning.Charles Harris2013-03-031-6/+15
|/ | | | | | | | I'm not sure this is the right fix, but test_closing_fid need to check that garbage collection will close a file that goes through a bunch of openings followed by dropping the reference. So the fix is to ignore warnings during the test. I'd just ignore ResourceWarning, but it does not look to be a built in warning in Python 2.7.
* Merge pull request #3026 from charris/2to3-fix-printCharles Harris2013-03-0142-17/+97
|\ | | | | 2to3: Put `from __future__ import division` in every python file.
| * 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-0142-17/+97
| | | | | | | | | | | | | | | | 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.
* | 2to3: Apply `methodattrs` fixes.Charles Harris2013-03-011-3/+3
|/ | | | | Replaces old style `f.im_func` and `f.im_class` method attributes with `f.__func__` and `f.__class__`. Closes #3070.
* 2to3: Apply `raise` fixes. Closes #3077.Charles Harris2013-03-011-2/+2
| | | | | | | | | | Replaces the raise Exception, msg: form with raise Exception(msg):
* Merge pull request #3047 from charris/2to3-callablenjsmith2013-02-281-1/+2
|\ | | | | 2to3: Fix callable.
| * 2to3: Fix callable.Charles Harris2013-02-281-1/+2
| |
* | Merge pull request #3059 from charris/2to3-funcattrsnjsmith2013-02-281-4/+4
|\ \ | | | | | | 2to3: Apply `funcattrs` fixer. Closes #3058.
| * | 2to3: Apply `funcattrs` fixer. Closes #3058.Charles Harris2013-02-281-4/+4
| |/ | | | | | | | | This replaces the `b.func_xxxx` with newer `__xxxx__` attribute names For example, `f.__name__` replaces `f.func_name`
* | 2to3: apply exec fixer results.Charles Harris2013-02-281-1/+1
|/ | | | This changes the `exec` command to the `exec` function.
* 2to3: Use modern exception syntax.Charles Harris2013-02-264-7/+7
| | | | Example: except ValueError,msg: -> except ValueError as msg:
* Update numpy/lib/function_base.pyAndreas Hilboll2013-02-171-1/+1
| | | fix percentile docstring
* BUG: Make nansum work with booleans.Charles Harris2013-02-122-1/+12
| | | | | | | | This broke when function_base._nannop tried to fill a boolean array with integer zeros, raising a 'safe_casting' error. It looks like nanargmax and nanargmin would also break, and were probably incorrect for booleans in any case. The fix is not to use fill values for boolean and integer dtypes. Previously that was only done for the integer dtypes.
* TST: Add a test for ndindex call.Travis E. Oliphant2013-01-211-0/+4
|
* Fix-up logic for checking for zero-d arrays.Travis E. Oliphant2013-01-211-1/+3
|
* Merge pull request #2914 from charris/remove-scons-supportCharles Harris2013-01-153-25/+0
|\ | | | | Remove scons support
| * DEP: Remove scons related files and code.Charles Harris2013-01-133-25/+0
| | | | | | | | | | | | | | | | | | This removes files and code supporting scons builds. After this change numpy will only support builds using distutils or bento. The removal of scons has been discussed on the list several times and a decision has been made that scons support is no longer needed. This was originally discussed for numpy 1.7 and because the distutils and bento methods are still available we are skipping the usual deprecation period.
* | Fix 0-d ndincr to have correct return value.Travis E. Oliphant2013-01-111-1/+1
| |
* | Fix the test for numpy.ndindex()Travis E. Oliphant2013-01-112-5/+24
| | | | | | | | | | Fix ndindex for 0-d arrays. Add tests for tuple arguments to ndindex
* | Use super instead of direct access to inheritance.Travis E. Oliphant2013-01-101-1/+1
| |
* | Fix the 0-d patch so it doesn't change the non 0-d iteratorTravis E. Oliphant2013-01-101-11/+11
| |
* | Fix ndindex for 0-d arrays.Travis E. Oliphant2013-01-101-1/+10
| |
* | Fix the test for numpy.ndindex()Travis E. Oliphant2013-01-101-1/+1
| |
* | Add test for optional size argument for ndindexJay Bourque2013-01-091-0/+4
|/
* TST: Add test for in1d ravellingSebastian Berg2012-12-161-0/+13
| | | | | | The behavior of in1d is not really defined here, but it should be at least consistent over different execution branches. This is what it has been for most usages.
* BUG: Fix regression for in1d with non-array inputSebastian Berg2012-12-082-2/+7
| | | | | | | | | There was a regression introduced by the speed improvement in commit 6441c2a. This fixes it, and generally ravels the arrays for np.in1d. However it can be argued that at least the first array should not be ravelled in the future. Fixes "Issue gh-2755"
* DOC: Further tweaks to histogram2d docstring.Stefan van der Walt2012-11-261-9/+11
|
* [FIX] preserve memory order in np.copy()Nathaniel J. Smith2012-10-012-2/+30
| | | | | This switches us back to the behaviour seen in numpy 1.6 and earlier, which it turns out that scikit-learn (and probably others) relied on.
* Merge pull request #419 from stefanv/modinitnjsmith2012-09-171-1/+1
|\ | | | | Use PyMODINIT_FUNC and update docs accordingly.
| * Use PyMODINIT_FUNC and update docs accordingly.cgohlke2012-09-021-1/+1
| | | | | | | | See https://github.com/scipy/scipy/pull/279
* | MAINT: Use linspace instead of arange in some examples.endolith2012-09-171-3/+3
| | | | | | | | | | | | The original code used arange with offsets and scaling to generate sample points. Using linspace simplifies the code and clarifies the intent.
* | TST: Add test for boolean insertHan Genuit2012-09-071-0/+2
| |
* | TST: Add extra test for multidimensional inserts.Han Genuit2012-09-071-0/+7
| |
* | BUG: Fix for issues #378 and #392Han Genuit2012-09-071-6/+8
|/ | | | | | This should fix the problems with numpy.insert(), where the input values were not checked for all scalar types and where values did not get inserted properly, but got duplicated by default.
* Retain backward compatibility. Enforce C order.Stefan van der Walt2012-09-021-1/+9
|
* Improve ndindex execution speed.Stefan van der Walt2012-09-022-42/+15
|
* MAINT: silence DeprecationWarning in np.safe_eval().Ralf Gommers2012-08-221-4/+14
| | | | | It comes from the Python compiler package, which isn't available on Python 3.x. We already handle that issue by instead importing the ast module.
* BUG: Fix some tests in PR #192Travis E. Oliphant2012-07-171-8/+8
|
* Merge pull request #352 from HackerSchool12/bugfix808Travis E. Oliphant2012-07-172-14/+9
|\ | | | | BF bug #808
| * BUG: Ticket #808: Insert was not performing properly when an integer wasLoftie Ellis2012-07-152-14/+9
| | | | | | | | | | | | | | the argument passed to be used as the item to be insterted, and a list was passed as the positions. This was fixed by simply duplicating the item to be inserted so that it was a list of equal length and then control was passed to the already exsisting code to handel this case