7
7
Bottleneck
8
8
==========
9
9
10
- Bottleneck is a collection of fast, NaN-aware NumPy array functions
11
- written in C.
12
-
13
- As one example, to check if a ``np.array `` has any NaNs using numpy,
14
- one must call ``np.any(np.isnan(array)) ``. The :meth: `bottleneck.anynan `
15
- function interleaves the :meth: `np.isnan ` check with :meth: `np.any `
16
- pre-exit, enabling up to an ``O(N) `` speedup relative to numpy.
17
-
18
- Bottleneck strives to be a drop-in accelerator for NumPy functions.
19
- When using the following libraries, Bottleneck support is automatically
20
- enabled and utilized:
21
-
22
- - `pandas <https://pandas.pydata.org/pandas-docs/stable/install.html#recommended-dependencies >`_
23
- - `xarray <http://xarray.pydata.org/en/stable/installing.html#instructions >`_
24
- - `astropy <https://docs.astropy.org/en/stable/install.html >`_
25
-
26
- Details on the performance benefits can be found in :ref: `benchmarking `
27
-
28
- Example
29
- =======
10
+ Bottleneck is a collection of fast NumPy array functions written in C.
30
11
31
12
Let's give it a try. Create a NumPy array::
32
13
@@ -44,8 +25,6 @@ Moving window mean::
44
25
>>> bn.move_mean(a, window=2, min_count=1)
45
26
array([ 1. , 1.5, 2. , 4. , 4.5])
46
27
47
- .. _benchmarking :
48
-
49
28
Benchmark
50
29
=========
51
30
@@ -123,14 +102,12 @@ Install
123
102
Requirements:
124
103
125
104
======================== ====================================================
126
- Bottleneck Python 3. 6, 3.7, 3.8; NumPy 1.15 .0+ (follows NEP 29)
105
+ Bottleneck Python 2.7, 3.5, 3. 6, 3.7, 3.8; NumPy 1.16 .0+
127
106
Compile gcc, clang, MinGW or MSVC
128
- Unit tests pytest, hypothesis
107
+ Unit tests pytest
129
108
Documentation sphinx, numpydoc
130
109
======================== ====================================================
131
110
132
- Detailed installation instructions can be found at :ref: `installing `
133
-
134
111
To install Bottleneck on Linux, Mac OS X, et al.::
135
112
136
113
$ pip install .
@@ -146,15 +123,6 @@ http://www.lfd.uci.edu/~gohlke/pythonlibs/#bottleneck
146
123
Unit tests
147
124
==========
148
125
149
- To keep the install dependencies light, test dependencies are made available
150
- via a setuptools "extra":
151
-
152
- $ pip install bottleneck[test]
153
-
154
- Or, if working locally:
155
-
156
- $ pip install .[test]
157
-
158
126
After you have installed Bottleneck, run the suite of unit tests::
159
127
160
128
In [1]: import bottleneck as bn
@@ -166,7 +134,7 @@ After you have installed Bottleneck, run the suite of unit tests::
166
134
rootdir: /home/chris/code/bottleneck, inifile: setup.cfg
167
135
plugins: openfiles-0.3.2, remotedata-0.3.2, doctestplus-0.3.0, mock-1.10.4, forked-1.0.2, cov-2.7.1, hypothesis-4.32.2, xdist-1.26.1, arraydiff-0.3
168
136
collected 190 items
169
-
137
+
170
138
bottleneck/tests/input_modification_test.py ........................... [ 14%]
171
139
.. [ 15%]
172
140
bottleneck/tests/list_input_test.py ............................. [ 30%]
@@ -176,7 +144,7 @@ After you have installed Bottleneck, run the suite of unit tests::
176
144
bottleneck/tests/reduce_test.py ....................................... [ 84%]
177
145
............ [ 90%]
178
146
bottleneck/tests/scalar_input_test.py .................. [100%]
179
-
147
+
180
148
========================= 190 passed in 46.42 seconds =========================
181
149
Out[2]: True
182
150
0 commit comments