Skip to content

Commit

Permalink
Merge branch 'master' into force-tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser authored May 26, 2018
2 parents 0addc01 + c1fc882 commit a10b427
Show file tree
Hide file tree
Showing 369 changed files with 16,053 additions and 10,985 deletions.
43 changes: 17 additions & 26 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ max_jobs: 100
cache:
- '%LOCALAPPDATA%\pip\Cache'

matrix:
allow_failures:
- USE_PYTEST: true

environment:
global:
MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
Expand All @@ -27,7 +23,7 @@ environment:
- PYTHON: C:\Python34-x64
PYTHON_VERSION: 3.4
PYTHON_ARCH: 64
USE_PYTEST: true
TEST_MODE: fast

- PYTHON: C:\Python36
PYTHON_VERSION: 3.6
Expand Down Expand Up @@ -107,30 +103,25 @@ build_script:
# Here, we add MinGW to the path to be able to link an OpenBLAS.dll
# We then use the import library from the DLL to compile with MSVC
- ps: |
If ($env:USE_PYTEST -eq "true") {
pip install -e .
} Else {
pip wheel -v -v -v --wheel-dir=dist .
# For each wheel that pip has placed in the "dist" directory
# First, upload the wheel to the "artifacts" tab and then
# install the wheel. If we have only built numpy (as is the case here),
# then there will be one wheel to install.
# This method is more representative of what will be distributed,
# because it actually tests what the built wheels will be rather than
# what 'setup.py install' will do and at it uploads the wheels so that
# they can be inspected.
ls dist -r | Foreach-Object {
appveyor PushArtifact $_.FullName
pip install $_.FullName
}
pip wheel -v -v -v --wheel-dir=dist .
# For each wheel that pip has placed in the "dist" directory
# First, upload the wheel to the "artifacts" tab and then
# install the wheel. If we have only built numpy (as is the case here),
# then there will be one wheel to install.
# This method is more representative of what will be distributed,
# because it actually tests what the built wheels will be rather than
# what 'setup.py install' will do and at it uploads the wheels so that
# they can be inspected.
ls dist -r | Foreach-Object {
Push-AppveyorArtifact $_.FullName
pip install $_.FullName
}
test_script:
- if [%USE_PYTEST%]==[true] pytest -n3 --junitxml=junit-results.xml
- if [%USE_PYTEST%]==[] python runtests.py -v -n -m %TEST_MODE%
python runtests.py -v -n -m %TEST_MODE% -- --junitxml=%cd%\junit-results.xml

after_build:
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
Expand Down
50 changes: 48 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
python3 -m venv venv
. venv/bin/activate
pip install cython sphinx matplotlib
sudo apt-get update
sudo apt-get install -y graphviz texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-generic-extra latexmk texlive-xetex
- run:
name: build numpy
Expand All @@ -29,6 +31,7 @@ jobs:
pip install --upgrade pip setuptools
pip install cython
pip install .
pip install scipy
- run:
name: build devdocs
Expand All @@ -54,8 +57,51 @@ jobs:
# path: doc/neps/_build/html/
# destination: neps

- deploy:
- add_ssh_keys:
fingerprints:
- "9f:8c:e5:3f:53:40:0b:ee:c9:c3:0f:fd:0f:3c:cc:55"

- run:
name: deploy devdocs
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
echo "Deploying on master"
touch doc/build/html/.nojekyll
./tools/ci/push_docs_to_repo.py doc/build/html \
[email protected]:numpy/devdocs.git \
--committer "numpy-circleci-bot" \
--email "numpy-circleci-bot@nomail" \
--message "Docs build of $CIRCLE_SHA1" \
--force
else
echo "Not on the master branch; skipping deployment"
fi
- add_ssh_keys:
fingerprints:
- "11:fb:19:69:80:3a:6d:37:9c:d1:ac:20:17:cd:c8:17"

- run:
name: select SSH key for neps repo
command: |
cat <<\EOF > ~/.ssh/config
Host github.com
IdentitiesOnly yes
IdentityFile /home/circleci/.ssh/id_rsa_11fb1969803a6d379cd1ac2017cdc817
EOF
- run:
name: deploy neps
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
touch doc/neps/_build/html/.nojekyll
./tools/ci/push_docs_to_repo.py doc/neps/_build/html \
[email protected]:numpy/neps.git \
--committer "numpy-circleci-bot" \
--email "numpy-circleci-bot@nomail" \
--message "Docs build of $CIRCLE_SHA1" \
--force
else
echo "Not on the master branch; skipping deployment"
fi
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
branch = True
include = */numpy/*
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Icon?
ehthumbs.db
Thumbs.db

# pytest generated files #
##########################
/.pytest_cache

# Things specific to this project #
###################################
numpy/core/__svn_version__.py
Expand Down
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,41 +35,41 @@ python:
- 3.4
- 3.5
- 3.6
- 3.7-dev
matrix:
include:
- python: 2.7
env: USE_CHROOT=1 ARCH=i386 DIST=artful PYTHON=2.7
- python: 3.6
env: USE_CHROOT=1 ARCH=i386 DIST=artful PYTHON=3.6
sudo: true
dist: trusty
addons:
apt:
packages:
- debootstrap
- python: 3.4
env: USE_DEBUG=1
dist: trusty
addons:
apt:
packages:
- *common_packages
- cython3-dbg
- python3-dbg
- python3-dev
- python3-nose
- python3-setuptools
- python: 3.5
- python: 3.6
env: USE_WHEEL=1 RUN_FULL_TESTS=1
- python: 3.5
env: USE_SDIST=1
- python: 2.7
env: USE_WHEEL=1 RUN_FULL_TESTS=1 PYTHON_OPTS="-3 -OO"
- python: 3.6
env: USE_SDIST=1
- python: 3.6
env:
- PYTHONOPTIMIZE=2
- USE_ASV=1
- python: 2.7
env: NPY_RELAXED_STRIDES_CHECKING=0 PYTHON_OPTS="-3 -OO"
- python: 2.7
- python: 3.5
env: NPY_RELAXED_STRIDES_CHECKING=0
- python: 3.6
env: USE_WHEEL=1 NPY_RELAXED_STRIDES_DEBUG=1
- python: 2.7
- python: 3.6
env:
- BLAS=None
- LAPACK=None
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Thanks for your interest in contributing code to numpy!

+ If this is your first time contributing to a project on GitHub, please read
through our
[guide to contributing to numpy](http://docs.scipy.org/doc/numpy-dev/dev/index.html)
[guide to contributing to numpy](http://docs.scipy.org/doc/numpy/dev/index.html)
+ If you have contributed to other projects on GitHub you can go straight to our
[development workflow](http://docs.scipy.org/doc/numpy-dev/dev/gitwash/development_workflow.html)
[development workflow](http://docs.scipy.org/doc/numpy/dev/gitwash/development_workflow.html)

Either way, please be sure to follow our
[convention for commit messages](http://docs.scipy.org/doc/numpy-dev/dev/gitwash/development_workflow.html#writing-the-commit-message).
[convention for commit messages](http://docs.scipy.org/doc/numpy/dev/gitwash/development_workflow.html#writing-the-commit-message).

If you are writing new C code, please follow the style described in
``doc/C_STYLE_GUIDE``.
Expand Down
7 changes: 6 additions & 1 deletion INSTALL.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ nose__ http://nose.readthedocs.io

If you want to build NumPy in order to work on NumPy itself, use
``runtests.py``. For more details, see
http://docs.scipy.org/doc/numpy-dev/dev/development_environment.html
http://docs.scipy.org/doc/numpy/dev/development_environment.html

.. note::

Expand All @@ -61,6 +61,11 @@ To perform an inplace build that can be run from the source folder run::

python setup.py build_ext --inplace -j 4

Note that the ``python`` command here is the system default Python, generally
python 2, the ``python3`` command may be needed to install on python 3.
See `Requirements for Installing Packages <https://packaging.python.org/tutorials/installing-packages/>`_
for more details.

The number of build jobs can also be specified via the environment variable
NPY_NUM_BUILD_JOBS.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img alt="NumPy" src="branding/icons/numpylogo.svg" height="60">
# <img alt="NumPy" src="https://cdn.rawgit.com/numpy/numpy/master/branding/icons/numpylogo.svg" height="60">

[![Travis](https://img.shields.io/travis/numpy/numpy/master.svg?label=Travis%20CI)](https://travis-ci.org/numpy/numpy)
[![AppVeyor](https://img.shields.io/appveyor/ci/charris/numpy/master.svg?label=AppVeyor)](https://ci.appveyor.com/project/charris/numpy)
Expand Down
25 changes: 25 additions & 0 deletions benchmarks/benchmarks/bench_lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Benchmarks for `numpy.lib`."""


from __future__ import absolute_import, division, print_function

from .common import Benchmark

import numpy as np


class Pad(Benchmark):
"""Benchmarks for `numpy.pad`."""

param_names = ["shape", "pad_width", "mode"]
params = [
[(1000,), (10, 100), (10, 10, 10)],
[1, 3, (0, 5)],
["constant", "edge", "linear_ramp", "mean", "reflect", "wrap"],
]

def setup(self, shape, pad_width, mode):
self.array = np.empty(shape)

def time_pad(self, shape, pad_width, mode):
np.pad(self.array, pad_width, mode)
15 changes: 15 additions & 0 deletions benchmarks/benchmarks/bench_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,18 @@ def time_randint_slow(self, name):
high = self.high[name]
np.random.randint(0, high + 1, size=10**5, dtype=name)


class Permutation(Benchmark):
def setup(self):
self.n = 10000
self.a_1d = np.random.random_sample(self.n)
self.a_2d = np.random.random_sample((self.n, 2))

def time_permutation_1d(self):
np.random.permutation(self.a_1d)

def time_permutation_2d(self):
np.random.permutation(self.a_2d)

def time_permutation_int(self):
np.random.permutation(self.n)
Loading

0 comments on commit a10b427

Please sign in to comment.