Skip to content

Commit d347691

Browse files
committed
Fix docstrings alignment to 0.2.0
1 parent 9fa3d83 commit d347691

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

PEPit/function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def add_psd_matrix(self, matrix_of_expressions):
261261
Store a new matrix of :class:`Expression`\s that we enforce to be positive semidefinite.
262262
263263
Args:
264-
matrix_of_expressions (Iterable of Iterable of Expression): a square matrix of :class:`Expression`.
264+
matrix_of_expressions (2D ndarray of Expression): a square matrix of :class:`Expression`.
265265
266266
Raises:
267267
AssertionError: if provided matrix is not a square matrix.

PEPit/pep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def add_psd_matrix(self, matrix_of_expressions):
141141
Store a new matrix of :class:`Expression`\s that we enforce to be positive semidefinite.
142142
143143
Args:
144-
matrix_of_expressions (Iterable of Iterable of Expression): a square matrix of :class:`Expression`.
144+
matrix_of_expressions (2D ndarray of Expression): a square matrix of :class:`Expression`.
145145
146146
Raises:
147147
AssertionError: if provided matrix is not a square matrix.

PEPit/psd_matrix.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class PSDMatrix(object):
88
A :class:`PSDMatrix` encodes a square matrix of :class:`Expression` objects that is constrained to be symmetric PSD.
99
1010
Attributes:
11-
matrix_of_expressions (Iterable of Iterable of Expression): a square matrix of :class:`Expression` objects.
11+
matrix_of_expressions (2D ndarray of Expression): a square matrix of :class:`Expression` objects.
1212
shape (tuple of ints): the shape of the underlying matrix of :class:`Expression` objects.
1313
_value (2D ndarray of floats): numerical values of :class:`Expression` objects
1414
obtained after solving the PEP via SDP solver.
@@ -22,11 +22,12 @@ class PSDMatrix(object):
2222
2323
Example:
2424
>>> # Defining t <= sqrt(expr) for a given expression expr.
25+
>>> import numpy as np
2526
>>> from PEPit import Expression
2627
>>> from PEPit import PSDMatrix
2728
>>> expr = Expression()
2829
>>> t = Expression()
29-
>>> psd_matrix = PSDMatrix(matrix_of_expressions=[[expr, t], [t, 1]])
30+
>>> psd_matrix = PSDMatrix(matrix_of_expressions=np.array([[expr, t], [t, 1]]))
3031
>>> # The last line means that the matrix [[expr, t], [t, 1]] is constrained to be PSD.
3132
>>> # This is equivalent to det([[expr, t], [t, 1]]) >= 0, i.e. expr - t^2 >= 0.
3233
@@ -40,7 +41,7 @@ def __init__(self, matrix_of_expressions):
4041
:class:`PSDMatrix` objects are instantiated via the following argument.
4142
4243
Args:
43-
matrix_of_expressions (Iterable of Iterable of Expression): a square matrix of :class:`Expression`.
44+
matrix_of_expressions (2D ndarray of Expression): a square matrix of :class:`Expression`.
4445
4546
Instantiating the :class:`PSDMatrix` objects of the first example can be done by
4647

0 commit comments

Comments
 (0)