Skip to content

Commit bcf5aa9

Browse files
committed
MNT: Revert to code from v1.3.2
1 parent a1d8b27 commit bcf5aa9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2895
-2831
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,68 +8,36 @@ jobs:
88
strategy:
99
max-parallel: 12
1010
matrix:
11-
python-version: [3.7, 3.8, 3.9]
12-
os: [ubuntu-latest, macOS-latest, windows-latest]
11+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
12+
os: [ubuntu-latest, macOS-latest]
13+
exclude:
14+
- os: macOS-latest
15+
python-version: 3.8
1316

1417
steps:
1518
- uses: actions/checkout@v1
1619
- name: Set up Python ${{ matrix.python-version }}
1720
uses: actions/setup-python@v1
1821
with:
1922
python-version: ${{ matrix.python-version }}
20-
- uses: actions/cache@v1
21-
if: startsWith(runner.os, 'Linux')
22-
with:
23-
path: ~/.cache/pip
24-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
25-
restore-keys: |
26-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
27-
28-
- uses: actions/cache@v1
29-
if: startsWith(runner.os, 'macOS')
30-
with:
31-
path: ~/Library/Caches/pip
32-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
33-
restore-keys: |
34-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
35-
36-
- uses: actions/cache@v1
37-
if: startsWith(runner.os, 'Windows')
38-
with:
39-
path: ~\AppData\Local\pip\Cache
40-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
41-
restore-keys: |
42-
${{ runner.os }}-py${{ matrix.python-version }}-pip-
43-
44-
- name: Install style dependencies
45-
if: matrix.python-version == 3.9
23+
- name: Install dependencies
4624
run: |
4725
python -m pip install --upgrade pip
48-
pip install flake8 isort>=5 black>=20.8b1
26+
pip install numpy pytest flake8
4927
- name: Build
5028
run: |
5129
python setup.py build_ext --inplace
52-
pip install .[test]
5330
- name: Lint with flake8
54-
if: matrix.python-version == 3.9
5531
run: |
5632
# stop the build if there are Python syntax errors or undefined names
5733
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
5834
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
5935
flake8 . --count --statistics
60-
- name: Check import sorting with isort
61-
if: matrix.python-version == 3.9
62-
run: |
63-
isort -c --df .
6436
- name: Check formatting with black
65-
if: matrix.python-version == 3.9
37+
if: matrix.python-version >= 3.6
6638
run: |
39+
pip install black
6740
black . --check --exclude "(build/|dist/|\.git/|\.mypy_cache/|\.tox/|\.venv/\.asv/|env|\.eggs)"
68-
- name: Check formatting with clang-format
69-
if: (matrix.python-version == 3.9) && (startsWith(runner.os, 'Linux'))
70-
run: |
71-
clang-format -i --style=file bottleneck/**/*.c bottleneck/**/*.h
72-
git diff --exit-code
7341
- name: Test with pytest
7442
run: |
7543
pytest

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,4 @@ MANIFEST
88
*.egg-info
99
.*.swp
1010
*~
11-
\#*#
12-
.eggs
13-
.hypothesis
14-
.mypy_cache
15-
**/env
16-
**/*results
17-
**/html
11+
\#*#

.travis.yml

Lines changed: 85 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,102 @@
1-
os: linux
1+
22
language: generic
3-
cache:
4-
directories:
5-
- $HOME/.cache/pip
6-
- .hypothesis
3+
sudo: false
4+
cache: pip
75

86
git:
97
depth: false
108

11-
jobs:
9+
matrix:
1210
fast_finish: true
1311
include:
12+
13+
# test installing bottleneck tarball before installing numpy;
14+
# start this test first because it takes the longest
15+
- os: linux
16+
env: TEST_DEPS="numpy pytest"
17+
PYTHON_VERSION="2.7"
18+
PYTHON_ARCH="64"
19+
TEST_RUN="sdist"
20+
21+
# flake8 and black
22+
- os: linux
23+
env: TEST_DEPS="flake8 black"
24+
PYTHON_VERSION="3.7"
25+
PYTHON_ARCH="64"
26+
TEST_RUN="style"
27+
28+
# doc check
29+
- os: linux
30+
env: TEST_DEPS="sphinx numpydoc gitpython"
31+
PYTHON_VERSION="3.7"
32+
PYTHON_ARCH="64"
33+
TEST_RUN="doc"
34+
35+
# python 3.5
36+
- os: linux
37+
env: TEST_DEPS="pytest"
38+
PIP_DEPS="numpy>=1.16"
39+
PYTHON_VERSION="3.5"
40+
PYTHON_ARCH="64"
41+
TEST_RUN="sdist"
42+
43+
# python 3.6
1444
- os: linux
15-
arch: arm64
16-
env: TEST_DEPS="numpy"
45+
env: TEST_DEPS="numpy pytest"
46+
PYTHON_VERSION="3.6"
47+
PYTHON_ARCH="64"
48+
49+
# python 3.7
50+
- os: linux
51+
env: TEST_DEPS="numpy pytest"
1752
PYTHON_VERSION="3.7"
1853
PYTHON_ARCH="64"
1954

55+
# python 3.8 conda numpy
56+
- os: linux
57+
env: TEST_DEPS="numpy pytest"
58+
PYTHON_VERSION="3.8"
59+
PYTHON_ARCH="64"
60+
61+
# python 3.8 conda numpy + sdist
2062
- os: linux
21-
arch: ppc64le
22-
env: TEST_DEPS="numpy gfortran_linux-ppc64le=8.2.0"
63+
env: TEST_DEPS="numpy pytest"
64+
PYTHON_VERSION="3.8"
65+
PYTHON_ARCH="64"
66+
TEST_RUN="sdist"
67+
68+
# python 2.7
69+
- os: osx
70+
env: TEST_DEPS="numpy pytest"
71+
PYTHON_VERSION="2.7"
72+
PYTHON_ARCH="64"
73+
TEST_RUN="sdist"
74+
75+
# python 3.5
76+
- os: osx
77+
env: TEST_DEPS="pytest"
78+
PIP_DEPS="numpy>=1.16"
79+
PYTHON_VERSION="3.5"
80+
PYTHON_ARCH="64"
81+
82+
# python 3.6
83+
- os: osx
84+
env: TEST_DEPS="numpy pytest"
85+
PYTHON_VERSION="3.6"
86+
PYTHON_ARCH="64"
87+
88+
# python 3.7
89+
- os: osx
90+
env: TEST_DEPS="numpy pytest"
2391
PYTHON_VERSION="3.7"
2492
PYTHON_ARCH="64"
2593

94+
# python 3.8
95+
- os: osx
96+
env: TEST_DEPS="numpy pytest"
97+
PYTHON_VERSION="3.8"
98+
PYTHON_ARCH="64"
99+
26100
before_install:
27101
- uname -a
28102
- source "tools/travis/conda_setup.sh"
@@ -31,7 +105,7 @@ install:
31105
- source "tools/travis/conda_install.sh"
32106

33107
script:
34-
- ./tools/travis/bn_setup.sh
108+
- source "tools/travis/bn_setup.sh"
35109

36110
notifications:
37111
email:

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ recursive-include doc *
1616
recursive-exclude doc/build *
1717
include versioneer.py
1818
include bottleneck/_version.py
19-
include bottleneck/tests/data/template_test/truth.c
20-
include bottleneck/tests/data/template_test/test_template.c
2119

2220
global-exclude __pycache__
2321
global-exclude *.pyc

Makefile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,19 @@ srcdir := bottleneck
77
help:
88
@echo "Available tasks:"
99
@echo "help --> This help page"
10-
@echo "all --> clean, flake8, isort, black, build, test"
10+
@echo "all --> clean, build, flake8, test"
1111
@echo "build --> Build the Python C extensions"
1212
@echo "clean --> Remove all the build files for a fresh start"
1313
@echo "test --> Run unit tests"
1414
@echo "flake8 --> Check for pep8 errors"
15-
@echo "isort --> Run isort to format imports"
16-
@echo "black --> Run black formatting tool"
17-
@echo "clang-format --> Run clang-format tool"
1815
@echo "readme --> Update benchmark results in README.rst"
1916
@echo "bench --> Run performance benchmark"
2017
@echo "detail --> Detailed benchmarks for all functions"
2118
@echo "sdist --> Make source distribution"
2219
@echo "doc --> Build Sphinx manual"
2320
@echo "pypi --> Upload to pypi"
2421

25-
all: clean flake8 isort black build test
22+
all: clean build test flake8
2623

2724
build:
2825
${PYTHON} setup.py build_ext --inplace
@@ -33,15 +30,9 @@ test:
3330
flake8:
3431
flake8
3532

36-
isort:
37-
isort -rc .
38-
3933
black:
4034
black . --exclude "(build/|dist/|\.git/|\.mypy_cache/|\.tox/|\.venv/\.asv/|env|\.eggs)"
4135

42-
clang-format:
43-
clang-format --style=file -i bottleneck/**/*.c bottleneck/**/*.h
44-
4536
readme:
4637
PYTHONPATH=`pwd`:PYTHONPATH ${PYTHON} tools/update_readme.py
4738

README.rst

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,7 @@
77
Bottleneck
88
==========
99

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.
3011

3112
Let's give it a try. Create a NumPy array::
3213

@@ -44,8 +25,6 @@ Moving window mean::
4425
>>> bn.move_mean(a, window=2, min_count=1)
4526
array([ 1. , 1.5, 2. , 4. , 4.5])
4627

47-
.. _benchmarking:
48-
4928
Benchmark
5029
=========
5130

@@ -123,14 +102,12 @@ Install
123102
Requirements:
124103

125104
======================== ====================================================
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+
127106
Compile gcc, clang, MinGW or MSVC
128-
Unit tests pytest, hypothesis
107+
Unit tests pytest
129108
Documentation sphinx, numpydoc
130109
======================== ====================================================
131110

132-
Detailed installation instructions can be found at :ref:`installing`
133-
134111
To install Bottleneck on Linux, Mac OS X, et al.::
135112

136113
$ pip install .
@@ -146,15 +123,6 @@ http://www.lfd.uci.edu/~gohlke/pythonlibs/#bottleneck
146123
Unit tests
147124
==========
148125

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-
158126
After you have installed Bottleneck, run the suite of unit tests::
159127

160128
In [1]: import bottleneck as bn
@@ -166,7 +134,7 @@ After you have installed Bottleneck, run the suite of unit tests::
166134
rootdir: /home/chris/code/bottleneck, inifile: setup.cfg
167135
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
168136
collected 190 items
169-
137+
170138
bottleneck/tests/input_modification_test.py ........................... [ 14%]
171139
.. [ 15%]
172140
bottleneck/tests/list_input_test.py ............................. [ 30%]
@@ -176,7 +144,7 @@ After you have installed Bottleneck, run the suite of unit tests::
176144
bottleneck/tests/reduce_test.py ....................................... [ 84%]
177145
............ [ 90%]
178146
bottleneck/tests/scalar_input_test.py .................. [100%]
179-
147+
180148
========================= 190 passed in 46.42 seconds =========================
181149
Out[2]: True
182150

0 commit comments

Comments
 (0)