Skip to content

Commit e11c575

Browse files
authored
Add optional typing to print_infeasibilities() method, update docstring for generating better documentation description (#354)
1 parent eb845d8 commit e11c575

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

linopy/model.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,12 +1162,24 @@ def compute_infeasibilities(self) -> list[int]:
11621162
labels.append(int(line_decoded.split(":")[0][2:]))
11631163
return labels
11641164

1165-
def print_infeasibilities(self, display_max_terms: None = None) -> None:
1165+
def print_infeasibilities(self, display_max_terms: int | None = None) -> None:
11661166
"""
11671167
Print a list of infeasible constraints.
11681168
1169-
This function requires that the model was solved with `gurobi` and the
1170-
termination condition was infeasible.
1169+
This function requires that the model was solved using `gurobi`
1170+
and the termination condition was infeasible.
1171+
1172+
Parameters
1173+
----------
1174+
display_max_terms : int, optional
1175+
The maximum number of infeasible terms to display. If `None`,
1176+
all infeasible terms will be displayed.
1177+
1178+
Returns
1179+
-------
1180+
None
1181+
This function does not return anything. It simply prints the
1182+
infeasible constraints.
11711183
"""
11721184
labels = self.compute_infeasibilities()
11731185
self.constraints.print_labels(labels, display_max_terms=display_max_terms)

0 commit comments

Comments
 (0)