diff options
author | Antony Lee <anntzer.lee@gmail.com> | 2020-12-29 18:53:53 +0100 |
---|---|---|
committer | Antony Lee <anntzer.lee@gmail.com> | 2020-12-29 21:18:08 +0100 |
commit | f36e940a4726abb38c4929259e8eaf00d68c3d18 (patch) | |
tree | 3f36ded5bc3921b181e6bcdf7dc9b1c08ac2e50b | |
parent | 717df4e93234a1a290aa1b472b5c1c4e600009cd (diff) | |
download | numpy-f36e940a4726abb38c4929259e8eaf00d68c3d18.tar.gz |
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.
-rw-r--r-- | benchmarks/benchmarks/bench_app.py | 4 | ||||
-rw-r--r-- | benchmarks/benchmarks/common.py | 2 | ||||
-rw-r--r-- | numpy/core/fromnumeric.py | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/methods.c | 2 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 2 | ||||
-rw-r--r-- | numpy/lib/histograms.py | 2 | ||||
-rw-r--r-- | numpy/ma/core.py | 4 | ||||
-rw-r--r-- | numpy/ma/extras.py | 2 | ||||
-rw-r--r-- | numpy/polynomial/_polybase.py | 2 | ||||
-rw-r--r-- | numpy/testing/_private/parameterized.py | 2 | ||||
-rw-r--r-- | tools/npy_tempita/__init__.py | 2 | ||||
-rw-r--r-- | tools/refguide_check.py | 4 |
12 files changed, 15 insertions, 15 deletions
diff --git a/benchmarks/benchmarks/bench_app.py b/benchmarks/benchmarks/bench_app.py index bee95c201..d22aa2e09 100644 --- a/benchmarks/benchmarks/bench_app.py +++ b/benchmarks/benchmarks/bench_app.py @@ -70,8 +70,8 @@ class MaxesOfDots(Benchmark): Arrays must agree only on the first dimension. - For numpy it a join benchmark of dot products and max() - on a set of arrays. + Numpy uses this as a simultaneous benchmark of 1) dot products + and 2) max(<array>, axis=<int>). """ feature_scores = ([0] * len(arrays)) for (i, sd) in enumerate(arrays): diff --git a/benchmarks/benchmarks/common.py b/benchmarks/benchmarks/common.py index b65cc5fd2..b95d09192 100644 --- a/benchmarks/benchmarks/common.py +++ b/benchmarks/benchmarks/common.py @@ -14,7 +14,7 @@ nx, ny = 1000, 1000 # time-consuming functions (ufunc, linalg, etc) nxs, nys = 100, 100 -# a set of interesting types to test +# a list of interesting types to test TYPES1 = [ 'int16', 'float16', 'int32', 'float32', diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index efb052bc2..52df1aad9 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -308,7 +308,7 @@ def _choose_dispatcher(a, choices, out=None, mode=None): @array_function_dispatch(_choose_dispatcher) def choose(a, choices, out=None, mode='raise'): """ - Construct an array from an index array and a set of arrays to choose from. + Construct an array from an index array and a list of arrays to choose from. First of all, if confused or uncertain, definitely look at the Examples - in its full generality, this function is less simple than it might diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c index 9c8bb4135..8bcf591a2 100644 --- a/numpy/core/src/multiarray/methods.c +++ b/numpy/core/src/multiarray/methods.c @@ -1019,7 +1019,7 @@ array_getarray(PyArrayObject *self, PyObject *args) } /* - * Check whether any of a set of input and output args have a non-default + * Check whether any of the input and output args have a non-default * __array_ufunc__ method. Return 1 if so, 0 if not, and -1 on error. * * This function primarily exists to help ndarray.__array_ufunc__ determine diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 696fe617b..276ffa5d4 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -846,7 +846,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): Returns ------- gradient : ndarray or list of ndarray - A set of ndarrays (or a single ndarray if there is only one dimension) + A list of ndarrays (or a single ndarray if there is only one dimension) corresponding to the derivatives of f with respect to each dimension. Each derivative has the same shape as f. diff --git a/numpy/lib/histograms.py b/numpy/lib/histograms.py index 1a9b41ced..7af67a7ee 100644 --- a/numpy/lib/histograms.py +++ b/numpy/lib/histograms.py @@ -678,7 +678,7 @@ def _histogram_dispatcher( def histogram(a, bins=10, range=None, normed=None, weights=None, density=None): r""" - Compute the histogram of a set of data. + Compute the histogram of a dataset. Parameters ---------- diff --git a/numpy/ma/core.py b/numpy/ma/core.py index d6af22337..54cb12f17 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -7339,9 +7339,9 @@ def where(condition, x=_NoValue, y=_NoValue): def choose(indices, choices, out=None, mode='raise'): """ - Use an index array to construct a new array from a set of choices. + Use an index array to construct a new array from a list of choices. - Given an array of integers and a set of n choice arrays, this method + Given an array of integers and a list of n choice arrays, this method will create a new array that merges each of the choice arrays. Where a value in `a` is i, the new array will have the value that choices[i] contains in the same place. diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index 1bf03e966..96e64914a 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -1322,7 +1322,7 @@ def cov(x, y=None, rowvar=True, bias=False, allow_masked=True, ddof=None): observation of all those variables. Also see `rowvar` below. y : array_like, optional An additional set of variables and observations. `y` has the same - form as `x`. + shape as `x`. rowvar : bool, optional If `rowvar` is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py index 4462f9d6b..ef3f9896d 100644 --- a/numpy/polynomial/_polybase.py +++ b/numpy/polynomial/_polybase.py @@ -694,7 +694,7 @@ class ABCPolyBase(abc.ABC): Returns ------- new_series : series - Contains the new set of coefficients. + New instance of series with trimmed coefficients. """ coef = pu.trimcoef(self.coef, tol) diff --git a/numpy/testing/_private/parameterized.py b/numpy/testing/_private/parameterized.py index ac7db6c40..55a204e3f 100644 --- a/numpy/testing/_private/parameterized.py +++ b/numpy/testing/_private/parameterized.py @@ -339,7 +339,7 @@ class parameterized: "'@parameterized.expand' instead.") def _terrible_magic_get_defining_classes(self): - """ Returns the set of parent classes of the class currently being defined. + """ Returns the list of parent classes of the class currently being defined. Will likely only work if called from the ``parameterized`` decorator. This function is entirely @brandon_rhodes's fault, as he suggested the implementation: http://stackoverflow.com/a/8793684/71522 diff --git a/tools/npy_tempita/__init__.py b/tools/npy_tempita/__init__.py index 50a995104..fedcd91f4 100644 --- a/tools/npy_tempita/__init__.py +++ b/tools/npy_tempita/__init__.py @@ -705,7 +705,7 @@ lead_whitespace_re = re.compile(r'^[\t ]*\n') def trim_lex(tokens): r""" - Takes a lexed set of tokens, and removes whitespace when there is + Takes a lexed list of tokens, and removes whitespace when there is a directive on a line by itself: >>> tokens = lex('{{if x}}\nx\n{{endif}}\ny', trim_whitespace=False) diff --git a/tools/refguide_check.py b/tools/refguide_check.py index f0f6461b7..ddcc1028d 100644 --- a/tools/refguide_check.py +++ b/tools/refguide_check.py @@ -305,7 +305,7 @@ def compare(all_dict, others, names, module_name): List of non deprecated sub modules for module_name others : list List of sub modules for module_name - names : set + names : set Set of function names or special directives present in docstring of module_name module_name : ModuleType @@ -780,7 +780,7 @@ def _run_doctests(tests, full_name, verbose, doctest_warnings): Parameters ---------- - tests: list + tests : list full_name : str |