Skip to content

Commit

Permalink
Merge branch 'master' into npy-2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip authored May 19, 2019
2 parents db595a0 + 7495de4 commit ecb4024
Show file tree
Hide file tree
Showing 89 changed files with 2,299 additions and 897 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Please be sure you are following the instructions in the dev guidelines
http://www.numpy.org/devdocs/dev/gitwash/development_workflow.html
http://www.numpy.org/devdocs/dev/development_workflow.html
-->

<!-- We'd appreciate it if your commit message is properly formatted
http://www.numpy.org/devdocs/dev/gitwash/development_workflow.html#writing-the-commit-message
http://www.numpy.org/devdocs/dev/development_workflow.html#writing-the-commit-message
-->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ numpy/core/src/npysort/binsearch.c
numpy/core/src/npysort/heapsort.c
numpy/core/src/npysort/mergesort.c
numpy/core/src/npysort/quicksort.c
numpy/core/src/npysort/radixsort.c
numpy/core/src/npysort/selection.c
numpy/core/src/npysort/timsort.c
numpy/core/src/npysort/sort.c
Expand Down
3 changes: 2 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ Warren Weckesser <[email protected]> Warren Weckesser <warren.wecke
Weitang Li <[email protected]> wtli@Dirac <[email protected]>
Weitang Li <[email protected]> wtli <[email protected]>
Wendell Smith <[email protected]> Wendell Smith <[email protected]>
William Spotz <[email protected]@localhost> [email protected] <[email protected]@localhost>
Bill Spotz <[email protected]> William Spotz <[email protected]@localhost>
Bill Spotz <[email protected]> [email protected] <[email protected]@localhost>
Wim Glenn <[email protected]> wim glenn <[email protected]>
Wojtek Ruszczewski <[email protected]> wrwrwr <[email protected]>
Yuji Kanagawa <[email protected]> kngwyu <[email protected]>
Expand Down
30 changes: 0 additions & 30 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



The NumPy repository and source distributions bundle several libraries that are
compatibly licensed. We list these here.

Name: Numpydoc
Files: doc/sphinxext/numpydoc/*
License: 2-clause BSD
For details, see doc/sphinxext/LICENSE.txt

Name: scipy-sphinx-theme
Files: doc/scipy-sphinx-theme/*
License: 3-clause BSD, PSF and Apache 2.0
For details, see doc/scipy-sphinx-theme/LICENSE.txt

Name: lapack-lite
Files: numpy/linalg/lapack_lite/*
License: 3-clause BSD
For details, see numpy/linalg/lapack_lite/LICENSE.txt

Name: tempita
Files: tools/npy_tempita/*
License: BSD derived
For details, see tools/npy_tempita/license.txt

Name: dragon4
Files: numpy/core/src/multiarray/dragon4.c
License: One of a kind
For license text, see numpy/core/src/multiarray/dragon4.c
27 changes: 27 additions & 0 deletions LICENSES_bundled.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The NumPy repository and source distributions bundle several libraries that are
compatibly licensed. We list these here.

Name: Numpydoc
Files: doc/sphinxext/numpydoc/*
License: 2-clause BSD
For details, see doc/sphinxext/LICENSE.txt

Name: scipy-sphinx-theme
Files: doc/scipy-sphinx-theme/*
License: 3-clause BSD, PSF and Apache 2.0
For details, see doc/scipy-sphinx-theme/LICENSE.txt

Name: lapack-lite
Files: numpy/linalg/lapack_lite/*
License: 3-clause BSD
For details, see numpy/linalg/lapack_lite/LICENSE.txt

Name: tempita
Files: tools/npy_tempita/*
License: BSD derived
For details, see tools/npy_tempita/license.txt

Name: dragon4
Files: numpy/core/src/multiarray/dragon4.c
License: One of a kind
For license text, see numpy/core/src/multiarray/dragon4.c
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
include MANIFEST.in
include pytest.ini
include *.txt
include README.md
include site.cfg.example
recursive-include numpy/random/mtrand *.pyx *.pxd
# Add build support that should go in sdist, but not go in bdist/be installed
Expand Down Expand Up @@ -39,3 +40,6 @@ prune benchmarks/numpy
# Exclude generated files
prune */__pycache__
global-exclude *.pyc *.pyo *.pyd *.swp *.bak *~
# Exclude license file that we append to the main license when running
# `python setup.py sdist`
exclude LICENSES_bundled.txt
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@

NumPy is the fundamental package needed for scientific computing with Python.

- **Website (including documentation):** https://www.numpy.org
- **Website:** https://www.numpy.org
- **Documentation:** http://docs.scipy.org/
- **Mailing list:** https://mail.python.org/mailman/listinfo/numpy-discussion
- **Source:** https://github.com/numpy/numpy
- **Bug reports:** https://github.com/numpy/numpy/issues
- **Source code:** https://github.com/numpy/numpy
- **Contributing:** https://www.numpy.org/devdocs/dev/index.html
- **Bug reports:** https://github.com/numpy/numpy/issues
- **Report a security vulnerability:** https://tidelift.com/docs/security

It provides:

Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
F77=gfortran-5 F90=gfortran-5 \
CFLAGS='-UNDEBUG -std=c99' python3 runtests.py --mode=full -- -rsx --junitxml=junit/test-results.xml"
displayName: 'Run 32-bit Ubuntu Docker Build / Tests'
continueOnError: true
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
Expand Down Expand Up @@ -101,8 +101,8 @@ jobs:
displayName: 'Run Refuide Check'
- script: python runtests.py --mode=full -- -rsx --junitxml=junit/test-results.xml
displayName: 'Run Full NumPy Test Suite'
continueOnError: true
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
Expand Down Expand Up @@ -204,8 +204,8 @@ jobs:
displayName: 'For gh-12667; Windows DLL resolution'
- script: python runtests.py -n --show-build-log --mode=$(TEST_MODE) -- -rsx --junitxml=junit/test-results.xml
displayName: 'Run NumPy Test Suite'
continueOnError: true
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
Expand All @@ -217,8 +217,8 @@ jobs:
steps:
- script: source tools/pypy-test.sh
displayName: 'Run PyPy3 Build / Tests'
continueOnError: true
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for PyPy3'
Expand Down
45 changes: 32 additions & 13 deletions benchmarks/benchmarks/bench_function_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ def time_select_larger(self):
np.select(self.cond_large, ([self.d, self.e] * 10))


def memoize(f):
_memoized = {}
def wrapped(*args):
if args not in _memoized:
_memoized[args] = f(*args)

return _memoized[args].copy()

return f


class SortGenerator(object):
# The size of the unsorted area in the "random unsorted area"
# benchmarks
Expand All @@ -103,6 +114,7 @@ class SortGenerator(object):
BUBBLE_SIZE = 100

@staticmethod
@memoize
def random(size, dtype):
"""
Returns a randomly-shuffled array.
Expand All @@ -112,27 +124,31 @@ def random(size, dtype):
return arr

@staticmethod
@memoize
def ordered(size, dtype):
"""
Returns an ordered array.
"""
return np.arange(size, dtype=dtype)

@staticmethod
@memoize
def reversed(size, dtype):
"""
Returns an array that's in descending order.
"""
return np.arange(size-1, -1, -1, dtype=dtype)

@staticmethod
@memoize
def uniform(size, dtype):
"""
Returns an array that has the same value everywhere.
"""
return np.ones(size, dtype=dtype)

@staticmethod
@memoize
def swapped_pair(size, dtype, swap_frac):
"""
Returns an ordered array, but one that has ``swap_frac * size``
Expand All @@ -145,6 +161,7 @@ def swapped_pair(size, dtype, swap_frac):
return a

@staticmethod
@memoize
def sorted_block(size, dtype, block_size):
"""
Returns an array with blocks that are all sorted.
Expand All @@ -159,6 +176,7 @@ def sorted_block(size, dtype, block_size):
return np.array(b)

@classmethod
@memoize
def random_unsorted_area(cls, size, dtype, frac, area_size=None):
"""
This type of array has random unsorted areas such that they
Expand All @@ -176,6 +194,7 @@ def random_unsorted_area(cls, size, dtype, frac, area_size=None):
return a

@classmethod
@memoize
def random_bubble(cls, size, dtype, bubble_num, bubble_size=None):
"""
This type of array has ``bubble_num`` random unsorted areas.
Expand All @@ -197,7 +216,7 @@ class Sort(Benchmark):
# In NumPy 1.17 and newer, 'merge' can be one of several
# stable sorts, it isn't necessarily merge sort.
['quick', 'merge', 'heap'],
['float64', 'int64', 'uint64'],
['float64', 'int64', 'int16'],
[
('random',),
('ordered',),
Expand All @@ -206,15 +225,15 @@ class Sort(Benchmark):
('sorted_block', 10),
('sorted_block', 100),
('sorted_block', 1000),
('swapped_pair', 0.01),
('swapped_pair', 0.1),
('swapped_pair', 0.5),
('random_unsorted_area', 0.5),
('random_unsorted_area', 0.1),
('random_unsorted_area', 0.01),
('random_bubble', 1),
('random_bubble', 5),
('random_bubble', 10),
# ('swapped_pair', 0.01),
# ('swapped_pair', 0.1),
# ('swapped_pair', 0.5),
# ('random_unsorted_area', 0.5),
# ('random_unsorted_area', 0.1),
# ('random_unsorted_area', 0.01),
# ('random_bubble', 1),
# ('random_bubble', 5),
# ('random_bubble', 10),
],
]
param_names = ['kind', 'dtype', 'array_type']
Expand All @@ -227,10 +246,10 @@ def setup(self, kind, dtype, array_type):
array_class = array_type[0]
self.arr = getattr(SortGenerator, array_class)(self.ARRAY_SIZE, dtype, *array_type[1:])

def time_sort_inplace(self, kind, dtype, array_type):
self.arr.sort(kind=kind)

def time_sort(self, kind, dtype, array_type):
# Using np.sort(...) instead of arr.sort(...) because it makes a copy.
# This is important because the data is prepared once per benchmark, but
# used across multiple runs.
np.sort(self.arr, kind=kind)

def time_argsort(self, kind, dtype, array_type):
Expand Down
2 changes: 1 addition & 1 deletion doc/C_STYLE_GUIDE.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Code lay-out
the open paren, no spaces inside the parens, no spaces before
commas, one space after each comma.

* Always put spaces around assignment, Boolean and comparison
* Always put spaces around the assignment, Boolean and comparison
operators. In expressions using a lot of operators, add spaces
around the outermost (lowest priority) operators.

Expand Down
Loading

0 comments on commit ecb4024

Please sign in to comment.