Skip to content

Commit 982292f

Browse files
committed
DOC: Edits in docstring for linprog_simplex
Delete useless docstring for fields of namedtuple
1 parent 760dc3c commit 982292f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

docs/source/optimize.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Optimize
44
.. toctree::
55
:maxdepth: 2
66

7-
optimize/nelder_mead
8-
optimize/root_finding
97
optimize/linprog_simplex
8+
optimize/nelder_mead
109
optimize/pivoting
10+
optimize/root_finding
1111
optimize/scalar_maximization

quantecon/optimize/linprog_simplex.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
2-
Contain a linear programming solver routine based on the Simplex Method.
2+
Contain a Numba-jitted linear programming solver based on the Simplex
3+
Method.
34
45
"""
56
from collections import namedtuple
@@ -11,6 +12,8 @@
1112
SimplexResult = namedtuple(
1213
'SimplexResult', ['x', 'lambd', 'fun', 'success', 'status', 'num_iter']
1314
)
15+
SimplexResult.__doc__ = \
16+
'namedtuple containing the result from `linprog_simplex`.'
1417

1518
FEA_TOL = 1e-6
1619
TOL_PIV = 1e-7
@@ -20,6 +23,17 @@
2023
'PivOptions', ['fea_tol', 'tol_piv', 'tol_ratio_diff']
2124
)
2225
PivOptions.__new__.__defaults__ = (FEA_TOL, TOL_PIV, TOL_RATIO_DIFF)
26+
PivOptions.__doc__ = 'namedtuple to hold tolerance values for pivoting'
27+
28+
29+
# Delete useless docstring for fields of namedtuple
30+
def _del_field_docstring(nt):
31+
for field in nt._fields:
32+
getattr(nt, field).__doc__ = ''
33+
34+
35+
for nt in [SimplexResult, PivOptions]:
36+
_del_field_docstring(nt)
2337

2438

2539
@jit(nopython=True, cache=True)

0 commit comments

Comments
 (0)