Skip to content

Commit 1ebf619

Browse files
authored
Correct doc instances of "raises" (#2807)
As per sphinx docs
1 parent ab5ef8f commit 1ebf619

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

python/tskit/intervals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def find_index(self, x: float) -> int:
265265
:param float x: The position to search.
266266
:return: The index of the interval containing this point.
267267
:rtype: int
268-
:raises: KeyError if the position is not contained in any of the intervals.
268+
:raises KeyError: if the position is not contained in any of the intervals.
269269
"""
270270
if x < 0 or x >= self.sequence_length:
271271
raise KeyError(f"Position {x} out of bounds")

python/tskit/provenance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22
#
3-
# Copyright (c) 2018-2020 Tskit Developers
3+
# Copyright (c) 2018-2023 Tskit Developers
44
# Copyright (c) 2016-2017 University of Oxford
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -117,7 +117,7 @@ def validate_provenance(provenance):
117117
118118
:param dict provenance: The dictionary representing a JSON document
119119
to be validated against the schema.
120-
:raises: :class:`tskit.ProvenanceValidationError`
120+
:raises ProvenanceValidationError: if the schema is not valid.
121121
"""
122122
schema = get_schema()
123123
try:

python/tskit/trees.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def unrank(num_leaves, rank, *, span=1, branch_length=1) -> Tree:
878878
from which the tree is taken will have its
879879
:attr:`~tskit.TreeSequence.sequence_length` equal to ``span``.
880880
:param: float branch_length: The minimum length of a branch in this tree.
881-
:raises: ValueError: If the given rank is out of bounds for trees
881+
:raises ValueError: If the given rank is out of bounds for trees
882882
with ``num_leaves`` leaves.
883883
"""
884884
rank_tree = combinatorics.RankTree.unrank(num_leaves, rank)
@@ -1600,7 +1600,7 @@ def root(self):
16001600
16011601
:return: The root node.
16021602
:rtype: int
1603-
:raises: :class:`ValueError` if this tree contains more than one root.
1603+
:raises ValueError: if this tree contains more than one root.
16041604
"""
16051605
if self.has_multiple_roots:
16061606
raise ValueError("More than one root exists. Use tree.roots instead")
@@ -5211,10 +5211,10 @@ def haplotypes(
52115211
*Deprecated in 0.3.0. Use ``isolated_as_missing``, but inverting value.
52125212
Will be removed in a future version*
52135213
:rtype: collections.abc.Iterable
5214-
:raises: TypeError if the ``missing_data_character`` or any of the alleles
5214+
:raises TypeError: if the ``missing_data_character`` or any of the alleles
52155215
at a site are not a single ascii character.
5216-
:raises: ValueError
5217-
if the ``missing_data_character`` exists in one of the alleles
5216+
:raises ValueError: if the ``missing_data_character`` exists in one of the
5217+
alleles
52185218
"""
52195219
if impute_missing_data is not None:
52205220
warnings.warn(
@@ -5521,10 +5521,9 @@ def alignments(
55215521
:return: An iterator over the alignment strings for specified samples in
55225522
this tree sequence, in the order given in ``samples``.
55235523
:rtype: collections.abc.Iterable
5524-
:raises: ValueError
5525-
if any genome coordinate in this tree sequence is not discrete,
5526-
or if the ``reference_sequence`` is not of the correct length.
5527-
:raises: TypeError if any of the alleles at a site are not a
5524+
:raises ValueError: if any genome coordinate in this tree sequence is not
5525+
discrete, or if the ``reference_sequence`` is not of the correct length.
5526+
:raises TypeError: if any of the alleles at a site are not a
55285527
single ascii character.
55295528
"""
55305529
if not self.discrete_genome:

0 commit comments

Comments
 (0)