Skip to content

Commit 0fc6fa9

Browse files
Merge pull request #416 from hyanwong/remove-more-nitpicks
Remove more nitpick exclusions
2 parents 9dc5a84 + f08e376 commit 0fc6fa9

File tree

4 files changed

+19
-27
lines changed

4 files changed

+19
-27
lines changed

docs/conf.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -291,22 +291,12 @@ def handle_item(fieldarg, content):
291291
("c:type", "bool"),
292292
# TODO these have been triaged here to make the docs compile, but we should
293293
# sort them out properly. https://github.com/tskit-dev/tskit/issues/336
294-
("py:class", "ndarray"),
295-
("py:class", "numpy array"),
296-
("py:class", "numpy.ndarray"),
297-
("py:class", "numpy.array"),
294+
("py:class", "array_like"),
298295
("py:class", "array-like"),
299-
("py:class", "np.uint32"),
300-
("py:class", "np.float64"),
301-
("py:class", "np.int32"),
302-
("py:class", "np.int8"),
303296
("py:class", "dtype=np.uint32"),
304297
("py:class", "dtype=np.uint32."),
305298
("py:class", "dtype=np.int32"),
306299
("py:class", "dtype=np.int8"),
307300
("py:class", "dtype=np.float64"),
308301
("py:class", "dtype=np.int64"),
309-
("py:class", "array"),
310-
("py:class", "array_like"),
311-
("py:class", ""),
312302
]

python/tskit/tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ def simplify(
15881588
in the output. (Default: False)
15891589
:return: A numpy array mapping node IDs in the input tables to their
15901590
corresponding node IDs in the output tables.
1591-
:rtype: numpy array (dtype=np.int32).
1591+
:rtype: numpy.ndarray (dtype=np.int32)
15921592
"""
15931593
if filter_zero_mutation_sites is not None:
15941594
# Deprecated in 0.6.1.

python/tskit/trees.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,7 +2705,7 @@ def breakpoints(self, as_array=False):
27052705
27062706
:param bool as_array: If True, return the breakpoints as a numpy array.
27072707
:return: The breakpoints defined by the tree intervals along the sequence.
2708-
:rtype: collections.abc.Iterable or array
2708+
:rtype: collections.abc.Iterable or numpy.ndarray
27092709
"""
27102710
breakpoints = self.ll_tree_sequence.get_breakpoints()
27112711
if not as_array:
@@ -3304,7 +3304,7 @@ def simplify(
33043304
a tuple consisting of the simplified tree sequence and a numpy array
33053305
mapping source node IDs to their corresponding IDs in the new tree
33063306
sequence.
3307-
:rtype: .TreeSequence or (.TreeSequence, numpy.array)
3307+
:rtype: .TreeSequence or (.TreeSequence, numpy.ndarray)
33083308
"""
33093309
tables = self.dump_tables()
33103310
if samples is None:
@@ -3511,8 +3511,8 @@ def general_stat(self, W, f, output_dim, windows=None, polarised=False, mode=Non
35113511
unaffected by parts of the tree sequence ancestral to none or all
35123512
of the samples, respectively.
35133513
3514-
:param ndarray W: An array of values with one row for each sample and one column
3515-
for each weight.
3514+
:param numpy.ndarray W: An array of values with one row for each sample and one
3515+
column for each weight.
35163516
:param f: A function that takes a one-dimensional array of length
35173517
equal to the number of columns of ``W`` and returns a one-dimensional
35183518
array.
@@ -3901,8 +3901,8 @@ def trait_covariance(self, W, windows=None, mode="site", span_normalise=True):
39013901
For each node, the squared covariance between the property of
39023902
inheriting from this node and phenotypes, computed as in "branch".
39033903
3904-
:param ndarray W: An array of values with one row for each sample and one column
3905-
for each "phenotype".
3904+
:param numpy.ndarray W: An array of values with one row for each sample and one
3905+
column for each "phenotype".
39063906
:param list windows: An increasing list of breakpoints between the windows
39073907
to compute the statistic in.
39083908
:param str mode: A string giving the "type" of the statistic to be computed
@@ -3959,8 +3959,9 @@ def trait_correlation(self, W, windows=None, mode="site", span_normalise=True):
39593959
Note that above we divide by the **sample** variance, which for a
39603960
vector x of length n is ``np.var(x) * n / (n-1)``.
39613961
3962-
:param ndarray W: An array of values with one row for each sample and one column
3963-
for each "phenotype". Each column must have positive standard deviation.
3962+
:param numpy.ndarray W: An array of values with one row for each sample and one
3963+
column for each "phenotype". Each column must have positive standard
3964+
deviation.
39643965
:param list windows: An increasing list of breakpoints between the windows
39653966
to compute the statistic in.
39663967
:param str mode: A string giving the "type" of the statistic to be computed
@@ -4022,10 +4023,11 @@ def trait_regression(self, W, Z=None, windows=None, mode="site",
40224023
For each node, the squared coefficient `b_1^2`, computed for the property of
40234024
inheriting from this node, as in "branch".
40244025
4025-
:param ndarray W: An array of values with one row for each sample and one column
4026-
for each "phenotype".
4027-
:param ndarray Z: An array of values with one row for each sample and one column
4028-
for each "covariate", or `None`. Columns of `Z` must be linearly independent.
4026+
:param numpy.ndarray W: An array of values with one row for each sample and one
4027+
column for each "phenotype".
4028+
:param numpy.ndarray Z: An array of values with one row for each sample and one
4029+
column for each "covariate", or `None`. Columns of `Z` must be linearly
4030+
independent.
40294031
:param list windows: An increasing list of breakpoints between the windows
40304032
to compute the statistic in.
40314033
:param str mode: A string giving the "type" of the statistic to be computed

python/tskit/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def pack_bytes(data):
7575
:param list[bytes] data: The list of bytes values to encode.
7676
:return: The tuple (packed, offset) of numpy arrays representing the flattened
7777
input data and offsets.
78-
:rtype: numpy.array (dtype=np.int8), numpy.array (dtype=np.uint32).
78+
:rtype: numpy.ndarray (dtype=np.int8), numpy.ndarray (dtype=np.uint32)
7979
"""
8080
n = len(data)
8181
offsets = np.zeros(n + 1, dtype=np.uint32)
@@ -119,7 +119,7 @@ def pack_strings(strings, encoding="utf8"):
119119
string encodings.
120120
:return: The tuple (packed, offset) of numpy arrays representing the flattened
121121
input data and offsets.
122-
:rtype: numpy.array (dtype=np.int8), numpy.array (dtype=np.uint32).
122+
:rtype: numpy.ndarray (dtype=np.int8), numpy.ndarray (dtype=np.uint32)
123123
"""
124124
return pack_bytes([bytearray(s.encode(encoding)) for s in strings])
125125

@@ -152,7 +152,7 @@ def pack_arrays(list_of_lists):
152152
:param list[list] list_of_lists: The list of numeric lists to encode.
153153
:return: The tuple (packed, offset) of numpy arrays representing the flattened
154154
input data and offsets.
155-
:rtype: numpy.array (dtype=np.float64), numpy.array (dtype=np.uint32).
155+
:rtype: numpy.array (dtype=np.float64), numpy.array (dtype=np.uint32)
156156
"""
157157
# TODO must be possible to do this more efficiently with numpy
158158
n = len(list_of_lists)

0 commit comments

Comments
 (0)