Skip to content

Commit d176a3e

Browse files
committed
Docstring edits
:class:`SomeError` or ``SomeError`` to :exc:`SomeError`. (3)
1 parent 6964c2f commit d176a3e

97 files changed

Lines changed: 238 additions & 238 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/sage/matrix/matrix0.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ cdef class Matrix(sage.structure.element.Matrix):
403403
cdef check_bounds(self, Py_ssize_t i, Py_ssize_t j):
404404
"""
405405
This function gets called when you're about to access the i,j entry
406-
of this matrix. If i, j are out of range, an :class:`IndexError` is
406+
of this matrix. If i, j are out of range, an :exc:`IndexError` is
407407
raised.
408408
"""
409409
if i < 0 or i >= self._nrows or j < 0 or j >= self._ncols:
@@ -413,7 +413,7 @@ cdef class Matrix(sage.structure.element.Matrix):
413413
"""
414414
This function gets called when you're about to change this matrix.
415415
416-
If ``self`` is immutable, a :class:`ValueError` is raised, since you should
416+
If ``self`` is immutable, a :exc:`ValueError` is raised, since you should
417417
never change a mutable matrix.
418418
419419
If ``self`` is mutable, the cache of results about ``self`` is deleted.
@@ -426,10 +426,10 @@ cdef class Matrix(sage.structure.element.Matrix):
426426
cdef check_bounds_and_mutability(self, Py_ssize_t i, Py_ssize_t j):
427427
"""
428428
This function gets called when you're about to set the i,j entry of
429-
this matrix. If i or j is out of range, an :class:`IndexError`
429+
this matrix. If i or j is out of range, an :exc:`IndexError`
430430
exception is raised.
431431
432-
If ``self`` is immutable, a :class:`ValueError` is raised, since you should
432+
If ``self`` is immutable, a :exc:`ValueError` is raised, since you should
433433
never change a mutable matrix.
434434
435435
If ``self`` is mutable, the cache of results about ``self`` is deleted.
@@ -4957,7 +4957,7 @@ cdef class Matrix(sage.structure.element.Matrix):
49574957
sage: a.nonzero_positions_in_column(1)
49584958
[0, 1]
49594959
4960-
You will get an ``IndexError`` if you select an invalid column::
4960+
You will get an :exc:`IndexError` if you select an invalid column::
49614961
49624962
sage: a.nonzero_positions_in_column(2)
49634963
Traceback (most recent call last):
@@ -5727,8 +5727,8 @@ cdef class Matrix(sage.structure.element.Matrix):
57275727
Return the inverse of this matrix, as a matrix over the fraction
57285728
field.
57295729
5730-
Raises a ``ZeroDivisionError`` if the matrix has zero
5731-
determinant, and raises an ``ArithmeticError``, if the
5730+
Raises a :exc:`ZeroDivisionError` if the matrix has zero
5731+
determinant, and raises an :exc:`ArithmeticError`, if the
57325732
inverse doesn't exist because the matrix is nonsquare. Also, note,
57335733
e.g., that the inverse of a matrix over `\ZZ` is
57345734
always a matrix defined over `\QQ` (even if the
@@ -5907,7 +5907,7 @@ cdef class Matrix(sage.structure.element.Matrix):
59075907
Return the inverse of this matrix in the same matrix space.
59085908
59095909
The matrix must be invertible on the base ring. Otherwise, an
5910-
``ArithmeticError`` is raised.
5910+
:exc:`ArithmeticError` is raised.
59115911
59125912
The computation goes through the matrix of cofactors and avoids
59135913
division. In particular the base ring does not need to have a

src/sage/matrix/matrix1.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ cdef class Matrix(Matrix0):
13561356

13571357
def column(self, Py_ssize_t i, from_list=False):
13581358
"""
1359-
Return the ``i``'th column of this matrix as a vector.
1359+
Return the ``i``-th column of this matrix as a vector.
13601360
13611361
This column is a dense vector if and only if the matrix is a dense
13621362
matrix.
@@ -1366,7 +1366,7 @@ cdef class Matrix(Matrix0):
13661366
- ``i`` -- integer
13671367
13681368
- ``from_list`` -- boolean (default: ``False``); if ``True``, returns the
1369-
``i``'th element of ``self.columns()`` (see :func:`columns()`),
1369+
``i``-th element of ``self.columns()`` (see :func:`columns()`),
13701370
which may be faster, but requires building a list of all
13711371
columns the first time it is called after an entry of the
13721372
matrix is changed.
@@ -1415,7 +1415,7 @@ cdef class Matrix(Matrix0):
14151415

14161416
def row(self, Py_ssize_t i, from_list=False):
14171417
"""
1418-
Return the ``i``'th row of this matrix as a vector.
1418+
Return the ``i``-th row of this matrix as a vector.
14191419
14201420
This row is a dense vector if and only if the matrix is a dense
14211421
matrix.
@@ -1425,7 +1425,7 @@ cdef class Matrix(Matrix0):
14251425
- ``i`` -- integer
14261426
14271427
- ``from_list`` -- boolean (default: ``False``); if ``True``, returns the
1428-
``i``'th element of ``self.rows()`` (see :func:`rows`), which
1428+
``i``-th element of ``self.rows()`` (see :func:`rows`), which
14291429
may be faster, but requires building a list of all rows the
14301430
first time it is called after an entry of the matrix is
14311431
changed.

src/sage/matrix/matrix2.pyx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ cdef class Matrix(Matrix1):
242242
some solvers will return solutions over a larger ring than the
243243
base ring of the inputs (a typical case are rational solutions
244244
for integer linear systems). When set to ``False``, a solution
245-
over the base ring is returned, with a :class:`ValueError`
245+
over the base ring is returned, with a :exc:`ValueError`
246246
being raised if none exists.
247247

248248
- ``check`` -- boolean (default: ``True``); verify the answer
@@ -476,7 +476,7 @@ cdef class Matrix(Matrix1):
476476
some solvers will return solutions over a larger ring than the
477477
base ring of the inputs (a typical case are rational solutions
478478
for integer linear systems). When set to ``False``, a solution
479-
over the base ring is returned, with a :class:`ValueError`
479+
over the base ring is returned, with a :exc:`ValueError`
480480
being raised if none exists.
481481

482482
- ``check`` -- boolean (default: ``True``); verify the answer
@@ -554,7 +554,7 @@ cdef class Matrix(Matrix1):
554554
...
555555
ValueError: matrix equation has no solutions
556556

557-
A :class:`ValueError` is raised if the input is invalid::
557+
A :exc:`ValueError` is raised if the input is invalid::
558558

559559
sage: A = matrix(QQ, 4,2, [0, -1, 1, 0, -2, 2, 1, 0])
560560
sage: B = matrix(QQ, 2,2, [1, 0, 1, -1])
@@ -1246,7 +1246,7 @@ cdef class Matrix(Matrix1):
12461246
of elements of the base rings of ``self`` and ``right``
12471247
is defined, once Sage's coercion model is applied. If
12481248
the matrices have different sizes, or if multiplication
1249-
of individual entries cannot be achieved, a ``TypeError``
1249+
of individual entries cannot be achieved, a :exc:`TypeError`
12501250
will result.
12511251

12521252
OUTPUT:
@@ -6281,7 +6281,7 @@ cdef class Matrix(Matrix1):
62816281
the irreducible factors of the characteristic polynomial,
62826282
even for linear factors.
62836283

6284-
- ``algebraic_multiplicity`` -- boolean (default: ``False``);;
6284+
- ``algebraic_multiplicity`` -- boolean (default: ``False``);
62856285
whether to include the algebraic multiplicity of each eigenvalue
62866286
in the output. See the discussion below.
62876287

@@ -7712,7 +7712,7 @@ cdef class Matrix(Matrix1):
77127712
be a ring (not a field).
77137713

77147714
Right now this *only* works over ZZ and some principal ideal domains;
7715-
otherwise a ``NotImplementedError`` is raised. In the special case of
7715+
otherwise a :exc:`NotImplementedError` is raised. In the special case of
77167716
sparse matrices over ZZ it makes them dense, gets the echelon form of
77177717
the dense matrix, then sets ``self`` equal to the result.
77187718

@@ -12252,7 +12252,7 @@ cdef class Matrix(Matrix1):
1225212252
provide a transformation. But Jordan form will require that
1225312253
the eigenvalues of the matrix can be represented within Sage,
1225412254
requiring the existence of the appropriate extension field.
12255-
When this is not possible, a ``RuntimeError`` is raised, as
12255+
When this is not possible, a :exc:`RuntimeError` is raised, as
1225612256
demonstrated in an example below.
1225712257

1225812258
EXAMPLES:
@@ -12354,7 +12354,7 @@ cdef class Matrix(Matrix1):
1235412354
eigenvalues of the matrix, which may not lie in the field
1235512355
used for entries of the matrix. In this unfortunate case,
1235612356
the computation of the transformation may fail with a
12357-
``RuntimeError``, EVEN when the matrices are similar. This
12357+
:exc:`RuntimeError`, EVEN when the matrices are similar. This
1235812358
is not the case for matrices over the integers, rationals
1235912359
or algebraic numbers, since the computations are done in
1236012360
the algebraically closed field of algebraic numbers.
@@ -12535,7 +12535,7 @@ cdef class Matrix(Matrix1):
1253512535
Returns a pair (F, C) such that the rows of C form a symplectic
1253612536
basis for ``self`` and ``F = C \* self \* C.transpose()``.
1253712537

12538-
Raises a :class:`ValueError` if not over a field, or ``self`` is not
12538+
Raises a :exc:`ValueError` if not over a field, or ``self`` is not
1253912539
anti-symmetric, or ``self`` is not alternating.
1254012540

1254112541
Anti-symmetric means that `M = -M^t`. Alternating means
@@ -12972,7 +12972,7 @@ cdef class Matrix(Matrix1):
1297212972

1297312973
where `L^\ast` is the conjugate-transpose. If the matrix is
1297412974
not positive-definite (for example, if it is not Hermitian)
12975-
then a ``ValueError`` results.
12975+
then a :exc:`ValueError` results.
1297612976

1297712977
If possible, the output matrix will be over the fraction field
1297812978
of the base ring of the input matrix. If that fraction field
@@ -13940,7 +13940,7 @@ cdef class Matrix(Matrix1):
1394013940
the conjugate-transpose.
1394113941

1394213942
If any leading principal submatrix is singular, then the
13943-
computation cannot be performed and a ``ValueError`` results.
13943+
computation cannot be performed and a :exc:`ValueError` results.
1394413944

1394513945
Results are cached, and hence are immutable. Caching
1394613946
eliminates redundant computations across
@@ -14203,7 +14203,7 @@ cdef class Matrix(Matrix1):
1420314203

1420414204
If any leading principal submatrix (a square submatrix
1420514205
in the upper-left corner) is singular then this method will
14206-
fail with a ``ValueError``.
14206+
fail with a :exc:`ValueError`.
1420714207

1420814208
ALGORITHM:
1420914209

@@ -14666,7 +14666,7 @@ cdef class Matrix(Matrix1):
1466614666

1466714667
With ``classical=True``, the permutation matrix `P` is always
1466814668
an identity matrix and the diagonal blocks are always
14669-
one-by-one. A ``ValueError`` is raised if the matrix has no
14669+
one-by-one. A :exc:`ValueError` is raised if the matrix has no
1467014670
classical `LDL^{T}` factorization.
1467114671

1467214672
ALGORITHM:
@@ -18252,7 +18252,7 @@ cdef class Matrix(Matrix1):
1825218252
[ 0 -1]
1825318253
[ 1 0]
1825418254

18255-
However, it might fail for others, either raising a ``ValueError``::
18255+
However, it might fail for others, either raising a :exc:`ValueError`::
1825618256

1825718257
sage: Matrix(ZZ, 1, 1, [0]).LLL_gram() # needs sage.libs.pari
1825818258
Traceback (most recent call last):

src/sage/matrix/matrix_cyclo_dense.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ cdef class Matrix_cyclo_dense(Matrix_dense):
687687
"""
688688
Return hash of an immutable matrix.
689689
690-
This raises a :class:`TypeError` if input matrix is mutable.
690+
This raises a :exc:`TypeError` if input matrix is mutable.
691691
692692
EXAMPLES:
693693

src/sage/matrix/matrix_double_dense.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,7 +3273,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
32733273
where `L^\ast` is the conjugate-transpose in the complex case,
32743274
and just the transpose in the real case. If the matrix fails
32753275
to be positive definite (perhaps because it is not symmetric
3276-
or Hermitian), then this function raises a ``ValueError``.
3276+
or Hermitian), then this function raises a :exc:`ValueError`.
32773277
32783278
IMPLEMENTATION:
32793279
@@ -3282,7 +3282,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
32823282
method and the :meth:`is_positive_definite` method compute and
32833283
cache both the Cholesky decomposition and the
32843284
positive-definiteness. So the :meth:`is_positive_definite`
3285-
method or catching a ``ValueError`` from the :meth:`cholesky`
3285+
method or catching a :exc:`ValueError` from the :meth:`cholesky`
32863286
method are equally expensive computationally and if the
32873287
decomposition exists, it is cached as a side-effect of either
32883288
routine.
@@ -3461,7 +3461,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
34613461
method and the :meth:`cholesky` method compute and
34623462
cache both the Cholesky decomposition and the
34633463
positive-definiteness. So the :meth:`is_positive_definite`
3464-
method or catching a ``ValueError`` from the :meth:`cholesky`
3464+
method or catching a :exc:`ValueError` from the :meth:`cholesky`
34653465
method are equally expensive computationally and if the
34663466
decomposition exists, it is cached as a side-effect of either
34673467
routine.

src/sage/matrix/matrix_double_sparse.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ cdef class Matrix_double_sparse(Matrix_generic_sparse):
110110
111111
where `L^\ast` is the conjugate-transpose. If the matrix is
112112
not positive-definite (for example, if it is not Hermitian)
113-
then a ``ValueError`` results.
113+
then a :exc:`ValueError` results.
114114
115115
ALGORITHM:
116116

src/sage/matrix/matrix_gfpn_dense.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ def mtx_unpickle(f, int nr, int nc, data, bint m):
18731873
[0 0 0 0 0]
18741874
[0 0 0 0 0]
18751875
1876-
We test further corner cases. A ``ValueError`` is raised if the number
1876+
We test further corner cases. A :exc:`ValueError` is raised if the number
18771877
of bytes in the pickle does not comply with either the old or the new
18781878
pickle format (we test several code paths here)::
18791879

src/sage/matrix/matrix_integer_dense.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
17061706
Return a pair (F, C) such that the rows of C form a symplectic
17071707
basis for ``self`` and ``F = C * self * C.transpose()``.
17081708
1709-
Raise a :class:`ValueError` if ``self`` is not anti-symmetric,
1709+
Raise a :exc:`ValueError` if ``self`` is not anti-symmetric,
17101710
or ``self`` is not alternating.
17111711
17121712
Anti-symmetric means that `M = -M^t`. Alternating means
@@ -5000,7 +5000,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
50005000
50015001
EXAMPLES:
50025002
5003-
A ``ValueError`` is raised if the matrix is not square,
5003+
A :exc:`ValueError` is raised if the matrix is not square,
50045004
fixing :issue:`5548`::
50055005
50065006
sage: random_matrix(ZZ,16,4)._hnf_mod(100)

src/sage/matrix/matrix_integer_sparse.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse):
10571057
r"""
10581058
Return a pair ``(a, d)`` so that ``d * b = m * a``.
10591059
1060-
If there is no solution a ``ValueError`` is raised.
1060+
If there is no solution a :exc:`ValueError` is raised.
10611061
10621062
INPUT:
10631063

src/sage/matrix/matrix_mod2_dense.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse
477477

478478
def row(self, Py_ssize_t i, from_list=False):
479479
"""
480-
Return the ``i``'th row of this matrix as a vector.
480+
Return the ``i``-th row of this matrix as a vector.
481481
482482
This row is a dense vector if and only if the matrix is a dense
483483
matrix.
@@ -487,7 +487,7 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse
487487
- ``i`` -- integer
488488
489489
- ``from_list`` -- boolean (default: ``False``); if ``True``,
490-
returns the ``i``'th element of ``self.rows()`` (see
490+
returns the ``i``-th element of ``self.rows()`` (see
491491
:func:`rows`), which may be faster, but requires building a
492492
list of all rows the first time it is called after an entry
493493
of the matrix is changed.
@@ -924,7 +924,7 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse
924924
Invert ``self`` using the 'Method of the Four Russians'
925925
inversion.
926926
927-
If ``self`` is not invertible a ``ZeroDivisionError`` is
927+
If ``self`` is not invertible a :exc:`ZeroDivisionError` is
928928
raised.
929929
930930
EXAMPLES::

0 commit comments

Comments
 (0)