gamspy 1.19.2__py3-none-any.whl → 1.19.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gamspy/_backend/backend.py +1 -3
- gamspy/_cli/show.py +3 -3
- gamspy/_container.py +10 -53
- gamspy/_miro.py +2 -6
- {gamspy-1.19.2.dist-info → gamspy-1.19.3.dist-info}/METADATA +1 -1
- {gamspy-1.19.2.dist-info → gamspy-1.19.3.dist-info}/RECORD +10 -10
- {gamspy-1.19.2.dist-info → gamspy-1.19.3.dist-info}/WHEEL +0 -0
- {gamspy-1.19.2.dist-info → gamspy-1.19.3.dist-info}/entry_points.txt +0 -0
- {gamspy-1.19.2.dist-info → gamspy-1.19.3.dist-info}/licenses/LICENSE +0 -0
- {gamspy-1.19.2.dist-info → gamspy-1.19.3.dist-info}/top_level.txt +0 -0
gamspy/_backend/backend.py
CHANGED
|
@@ -222,9 +222,7 @@ class Backend(ABC):
|
|
|
222
222
|
symbols = filtered_names
|
|
223
223
|
|
|
224
224
|
if len(symbols) != 0:
|
|
225
|
-
self.container._load_records_from_gdx(
|
|
226
|
-
self.container._gdx_out, symbols, create_if_not_declared=True
|
|
227
|
-
)
|
|
225
|
+
self.container._load_records_from_gdx(self.container._gdx_out, symbols)
|
|
228
226
|
self.make_unmodified(symbols)
|
|
229
227
|
|
|
230
228
|
if relaxed_domain_mapping:
|
gamspy/_cli/show.py
CHANGED
|
@@ -67,9 +67,9 @@ SOLVER_PAGE_MAP = {
|
|
|
67
67
|
|
|
68
68
|
# cm: component_map, ia: is_academic
|
|
69
69
|
EVALUATIONS: dict[str, Callable[[dict[str, bool], bool], bool]] = {
|
|
70
|
-
"ANTIGONE": lambda cm, ia:
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
"ANTIGONE": lambda cm, ia: (
|
|
71
|
+
cm["AT"] and (cm["CP"] or cm["CL"]) and (cm["CO"] or cm["SN"])
|
|
72
|
+
),
|
|
73
73
|
"BARON": lambda cm, ia: cm["BA"],
|
|
74
74
|
"CBC": lambda cm, ia: True,
|
|
75
75
|
"CONOPT": lambda cm, ia: cm["CO"],
|
gamspy/_container.py
CHANGED
|
@@ -588,7 +588,6 @@ class Container(gt.Container):
|
|
|
588
588
|
def _filter_load_symbols(
|
|
589
589
|
self,
|
|
590
590
|
symbol_names: dict[str, str] | list[str],
|
|
591
|
-
create_if_not_declared: bool = False,
|
|
592
591
|
) -> dict[str, str] | list[str]:
|
|
593
592
|
if isinstance(symbol_names, list):
|
|
594
593
|
names = []
|
|
@@ -598,12 +597,7 @@ class Container(gt.Container):
|
|
|
598
597
|
if not isinstance(symbol, gt.Alias) and symbol.synchronize:
|
|
599
598
|
names.append(name)
|
|
600
599
|
else:
|
|
601
|
-
|
|
602
|
-
names.append(name)
|
|
603
|
-
else:
|
|
604
|
-
raise ValidationError(
|
|
605
|
-
f"Cannot load records of `{name}` because it does not exist in the container."
|
|
606
|
-
)
|
|
600
|
+
names.append(name)
|
|
607
601
|
|
|
608
602
|
return names
|
|
609
603
|
|
|
@@ -619,13 +613,7 @@ class Container(gt.Container):
|
|
|
619
613
|
|
|
620
614
|
return mapping
|
|
621
615
|
|
|
622
|
-
def _load_records_from_gdx(
|
|
623
|
-
self,
|
|
624
|
-
load_from: str,
|
|
625
|
-
names: Iterable[str],
|
|
626
|
-
*,
|
|
627
|
-
create_if_not_declared: bool = False,
|
|
628
|
-
) -> None:
|
|
616
|
+
def _load_records_from_gdx(self, load_from: str, names: Iterable[str]) -> None:
|
|
629
617
|
self._temp_container.read(load_from, names)
|
|
630
618
|
original_state = self._options.miro_protect
|
|
631
619
|
self._options.miro_protect = False
|
|
@@ -636,12 +624,7 @@ class Container(gt.Container):
|
|
|
636
624
|
self[name].records = updated_records
|
|
637
625
|
self[name].domain_labels = self[name].domain_names
|
|
638
626
|
else:
|
|
639
|
-
|
|
640
|
-
self._read(load_from, [name])
|
|
641
|
-
else:
|
|
642
|
-
raise ValidationError(
|
|
643
|
-
f"Cannot load records of `{name}` because it does not exist in the container."
|
|
644
|
-
)
|
|
627
|
+
self._read(load_from, [name])
|
|
645
628
|
|
|
646
629
|
self._options.miro_protect = original_state
|
|
647
630
|
self._temp_container.data = {}
|
|
@@ -989,54 +972,28 @@ class Container(gt.Container):
|
|
|
989
972
|
if isinstance(load_from, Path):
|
|
990
973
|
load_from = str(load_from.resolve())
|
|
991
974
|
|
|
992
|
-
create_if_not_declared = symbol_names is None
|
|
993
975
|
if symbol_names is None:
|
|
994
976
|
# If no symbol names are given, all records in the gdx should be loaded
|
|
995
977
|
symbol_names = utils._get_symbol_names_from_gdx(
|
|
996
978
|
self.system_directory, load_from
|
|
997
979
|
)
|
|
998
980
|
self._add_statement(f"$declareAndLoad {load_from}")
|
|
999
|
-
symbol_names = self._filter_load_symbols(
|
|
1000
|
-
|
|
1001
|
-
create_if_not_declared,
|
|
1002
|
-
)
|
|
1003
|
-
self._load_records_from_gdx(
|
|
1004
|
-
load_from, symbol_names, create_if_not_declared=create_if_not_declared
|
|
1005
|
-
)
|
|
981
|
+
symbol_names = self._filter_load_symbols(symbol_names) # type: ignore
|
|
982
|
+
self._load_records_from_gdx(load_from, symbol_names)
|
|
1006
983
|
self._synch_with_gams()
|
|
1007
984
|
return
|
|
1008
985
|
|
|
1009
|
-
if isinstance(symbol_names, list):
|
|
1010
|
-
symbol_names = self._filter_load_symbols(
|
|
1011
|
-
symbol_names, create_if_not_declared
|
|
1012
|
-
)
|
|
1013
|
-
self._add_statement(f"$gdxIn {load_from}")
|
|
1014
|
-
symbols_str = " ".join(symbol_names)
|
|
1015
|
-
self._add_statement(f"$loadDC {symbols_str}")
|
|
1016
|
-
self._add_statement("$gdxIn")
|
|
1017
|
-
elif isinstance(symbol_names, dict):
|
|
1018
|
-
symbol_names = self._filter_load_symbols(
|
|
1019
|
-
symbol_names, create_if_not_declared
|
|
1020
|
-
)
|
|
1021
|
-
self._add_statement(f"$gdxIn {load_from}")
|
|
1022
|
-
symbols_str = " ".join(
|
|
1023
|
-
[f"{value}={key}" for key, value in symbol_names.items()] # type: ignore
|
|
1024
|
-
)
|
|
1025
|
-
self._add_statement(f"$loadDC {symbols_str}")
|
|
1026
|
-
self._add_statement("$gdxIn")
|
|
986
|
+
if isinstance(symbol_names, (list, dict)):
|
|
987
|
+
symbol_names = self._filter_load_symbols(symbol_names)
|
|
1027
988
|
else:
|
|
1028
989
|
raise TypeError("`symbol_names` must be either a list or a dictionary.")
|
|
1029
990
|
|
|
1030
|
-
self._options._debug_options["gdx"] = self._gdx_out
|
|
1031
|
-
self._options._debug_options["gdxSymbols"] = "newOrChanged"
|
|
1032
|
-
self._synch_with_gams()
|
|
1033
|
-
|
|
1034
991
|
if isinstance(symbol_names, dict):
|
|
1035
992
|
self._load_records_with_rename(load_from, symbol_names)
|
|
1036
993
|
else:
|
|
1037
|
-
self._load_records_from_gdx(
|
|
1038
|
-
|
|
1039
|
-
|
|
994
|
+
self._load_records_from_gdx(load_from, symbol_names)
|
|
995
|
+
|
|
996
|
+
self._synch_with_gams()
|
|
1040
997
|
|
|
1041
998
|
def addGamsCode(self, gams_code: str) -> None:
|
|
1042
999
|
"""
|
gamspy/_miro.py
CHANGED
|
@@ -41,9 +41,7 @@ def load_miro_symbol_records(container: Container):
|
|
|
41
41
|
for name in container._miro_input_symbols
|
|
42
42
|
if not container[name]._already_loaded
|
|
43
43
|
]
|
|
44
|
-
container._load_records_from_gdx(
|
|
45
|
-
MIRO_GDX_IN, names, create_if_not_declared=True
|
|
46
|
-
)
|
|
44
|
+
container._load_records_from_gdx(MIRO_GDX_IN, names)
|
|
47
45
|
for name in names:
|
|
48
46
|
symbol = container[name]
|
|
49
47
|
symbol._already_loaded = True
|
|
@@ -56,9 +54,7 @@ def load_miro_symbol_records(container: Container):
|
|
|
56
54
|
|
|
57
55
|
# Load records of miro output symbols
|
|
58
56
|
if MIRO_GDX_OUT and container._miro_output_symbols:
|
|
59
|
-
container._load_records_from_gdx(
|
|
60
|
-
MIRO_GDX_OUT, container._miro_output_symbols, create_if_not_declared=True
|
|
61
|
-
)
|
|
57
|
+
container._load_records_from_gdx(MIRO_GDX_OUT, container._miro_output_symbols)
|
|
62
58
|
|
|
63
59
|
for name in container._miro_input_symbols + container._miro_output_symbols:
|
|
64
60
|
container[name].modified = False
|
|
@@ -2,11 +2,11 @@ gamspy/__init__.py,sha256=-_5LylEYCb8fEHbV4gJdNbvRUEw-k2Wk61BP6da_XxU,1725
|
|
|
2
2
|
gamspy/__main__.py,sha256=3HW3NYEe4pZnGhJ10s1G0vaZAkI9Zl_lXqHT9iDNXQg,108
|
|
3
3
|
gamspy/_communication.py,sha256=18drDsKxi1Iv6oAKZfKGJcPYYWebBQsyeOxiEKXZngE,7148
|
|
4
4
|
gamspy/_config.py,sha256=n7RXUFczIlol15-mxhnj54fHXHet8HcOnWiGm3mpMgg,3589
|
|
5
|
-
gamspy/_container.py,sha256=
|
|
5
|
+
gamspy/_container.py,sha256=l11e3G42JUjyWwZAdiSP_q51OMSlUYfkZiRwDnv5vV8,52180
|
|
6
6
|
gamspy/_convert.py,sha256=e8lvdB3itXrQip8wAr-7yP-CuYB2nt1TD7Y-Y4TE3jc,23460
|
|
7
7
|
gamspy/_database.py,sha256=SVo4lEfS0Q2f80uMu7k71BBQNRwUei-2KFc_EGxsOcw,6873
|
|
8
8
|
gamspy/_extrinsic.py,sha256=OGrlNzcSQjoIZw8lpsk_4SObEAhGX5bkc_D0d3lPZMQ,4807
|
|
9
|
-
gamspy/_miro.py,sha256=
|
|
9
|
+
gamspy/_miro.py,sha256=MeFGcaFtNgtydWjH0KS0l9y3mNy7tPyXwm43jwomodg,12245
|
|
10
10
|
gamspy/_model.py,sha256=afL02j_C6n8WnI9tjWo_92C0YCfaG17eITVst7deQEA,59219
|
|
11
11
|
gamspy/_model_instance.py,sha256=9FDyT4VTcPk7z0aIalVHcHB8GqMKZywvo1C_BlbnbZI,24394
|
|
12
12
|
gamspy/_options.py,sha256=Lar_oWaq5M8HbweGMwrIFdtUdR_Q751oJ_z95yAawdc,29576
|
|
@@ -26,7 +26,7 @@ gamspy/_algebra/number.py,sha256=TpjB7fppzv3xHX6IDdfx0Q_SzGuBueEXVQonSkeWGqI,184
|
|
|
26
26
|
gamspy/_algebra/operable.py,sha256=1sFr29_7A9RKVxDlTY9fC_g4sNRavNOYpjACWzvyjRc,6315
|
|
27
27
|
gamspy/_algebra/operation.py,sha256=JD8icFThcZ6vaewEErhox8vhwcGm4QJd4lhaatRBE9c,26152
|
|
28
28
|
gamspy/_backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
gamspy/_backend/backend.py,sha256=
|
|
29
|
+
gamspy/_backend/backend.py,sha256=VgLL3CiFydkf1ZF8ttaOlWsDtkJIoRdi_md4tVh789Q,9217
|
|
30
30
|
gamspy/_backend/engine.py,sha256=DMJHtXsaZMEAdv6IgboMYqYeLX7LLvBwketgoGxmuQ4,31839
|
|
31
31
|
gamspy/_backend/local.py,sha256=oi3hPokeEAbcPF3gCvaQXBn77-x-Lx8n4LY6U3aZMN8,3814
|
|
32
32
|
gamspy/_backend/neos.py,sha256=64Rr0ZrzRc1_AWYgUmvKrTbkUP4qVYygM0ZdrNt9Zbg,17775
|
|
@@ -39,7 +39,7 @@ gamspy/_cli/mps2gms.py,sha256=4zmM5gS_YlgkzBcgHDzjM6F_r2vKJTi0P_ZYgZxjoEw,4192
|
|
|
39
39
|
gamspy/_cli/probe.py,sha256=K7fYwfdk-2mGGQKAxXFvkWMRJ1qYTUpX2tvklU56JZU,1122
|
|
40
40
|
gamspy/_cli/retrieve.py,sha256=bnTcIbHJfkq-dvrFitdkxsjQNZz-Cx4-LiaRfhe0cYM,2446
|
|
41
41
|
gamspy/_cli/run.py,sha256=oaWT4alxSXqPDF2mRYmfy5aOWCKoEExUfqYoAT_zSUM,4387
|
|
42
|
-
gamspy/_cli/show.py,sha256=
|
|
42
|
+
gamspy/_cli/show.py,sha256=z7P_8u8iQ-9B1shi-_GlU9TSzMdg5j3Bxt7Q2CXc2xQ,10689
|
|
43
43
|
gamspy/_cli/uninstall.py,sha256=_g3SbT6G7DZcYgtmHLhaGl1B9jY1K3D0sStifxIyqxQ,5183
|
|
44
44
|
gamspy/_cli/util.py,sha256=ey3Wn7tCEggkr-sjcLqrVBda-jdadjWOn-APhSe4toE,2849
|
|
45
45
|
gamspy/_symbols/__init__.py,sha256=p0Zd7XytuOe8kRclN1lFrRFaN_btFSSGdIBSXrlp03E,450
|
|
@@ -82,9 +82,9 @@ gamspy/math/matrix.py,sha256=PmYsMhF8Pq3bcgtyINryq4xV36i4KW0BtcFApOvt8GQ,16365
|
|
|
82
82
|
gamspy/math/misc.py,sha256=hXfjwDYILcp68PiBWuEXCqbVEquhtyst4xMXd-lYFXg,39887
|
|
83
83
|
gamspy/math/probability.py,sha256=gAVU_PTfbjXuN6i8XNjZpIYvFg8dPk1imZCbKQloSG0,4290
|
|
84
84
|
gamspy/math/trigonometric.py,sha256=VBWQcP3ggl1oGDEzRs2M_T88HPJn9N0QfMJZwEUkx4w,4276
|
|
85
|
-
gamspy-1.19.
|
|
86
|
-
gamspy-1.19.
|
|
87
|
-
gamspy-1.19.
|
|
88
|
-
gamspy-1.19.
|
|
89
|
-
gamspy-1.19.
|
|
90
|
-
gamspy-1.19.
|
|
85
|
+
gamspy-1.19.3.dist-info/licenses/LICENSE,sha256=I7K4bIaFtw6qvHJ1bgwnxfJIGSJ6zZrEt6l46t6c_Zg,1189
|
|
86
|
+
gamspy-1.19.3.dist-info/METADATA,sha256=vzXomAjfo5kpG0buf5DIMvljubUkm-8G33T_zcI6tDU,3883
|
|
87
|
+
gamspy-1.19.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
88
|
+
gamspy-1.19.3.dist-info/entry_points.txt,sha256=tzgC7L0Y_BiyagBCaYOPK7lE4olRJKM_PH2inmMvj60,48
|
|
89
|
+
gamspy-1.19.3.dist-info/top_level.txt,sha256=fsq4q5lfdb2GEZC9O3PUih38s7TfIgolIaO5NgR3Hf8,7
|
|
90
|
+
gamspy-1.19.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|