Skip to content

Commit f36e940

Browse files
committed
DOC: Avoid using "set of" when talking about an ordered list.
... or when the input isn't/cannot be a set. I left a few usages, e.g. in random sampling, where "set" is reasonable as informal description of an array as the order doesn't matter; however, for e.g. np.gradient the order of the returned list is clearly important, so "set" is wrong. Also some other minor doc edits noticed during the grepping: using `shape` instead of `form` in `cov` is consistent with most other places; the wording in `Polynomial.trim` now matches other methods on the same class.
1 parent 717df4e commit f36e940

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

benchmarks/benchmarks/bench_app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def maxes_of_dots(self, arrays):
7070
7171
Arrays must agree only on the first dimension.
7272
73-
For numpy it a join benchmark of dot products and max()
74-
on a set of arrays.
73+
Numpy uses this as a simultaneous benchmark of 1) dot products
74+
and 2) max(<array>, axis=<int>).
7575
"""
7676
feature_scores = ([0] * len(arrays))
7777
for (i, sd) in enumerate(arrays):

benchmarks/benchmarks/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# time-consuming functions (ufunc, linalg, etc)
1515
nxs, nys = 100, 100
1616

17-
# a set of interesting types to test
17+
# a list of interesting types to test
1818
TYPES1 = [
1919
'int16', 'float16',
2020
'int32', 'float32',

numpy/core/fromnumeric.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def _choose_dispatcher(a, choices, out=None, mode=None):
308308
@array_function_dispatch(_choose_dispatcher)
309309
def choose(a, choices, out=None, mode='raise'):
310310
"""
311-
Construct an array from an index array and a set of arrays to choose from.
311+
Construct an array from an index array and a list of arrays to choose from.
312312
313313
First of all, if confused or uncertain, definitely look at the Examples -
314314
in its full generality, this function is less simple than it might

numpy/core/src/multiarray/methods.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ array_getarray(PyArrayObject *self, PyObject *args)
10191019
}
10201020

10211021
/*
1022-
* Check whether any of a set of input and output args have a non-default
1022+
* Check whether any of the input and output args have a non-default
10231023
* __array_ufunc__ method. Return 1 if so, 0 if not, and -1 on error.
10241024
*
10251025
* This function primarily exists to help ndarray.__array_ufunc__ determine

numpy/lib/function_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def gradient(f, *varargs, axis=None, edge_order=1):
846846
Returns
847847
-------
848848
gradient : ndarray or list of ndarray
849-
A set of ndarrays (or a single ndarray if there is only one dimension)
849+
A list of ndarrays (or a single ndarray if there is only one dimension)
850850
corresponding to the derivatives of f with respect to each dimension.
851851
Each derivative has the same shape as f.
852852

numpy/lib/histograms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def _histogram_dispatcher(
678678
def histogram(a, bins=10, range=None, normed=None, weights=None,
679679
density=None):
680680
r"""
681-
Compute the histogram of a set of data.
681+
Compute the histogram of a dataset.
682682
683683
Parameters
684684
----------

numpy/ma/core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7339,9 +7339,9 @@ def where(condition, x=_NoValue, y=_NoValue):
73397339

73407340
def choose(indices, choices, out=None, mode='raise'):
73417341
"""
7342-
Use an index array to construct a new array from a set of choices.
7342+
Use an index array to construct a new array from a list of choices.
73437343
7344-
Given an array of integers and a set of n choice arrays, this method
7344+
Given an array of integers and a list of n choice arrays, this method
73457345
will create a new array that merges each of the choice arrays. Where a
73467346
value in `a` is i, the new array will have the value that choices[i]
73477347
contains in the same place.

numpy/ma/extras.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ def cov(x, y=None, rowvar=True, bias=False, allow_masked=True, ddof=None):
13221322
observation of all those variables. Also see `rowvar` below.
13231323
y : array_like, optional
13241324
An additional set of variables and observations. `y` has the same
1325-
form as `x`.
1325+
shape as `x`.
13261326
rowvar : bool, optional
13271327
If `rowvar` is True (default), then each row represents a
13281328
variable, with observations in the columns. Otherwise, the relationship

numpy/polynomial/_polybase.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def trim(self, tol=0):
694694
Returns
695695
-------
696696
new_series : series
697-
Contains the new set of coefficients.
697+
New instance of series with trimmed coefficients.
698698
699699
"""
700700
coef = pu.trimcoef(self.coef, tol)

numpy/testing/_private/parameterized.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def assert_not_in_testcase_subclass(self):
339339
"'@parameterized.expand' instead.")
340340

341341
def _terrible_magic_get_defining_classes(self):
342-
""" Returns the set of parent classes of the class currently being defined.
342+
""" Returns the list of parent classes of the class currently being defined.
343343
Will likely only work if called from the ``parameterized`` decorator.
344344
This function is entirely @brandon_rhodes's fault, as he suggested
345345
the implementation: http://stackoverflow.com/a/8793684/71522

tools/npy_tempita/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ def lex(s, name=None, trim_whitespace=True, line_offset=0, delimiters=None):
705705

706706
def trim_lex(tokens):
707707
r"""
708-
Takes a lexed set of tokens, and removes whitespace when there is
708+
Takes a lexed list of tokens, and removes whitespace when there is
709709
a directive on a line by itself:
710710
711711
>>> tokens = lex('{{if x}}\nx\n{{endif}}\ny', trim_whitespace=False)

tools/refguide_check.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def compare(all_dict, others, names, module_name):
305305
List of non deprecated sub modules for module_name
306306
others : list
307307
List of sub modules for module_name
308-
names : set
308+
names : set
309309
Set of function names or special directives present in
310310
docstring of module_name
311311
module_name : ModuleType
@@ -780,7 +780,7 @@ def _run_doctests(tests, full_name, verbose, doctest_warnings):
780780
781781
Parameters
782782
----------
783-
tests: list
783+
tests : list
784784
785785
full_name : str
786786

0 commit comments

Comments
 (0)