| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
In numpy/testing/__init__.py, import Tester before importing numpy core
|
| |
| |
| |
| |
| | |
minimum requirement is python2.6, this allows removing a couple 2.3 and
2.4 checks.
|
|\ \
| | |
| | | |
BUG: fix array_almost_equal for array subclasses
|
| |/
| |
| |
| | |
introduced in gh-4105/ab04e1ae0e8eca717bc7e42f3b0a60c9ff764289
|
| |
| |
| |
| |
| | |
allows passing flags like --pdb to test files
also add call to files where its missing
|
| | |
|
| | |
|
|\ \
| | |
| | | |
documentation updates
|
| |/
| |
| |
| |
| |
| |
| |
| | |
"Raise an assertion" was changed to "Raises an AssertionError" to clarify that
an exception named AssertionError will be raised.
Closes gh-4884
[ci skip]
|
|/ |
|
|
|
|
|
|
|
|
| |
This allows numpy 1.9 testing to be used with current scipy
without flooding the output with deprecation warnings.
The deprecation warnings are currently issued for both the
subtract and negative operators when used with booleans.
|
|
|
|
|
| |
The importall function was the only function in the numpytest.py
file, so remove the whole file.
|
|
|
|
| |
Also fix example in testing that Sphinx saw as section header.
|
|\
| |
| | |
BUG: fix some errors raised when minlength is incorrect in np.bincount
|
| | |
|
| |
| |
| |
| |
| |
| | |
The tests were looking at the formatting of other elements in the string
which is not relevant for the things testsed in this case. By looking
only at the array formatting, we guarantee consistency across systems.
|
| |
| |
| |
| |
| | |
It's silly to check scalars when their string representations will vary
so much from system to system.
|
| | |
|
| |
| |
| |
| |
| |
| | |
assert_approx_equal & assert_almost_equal make internal use of
build_err_msg so a few tests have been added to check that the errors
are formatted correctly.
|
| |
| |
| |
| |
| | |
This check is needed now that build_err_msg takes a precision argument,
which is only relevant if the things being compared are ndarrays.
|
| | |
|
|/
|
|
|
|
|
|
| |
assert_array_almost_equal now prints the number of digits that were
being compared in the test instead of always printing 8 (the default
for array_repr). This would lead to uninformattive error messages.
Fixes #2367
|
|
|
|
| |
Fixes #2552. Changes primary test expression in function.
|
| |
|
| |
|
|
|
|
|
|
| |
Casting y to an inexact type fixes problems such as
abs(MIN_INT) < 0, and generally makes sense since the allclose
logic is inherently for float types.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Boolean - is not well defined, especially the unary and
binary operator are not compatible. In general boolean
minus seems to have no real application and does not do
what might be expected.
All "allclose" type functions (numpy, tests, masked) have to
now check for boolean to avoid the deprecation warning. In
the future one could think about removing it again and just
allowing the upcast.
|
|
|
|
|
|
| |
This results in errors whenever you run tests using KnownFailure
like so: ``python test_mymodule.py`` (where run_module_suite is
used in the file, like numpy and scipy do).
|
|
|
|
|
| |
Cosmetic adjustments to previous commit (893fe99) following "charris"'s
comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding an 'argv' optional argument to the
"numpy.testing.run_module_suite" function lets the client pass arguments
to the nose testrunner.
For example, this lets the user add things like:
run_module_suite(sys.argv)
at the end of a test module, so that arguments specified on the command
line will get passed to the nose runner. The user could then run:
$ python test_module.py --nocapture
|
|
|
|
|
|
|
| |
Allows deferring evaluation until failure.
Used for blocked minmax test which evaluate array representations for
the error message many thousand times accumulating to a full second
useless runtime.
|
|
|
|
| |
improves test performance by about 15%
|
|
|
|
|
|
|
|
|
| |
Minimize alignment combinations to useful set with SSE, might need to
be revisited if we add AVX support.
Move large data test_zeros test to slow and drop the extremely slow
count_nonzero() call.
Rename gen_alignment_data to _gen_alignment_data (private) to reserve
right to change it, e.g. add min_size.
|
|
|
|
|
|
|
| |
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
|
|
|
| |
Now is as good a time as any with open PR's at a low.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nanmax, nanmin
--------------
Add out and keepdims keywords.
nanargmin, nanargmax
--------------------
A NanWarning is raised if an all NaN slice detected. For all such
slices np.iingo(np.intp).min is returned as the index value.
nansum
------
The keywords dtype, out, and keepdims are added.
A FutureWarning is raised, as in the future the mean of an empty
slice after NaN replacement will be 0 instead of the current NaN.
nanmean, nanvar, nanstd
-----------------------
For all, if the input array is of inexact type then the dtype and out
parameters must be of inexact type if specified. That insures that NaNs
can be returned when appropriate.
The nanmean function detects empty slices after NaN replacement and
raises a NanWarning. NaN is returned as the value for all such slices.
The nanmean and nanstd functions detect degrees of freedom <= 0 after
NaN replacement and raise a NanWarning. NaN is returned as the value for
all such slices.
|
|
|
|
| |
Deprecate np.testing.importall - it's pointless and partially broken.
|
|
|
|
|
|
|
|
|
|
|
|
| |
WarningManager was a workaround for the lack of the with statement
in Python versions < 2.6. As those versions are no longer supported
it can be removed.
Deprecation notes are added to WarningManager and WarningMessage, but
to avoid a cascade of messages in third party apps, no warnings are
raised at this time, that can be done later.
Closes #3519.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that Python < 2.6 is no longer supported we can use the errstate
context manager in places where constructs like
```
old = seterr(invalid='ignore')
try:
blah
finally:
seterr(**old)
```
were used.
|
|
|
|
|
|
|
|
|
| |
The numarray and oldnumeric modules are deprecated. This is a bit tricky
as raising a DeprecationWarning on import causes an error when tests are
run. To deal with that, a ModuleDeprecationWarning class is added to
numpy and NoseTester is modified to ignore that warning during testing.
Closes #2905
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specialize the sqrt ufunc for float and double and vectorize it using
SSE2.
improves performance by 4/2 for float/double if one is not memory bound
due to non-cached data.
performance is always better on all tested machines (amd phenom X2,
intel xeon 5xxx/7xxx, core2duo, corei7)
This version will not set errno on invalid input, but numpy only checks
the fpu flags so the behavior is the same.
In principle the compiler could autovectorize it when setting ffast-math
(for no errno) and specializing the loop for the vectorizable strides
and giving it some hints (restrict, __builtin_assume_aligned, etc.),
but its simpler and more reliable to simply vectorize it by hand.
|
|
|
|
|
|
| |
Setuptools tends to set +x to the installed test scripts, which makes
numpy.test() to not run any tests. Having --exe always enabled is not
problematic because only files matching 'test_*.py' are looked into.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 3 removes the builtin types from the types module. The types
fixer replaces such references with the builtin types where possible
and also takes care of some special cases:
types.TypeNone <- type(None)
types.NotImplementedType <- type(NotImplemented)
types.EllipsisType <- type(Ellipsis)
The only two tricky substitutions are
types.StringType <- bytes
types.LongType <- int
These are fixed up to support both Python 3 and Python 2 code by
importing the long and bytes types from numpy.compat.
Closes #3240.
|
|\
| |
| | |
2to3: Apply basestring fixer.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The basestring class is not defined in Python 3 and the fixer replaces
it with str. In order to have a common code base we define basestring in
numpy/compat/py3k.py to be str when the Python version is >= 3,
otherwise basestring and import it where needed. That works for most
cases, but there are a few files where the version dependent define
needs to be in the file.
Closes #3042.
|
|/
|
|
|
| |
The line feed is annoying as it makes Nose's verbose test output not
print one line per one test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Python 3 `map` is an iterator while in Python 2 it returns a list.
The simple fix applied by the fixer is to inclose all instances of map
with `list(...)`. This is not needed in all cases, and even where
appropriate list comprehensions may be preferred for their clarity.
Consequently, this patch attempts to use list comprehensions where it
makes sense.
When the mapped function has two arguments there is another problem that
can arise. In Python 3 map stops execution when the shortest argument
list is exhausted, while in Python 2 it stops when the longest argument
list is exhausted. Consequently the two argument case might need special
care. However, we have been running Python3 converted versions of numpy
since 1.5 without problems, so it is probably not something that affects
us.
Closes #3068
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces python backtics with repr(...). The backtics were mostly
used to generate strings for printing with a string format and it is
tempting to replace `'%s' % repr(x)` with `'%r' % x`. That would work
except where `x` happened to be a tuple or a dictionary but, because it
would be significant work to guarantee that and because there are not
many places where backtics are used, the safe path is to let the repr
replacements stand.
Closes #3083.
|