From fbfe175ac8a8933d4d807460447e5b20b620a1f3 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 31 Oct 2024 18:40:28 +0100 Subject: [PATCH] remove duplication --- linopy/constraints.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/linopy/constraints.py b/linopy/constraints.py index 15c9df0..9ae7f74 100644 --- a/linopy/constraints.py +++ b/linopy/constraints.py @@ -891,19 +891,6 @@ def sanitize_infinities(self) -> None: labels = con.labels.where(~valid_infinity_values, -1) con._data = assign_multiindex_safe(con.data, labels=labels) - def sanitize_infinities(self) -> None: - """ - Replace infinite values in the constraints with a large value. - """ - for name in self: - constraint = self[name] - valid_infinity_values = ( - (constraint.sign == LESS_EQUAL) & (constraint.rhs == np.inf) - ) | ((constraint.sign == GREATER_EQUAL) & (constraint.rhs == -np.inf)) - self[name].data["labels"] = self[name].labels.where( - ~valid_infinity_values, -1 - ) - def get_name_by_label(self, label: Union[int, float]) -> str: """ Get the constraint name of the constraint containing the passed label.