We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8f5ce7 commit b10b4ecCopy full SHA for b10b4ec
switch_model/utilities/patches.py
@@ -5,6 +5,9 @@
5
import pyomo.version
6
from pyomo.core.base.misc import _robust_sort_keyfcn
7
8
+from switch_model.utilities.load_data import patch_to_allow_loading
9
+from pyomo.environ import Set, Param
10
+
11
12
def fixed_robust_sort_keyfcn(self, val, use_key=True):
13
"""Generate a tuple ( str(type_name), val ) for sorting the value.
@@ -57,6 +60,10 @@ def patch_pyomo():
57
60
58
61
setattr(_robust_sort_keyfcn, "__call__", fixed_robust_sort_keyfcn)
59
62
63
+ # Patch Set and Param to allow specifying input file location (via input_file="...")
64
+ patch_to_allow_loading(Set)
65
+ patch_to_allow_loading(Param)
66
67
68
def replace_method(class_ref, method_name, new_source_code):
69
"""
0 commit comments