summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_histograms.py
Commit message (Collapse)AuthorAgeFilesLines
* BUG: Histogramdd breaks on big arrays in Windows (#22561)Navpreet Singh2022-11-181-0/+11
| | | | | | | | | | | | | | | | | * BUG: Histogramdd breaks on big arrays in Windows Resolved the issue with line change from int to np.intp in numpy/numpy/lib/histograms.py * BUG: Histogramdd breaks on big arrays in Windows Resolved the issue with line change from int to np.intp in numpy/numpy/lib/histograms.py * Removed the binary files * Update test_histograms.py * Update test_histograms.py * Update test_histograms.py
* TST,MAINT: Replace most `setup` with `setup_method` (also teardown)Sebastian Berg2022-10-271-2/+2
| | | | | | | | In some cases, the replacement is clearly not what is intended, in those (where setup was called explicitly), I mostly renamed `setup` to `_setup`. The `test_ccompile_opt` is a bit confusing, so left it right now (this will probably fail)
* DEP: Remove `normed=` keyword argument from histogromsSebastian Berg2022-06-021-41/+0
| | | | | | The normed keyword argument has been deprecated for a long time. This removes it, replacing its position with the new density argument.
* DOC: fix typosBrian Wignall2020-01-141-1/+1
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-3/+3
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* BUG: lib: Fix histogram problem with signed integer arrays.Warren Weckesser2019-10-151-0/+11
| | | | | | | | | | | | | | | | | | | | An input such as np.histogram(np.array([-2, 0, 127], dtype=np.int8), bins="auto") would raise the exception ValueError: Number of samples, -1, must be non-negative. The problem was that the peak-to-peak value for the input array was computed with the `ptp` method, which returned negative values for signed integer arrays when the actual value was more than the maximum signed value of the array's data type. The fix is to use a peak-to-peak function that returns an unsigned value for signed integer arrays. Closes gh-14379.
* MAINT: Misc. typo fixes (#13664)luzpaz2019-05-311-1/+1
| | | | | | * DOC, MAINT: Misc. typo fixes Found via `codespell`
* TEST: tweak two slow tests to speed them upmattip2019-05-111-7/+3
|
* Merge pull request #12388 from mhvk/linspace-allow-arrayCharles Harris2018-12-061-4/+4
|\ | | | | ENH: allow arrays for start and stop in {lin,log,geom}space
| * TST,BUG: fix two tests that were setup incorrectly.Marten van Kerkwijk2018-12-041-4/+4
| | | | | | | | And which failed with the change to linspace.
* | MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-061-1/+1
|/ | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* resolve issues from reviewguoci2018-11-201-2/+2
|
* ENH: Add 'ise' estimator to np.histogramguoci2018-11-201-12/+32
|
* TST: arg handling tests in histogramddTyler Reddy2018-10-221-0/+17
|
* Merge pull request #12216 from tylerjereddy/hist_range_test_sanityEric Wieser2018-10-181-0/+6
|\ | | | | TST: test invalid histogram range
| * TST: test invalid histogram rangeTyler Reddy2018-10-181-0/+6
| |
* | TST: test histogram bins dimsTyler Reddy2018-10-181-0/+7
|/
* TST: add test for weighted histogram mismatchTyler Reddy2018-10-141-0/+7
| | | | | | * add a unit test for an uncovered code path where a histogram array does not match the shape of the provided array of weights
* BUG: Allow boolean subtract in histogramMatthew Bowden2018-10-101-0/+17
| | | | | | | | | | | Convert bool to uint at start, rather than attempt a XOR Only check type against np.bool_ Refactor warnings check
* Merge pull request #11778 from eric-wieser/histogram-overflowCharles Harris2018-08-181-0/+14
|\ | | | | BUG: Avoid signed overflow in histogram
| * BUG: Avoid signed overflow in histogramEric Wieser2018-08-181-0/+14
| | | | | | | | | | | | | | | | | | When dividing the range between first and last, the formula `(x - first) / (last - first)` is used, where `last >= first` This falls apart if the types of these variables are signed integers, in which case overflow can occur. The solution is to force the subtraction result to be unsigned. This is a regression in 1.15.0
* | Merge pull request #11531 from eric-wieser/histogramdd-density-no-deprecationCharles Harris2018-07-081-8/+8
|\ \ | | | | | | ENH: Add density argument to histogramdd.
| * | MAINT: Rename histogramdd's normed argument to density, to match histogramEric Wieser2018-07-081-8/+8
| | | | | | | | | | | | Fixes gh-4371
* | | Merge pull request #11428 from eric-wieser/deprecate-normed-1.15.0Charles Harris2018-06-271-0/+4
|\ \ \ | | | | | | | | BUG: Fix incorrect deprecation logic for histogram(normed=...) (master)
| * | | BUG: Fix incorrect deprecation logic for histogram(normed=...)Eric Wieser2018-06-261-0/+4
| | | | | | | | | | | | | | | | Fixes #11426, which was introduced in #11323 and #11352
* | | | Merge pull request #11373 from eric-wieser/histogramdd-densityCharles Harris2018-06-181-0/+36
|\ \ \ \ | |/ / / |/| / / | |/ / TST: Show that histogramdd's normed argument is histogram's density
| * | TST: Show that histogramdd's normed argument is histogram's densityEric Wieser2018-06-171-0/+36
| |/ | | | | | | Relevant to gh-4371
* | DEP: Actually deprecate the normed argument to histogramEric Wieser2018-06-151-19/+27
|/ | | | Documenting this argument at such length gives it authenticity it does not deserve.
* Merge pull request #11023 from eric-wieser/histogramdd-no-fuzzCharles Harris2018-05-141-3/+38
|\ | | | | BUG: np.histogramdd loses precision on its inputs, leading to incorrect results
| * BUG: histogramdd fails on large integersEric Wieser2018-04-301-0/+12
| | | | | | | | This is due to gh-11022.
| * ENH: Disable fuzzing on histogram boundariesEric Wieser2018-04-301-3/+26
| | | | | | | | | | | | | | | | | | | | Previously a fuzzy rounded comparison was used for the rightmost bin of histogramdd. It's not clear why this was done, and it resulted in surprising behavior. This also removes the restriction that bin edges must be floats, and allows integer arrays to be passed (and returned) Fixes gh-10864
* | MAINT: Misc. typos (#11005)luzpaz2018-04-301-1/+1
|/ | | | | | | | | User- and non-user-facing typos. Some source typos fixes as well. Found via `codespell`.
* ENH: Improve histogram bins="auto" for data with little variance (#10739)Varun Nayyar2018-04-091-0/+18
| | | Now falls back on sturges estimator when the IQR is zero
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-9/+4
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* TST: Switch to using pytest markersCharles Harris2018-04-041-1/+1
| | | | | | | | | | | Use standard pytest markers everywhere in the numpy tests. At this point there should be no nose dependency. However, nose is required to test the legacy decorators if so desired. At this point, numpy test cannot be run in the way with runtests, rather installed numpy can be tested with `pytest --pyargs numpy` as long as that is not run from the repo. Run it from the tools directory or some such.
* ENH: Add np.histogram_bin_edges (#10591)Kirit Thadaka2018-03-151-1/+15
| | | | | Fixes #10183 Documentation is copied from np.histogram
* BUG: Fix crashes when using float32 values in uniform histogramsEric Wieser2018-02-021-0/+47
| | | | | | | | Fixes #8123, closes #9189, fixes #10319 This is a workaround to #10322, not a fix for it. Adds tests for cases where bounds are more precise than the data, which led to inconsistencies in the optimized path.
* ENH: Add support for datetimes to histogramsEric Wieser2017-12-261-0/+25
| | | | Currently only supported for explicit bins
* BUG: Allow nan values in the data when the bins are explicitEric Wieser2017-12-241-0/+25
| | | | | Fixes gh-7503 Closes gh-8984
* BUG: Fix misleading error when coercing to arrayEric Wieser2017-12-241-0/+11
| | | | Closes gh-7864
* MAINT: Move histogram and histogramdd into their own moduleEric Wieser2017-12-101-0/+527
800 self-contained lines are easily enough to go in their own file, as are the 500 lines of tests. For compatibility, the names are still available through `np.lib.function_base.histogram` and `from np.lib.function_base import *` For simplicity of imports, all of the unqualified `np.` names are now qualified