8000 DOC: change all non-code instances of Numpy to NumPy by pdebuyl · Pull Request #8021 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: change all non-code instances of Numpy to NumPy #8021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 7, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOC: change Numpy to NumPy in dosctrings and comments
The strings in error messages were left untouched
  • Loading branch information
pdebuyl committed Sep 6, 2016
commit 2a55233b81a6ea18a57d1dd4f7bc5fff9f2fb681
4 changes: 2 additions & 2 deletions numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
polynomial
Polynomial tools
testing
Numpy testing tools
NumPy testing tools
f2py
Fortran to Python Interface Generator.
distutils
Expand All @@ -83,7 +83,7 @@
matlib
Make everything matrices.
__version__
Numpy version string
NumPy version string

Viewing documentation using IPython
-----------------------------------
Expand Down
20 changes: 10 additions & 10 deletions numpy/add_newdocs.py
< 6D40 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
Notes
-----
`nditer` supersedes `flatiter`. The iterator implementation behind
`nditer` is also exposed by the Numpy C API.
`nditer` is also exposed by the NumPy C API.

The Python exposure supplies two iteration interfaces, one which follows
the Python iterator protocol, and another which mirrors the C-style
Expand Down Expand Up @@ -570,7 +570,7 @@ def luf(lamdaexpr, *args, **kwargs):

add_newdoc('numpy.core', 'broadcast', ('nd',
"""
Number of dimensions of broadcasted result. For code intended for Numpy
Number of dimensions of broadcasted result. For code intended for NumPy
1.12.0 and later the more consistent `ndim` is preferred.

Examples
Expand Down Expand Up @@ -2014,7 +2014,7 @@ def luf(lamdaexpr, *args, **kwargs):
were elements.

.. warning::
This function is preliminary and included in Numpy 1.10 for testing
This function is preliminary and included in NumPy 1.10 for testing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.10. -> 1.10.0

and documentation. Its semantics will not change, but the number and
order of the optional arguments will.

Expand Down Expand Up @@ -4841,7 +4841,7 @@ def luf(lamdaexpr, *args, **kwargs):
"""
frompyfunc(func, nin, nout)

Takes an arbitrary Python function and returns a Numpy ufunc.
Takes an arbitrary Python function and returns a NumPy ufunc.

Can be used, for example, to add broadcasting to a built-in Python
function (see Examples section).
Expand All @@ -4858,7 +4858,7 @@ def luf(lamdaexpr, *args, **kwargs):
Returns
-------
out : ufunc
Returns a Numpy universal function (``ufunc``) object.
Returns a NumPy universal function (``ufunc``) object.

See Also
--------
Expand Down Expand Up @@ -4888,7 +4888,7 @@ def luf(lamdaexpr, *args, **kwargs):
Return the current object that defines floating-point error handling.

The error object contains all information that defines the error handling
behavior in Numpy. `geterrobj` is used internally by the other
behavior in NumPy. `geterrobj` is used internally by the other
functions that get and set error handling behavior (`geterr`, `seterr`,
`geterrcall`, `seterrcall`).

Expand Down Expand Up @@ -4952,7 +4952,7 @@ def luf(lamdaexpr, *args, **kwargs):
Set the object that defines floating-point error handling.

The error object contains all information that defines the error handling
behavior in Numpy. `seterrobj` is used internally by the other
behavior in NumPy. `seterrobj` is used internally by the other
functions that set error handling behavior (`seterr`, `seterrcall`).

Parameters
Expand Down Expand Up @@ -5028,7 +5028,7 @@ def luf(lamdaexpr, *args, **kwargs):
Parameters
----------
x : array_like
Input array to be binned. Prior to Numpy 1.10.0, this array had to
Input array to be binned. Prior to NumPy 1.10.0, this array had to
be 1-dimensional, but can now have any shape.
bins : array_like
Array of bins. It has to be 1-dimensional and monotonic.
Expand Down Expand Up @@ -6235,7 +6235,7 @@ def luf(lamdaexpr, *args, **kwargs):
2 if the dtype is for a user-defined numpy type
A user-defined type uses the numpy C-API machinery to extend
numpy to handle a new array type. See
:ref:`user.user-defined-data-types` in the Numpy manual.
:ref:`user.user-defined-data-types` in the NumPy manual.
= ========================================================================

Examples
Expand Down Expand Up @@ -7623,7 +7623,7 @@ def luf(lamdaexpr, *args, **kwargs):
##############################################################################

add_newdoc('numpy.core.numerictypes', 'bool_',
"""Numpy's Boolean type. Character code: ``?``. Alias: bool8""")
"""NumPy's Boolean type. Character code: ``?``. Alias: bool8""")

add_newdoc('numpy.core.numerictypes', 'complex64',
"""
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def _view_is_safe(oldtype, newtype):
return

# Given a string containing a PEP 3118 format specifier,
# construct a Numpy dtype
# construct a NumPy dtype

_pep3118_native_map = {
'?': '?',
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/code_generators/cversions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Version 9 (NumPy 1.8) Added interface for partition functions,
# PyArray_NEW_ZEROED, commented out as the hash changed in
# Numpy 1.9 due to annotation.
# NumPy 1.9 due to annotation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.9.0

#0x00000009 = 327bd114df09c2eb7a0bcc6901e2a3ed

# Version 9 (NumPy 1.9) Added function annotations.
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/code_generators/generate_numpy_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

c_api_header = """
===========
Numpy C-API
NumPy C-API
===========
"""

Expand Down
2 changes: 1 addition & 1 deletion numpy/core/code_generators/generate_ufunc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def do_generate_api(targets, sources):
fid = open(doc_file, 'w')
fid.write('''
=================
Numpy Ufunc C-API
NumPy Ufunc C-API
=================
''')
for func in ufunc_api_list:
Expand Down
6 changes: 3 additions & 3 deletions numpy/core/code_generators/ufunc_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ def add_newdoc(place, name, doc):
Not a Number, positive infinity and negative infinity are considered
to be non-finite.

Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic
NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.
Also that positive infinity is not equivalent to negative infinity. But
infinity is equivalent to positive infinity. Errors result if the
Expand Down Expand Up @@ -1597,7 +1597,7 @@ def add_newdoc(place, name, doc):

Notes
-----
Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic
NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754).

Errors result if the second argument is supplied when the first
Expand Down Expand Up @@ -1650,7 +1650,7 @@ def add_newdoc(place, name, doc):

Notes
-----
Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic
NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.

Examples
Expand Down
14 changes: 7 additions & 7 deletions numpy/core/defchararray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ class chararray(ndarray):
`dtype` `object_`, `string_` or `unicode_`, and use the free functions
in the `numpy.char` module for fast vectorized string operations.

Versus a regular Numpy array of type `str` or `unicode`, this
Versus a regular NumPy array of type `str` or `unicode`, this
class adds the following functionality:

1) values automatically have whitespace removed from the end
Expand Down Expand Up @@ -1817,7 +1817,7 @@ def __new__(subtype, shape, itemsize=1, unicode=False, buffer=None,
else:
dtype = string_

# force itemsize to be a Python long, since using Numpy integer
# force itemsize to be a Python long, since using NumPy integer
# types results in itemsize.itemsize being used as the size of
# strings in the new array.
itemsize = long(itemsize)
Expand Down Expand Up @@ -2486,7 +2486,7 @@ def array(obj, itemsize=None, copy=True, unicode=None, order=None):
in :mod:`numpy.char <numpy.core.defchararray>` for fast
vectorized string operations instead.

Versus a regular Numpy array of type `str` or `unicode`, this
Versus a regular NumPy array of type `str` or `unicode`, this
class adds the following functionality:

1) values automatically have whitespace removed from the end
Expand Down Expand Up @@ -2552,12 +2552,12 @@ class adds the following functionality:
if sys.maxunicode == 0xffff:
# On a narrow Python build, the buffer for Unicode
# strings is UCS2, which doesn't match the buffer for
# Numpy Unicode types, which is ALWAYS UCS4.
# NumPy Unicode types, which is ALWAYS UCS4.
# Therefore, we need to convert the buffer. On Python
# 2.6 and later, we can use the utf_32 codec. Earlier
# versions don't have that codec, so we convert to a
# numerical array that matches the input buffer, and
# then use Numpy to convert it to UCS4. All of this
# then use NumPy to convert it to UCS4. All of this
# should happen in native endianness.
if sys.hexversion >= 0x2060000:
obj = obj.encode('utf_32')
Expand Down Expand Up @@ -2593,7 +2593,7 @@ class adds the following functionality:
itemsize = obj.itemsize
# itemsize is in 8-bit chars, so for Unicode, we need
# to divide by the size of a single Unicode character,
# which for Numpy is always 4
# which for NumPy is always 4
if issubclass(obj.dtype.type, unicode_):
itemsize //= 4

Expand Down Expand Up @@ -2642,7 +2642,7 @@ def asarray(obj, itemsize=None, unicode=None, order=None):
Convert the input to a `chararray`, copying the data only if
necessary.

Versus a regular Numpy array of type `str` or `unicode`, this
Versus a regular NumPy array of type `str` or `unicode`, this
class adds the following functionality:

1) values automatically have whitespace removed from the end
Expand Down
10 changes: 5 additions & 5 deletions numpy/core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ def swapaxes(a, axis1, axis2):
Returns
-------
a_swapped : ndarray
For Numpy >= 1.10, if `a` is an ndarray, then a view of `a` is
returned; otherwise a new array is created. For earlier Numpy
For NumPy >= 1.10, if `a` is an ndarray, then a view of `a` is
returned; otherwise a new array is created. For earlier NumPy
versions a view of `a` is returned only if the order of the
axes is changed, otherwise the input array is returned.

Expand Down Expand Up @@ -1059,7 +1059,7 @@ def searchsorted(a, v, side='left', sorter=None):
-----
Binary search is used to find the required insertion points.

As of Numpy 1.4.0 `searchsorted` works with real/complex arrays containing
As of NumPy 1.4.0 `searchsorted` works with real/complex arrays containing
`nan` values. The enhanced 10000 sort order is documented in `sort`.

Examples
Expand Down Expand Up @@ -2631,7 +2631,7 @@ def rank(a):
Notes
-----
In the old Numeric package, `rank` was the term used for the number of
dimensions, but in Numpy `ndim` is used instead.
dimensions, but in NumPy `ndim` is used instead.

Examples
--------
Expand Down Expand Up @@ -2737,7 +2737,7 @@ def around(a, decimals=0, out=None):

Notes
-----
For values exactly halfway between rounded decimal values, Numpy
For values exactly halfway between rounded decimal values, NumPy
rounds to the nearest even value. Thus 1.5 and 2.5 round to 2.0,
-0.5 and 0.5 round to 0.0, etc. Results may also be surprising due
to the inexact representation of decimal fractions in the IEEE
Expand Down
6 changes: 3 additions & 3 deletions numpy/core/include/numpy/npy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,21 +372,21 @@ typedef struct {npy_longdouble real, imag;} npy_clongdouble;
#endif
#if NPY_SIZEOF_COMPLEX_DOUBLE != 2 * NPY_SIZEOF_DOUBLE
#error npy_cdouble definition is not compatible with C99 complex definition ! \
Please contact Numpy maintainers and give detailed information about your \
Please contact NumPy maintainers and give detailed information about your \
compiler and platform
#endif
typedef struct { double real, imag; } npy_cdouble;

#if NPY_SIZEOF_COMPLEX_FLOAT != 2 * NPY_SIZEOF_FLOAT
#error npy_cfloat definition is not compatible with C99 complex definition ! \
Please contact Numpy maintainers and give detailed information about your \
Please contact NumPy maintainers and give detailed information about your \
compiler and platform
#endif
typedef struct { float real, imag; } npy_cfloat;

#if NPY_SIZEOF_COMPLEX_LONGDOUBLE != 2 * NPY_SIZEOF_LONGDOUBLE
#error npy_clongdouble definition is not compatible with C99 complex definition ! \
Please contact Numpy maintainers and give detailed information about your \
Please contact NumPy maintainers and give detailed information about your \
compiler and platform
#endif
typedef struct { npy_longdouble real, imag; } npy_clongdouble;
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/memmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class memmap(ndarray):
"""Create a memory-map to an array stored in a *binary* file on disk.

Memory-mapped files are used for accessing small segments of large files
on disk, without reading the entire file into memory. Numpy's
on disk, without reading the entire file into memory. NumPy's
memmap's are array-like objects. This differs from Python's ``mmap``
module, which uses file-like objects.

Expand Down
22 changes: 11 additions & 11 deletions numpy/core/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def isfortran(a):

This function is obsolete and, because of changes due to relaxed stride
checking, its return value for the same array may differ for versions
of Numpy >= 1.10 and previous versions. If you only want to check if an
of NumPy >= 1.10 and previous versions. If you only want to check if an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1,10.0

array is Fortran contiguous use ``a.flags.f_contiguous`` instead.

Parameters
Expand Down Expand Up @@ -1158,22 +1158,22 @@ def alterdot():
"""
Change `dot`, `vdot`, and `inner` to use accelerated BLAS functions.

Typically, as a user of Numpy, you do not explicitly call this
function. If Numpy is built with an accelerated BLAS, this function is
automatically called when Numpy is imported.
Typically, as a user of NumPy, you do not explicitly call this
function. If NumPy is built with an accelerated BLAS, this function is
automatically called when NumPy is imported.

When Numpy is built with an accelerated BLAS like ATLAS, these
When NumPy is built with an accelerated BLAS like ATLAS, these
functions are replaced to make use of the faster implementations. The
faster implementations only affect float32, float64, complex64, and
complex128 arrays. Furthermore, the BLAS API only includes
matrix-matrix, matrix-vector, and vector-vector products. Products of
arrays with larger dimensionalities use the built in functions and are
not accelerated.

.. note:: Deprecated in Numpy 1.10
.. note:: Deprecated in NumPy 1.10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.10.0

The cblas functions have been integrated into the multarray
module and alterdot now longer does anything. It will be
removed in Numpy 1.11.0.
removed in NumPy 1.11.0.

See Also
--------
Expand All @@ -1195,10 +1195,10 @@ def restoredot():
an accelerated BLAS, or when being very careful about benchmarking
linear algebra operations.

.. note:: Deprecated in Numpy 1.10
.. note:: Deprecated in NumPy 1.10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.10.0

The cblas functions have been integrated into the multarray
module and restoredot now longer does anything. It will be
removed in Numpy 1.11.0.
removed in NumPy 1.11.0.

See Also
--------
Expand Down Expand Up @@ -1505,8 +1505,8 @@ def rollaxis(a, axis, start=0):
Returns
-------
res : ndarray
For Numpy >= 1.10 a view of `a` is always returned. For earlier
Numpy versions a view of `a` is returned only if the order of the
For NumPy >= 1.10 a view of `a` is always returned. For earlier
NumPy versions a view of `a` is returned only if the order of the
axes is changed, otherwise the input array is returned.

See Also
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ _buffer_format_string(PyArray_Descr *descr, _tmp_string_t *str,
break;
}
case NPY_UNICODE: {
/* Numpy Unicode is always 4-byte */
/* NumPy Unicode is always 4-byte */
char buf[128];
assert(descr->elsize % 4 == 0);
PyOS_snprintf(b C2EE uf, sizeof(buf), "%dw", descr->elsize / 4);
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ array_setstate(PyArrayObject *self, PyObject *args)
Py_INCREF(rawdata);

#if defined(NPY_PY3K)
/* Backward compatibility with Python 2 Numpy pickles */
/* Backward compatibility with Python 2 NumPy pickles */
if (PyUnicode_Check(rawdata)) {
PyObject *tmp;
tmp = PyUnicode_AsLatin1String(rawdata);
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/multiarraymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ array_scalar(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
}
else {
#if defined(NPY_PY3K)
/* Backward compatibility with Python 2 Numpy pickles */
/* Backward compatibility with Python 2 NumPy pickles */
if (PyUnicode_Check(obj)) {
tmpobj = PyUnicode_AsLatin1String(obj);
obj = tmpobj;
Expand Down
Loading
381D
0