Skip to content

Commit 6e615d1

Browse files
[MERGE] Merge branch 'release/1.20.0' into 'master'
Release/1.20.0 See merge request devel/gamspy!755
2 parents 3f4cc4c + 74b4d2c commit 6e615d1

44 files changed

Lines changed: 1408 additions & 673 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: detect-secrets
2020
args: [ --baseline, .secrets.baseline, --exclude-files, ^docs/user/notebooks/]
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.15.0
22+
rev: v0.15.1
2323
hooks:
2424
# Run the linter.
2525
- id: ruff-check

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@
135135
"filename": "tests/integration/test_engine.py",
136136
"hashed_secret": "ffa6706ff2127a749973072756f83c532e43ed02",
137137
"is_verified": false,
138-
"line_number": 211
138+
"line_number": 208
139139
}
140140
]
141141
},
142-
"generated_at": "2026-01-27T21:53:18Z"
142+
"generated_at": "2026-02-05T15:17:49Z"
143143
}

CHANGELOG.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
GAMSPy 1.20.0 (2026-02-18)
2+
==========================
3+
4+
Improvements in existing functionality
5+
--------------------------------------
6+
- #765: Return FormulationResult instance for Neural Network formulations (pooling, convolution, and linear layers).
7+
- #772: Allow specifying gdx and python files as an option in 'gamspy mps2gms' command. Add '--compress' option to 'gamspy mps2gms'.
8+
9+
Bug fixes
10+
---------
11+
- #777: Fix model attribute updates for frozen models.
12+
13+
Improved documentation
14+
----------------------
15+
- #764: Sync tabs in embed neural networks docs.
16+
- #771: Add a FAQ entry about running model instances in MPS or LP format.
17+
18+
Dependencies
19+
------------
20+
- #774: Upgrade gamspy_base and gamsapi dependency ranges.
21+
22+
Miscellaneous internal changes
23+
------------------------------
24+
- #768: Use pytest's tmp_path for tests instead of creating temp directories manually.
25+
126
GAMSPy 1.19.3 (2026-02-06)
227
==========================
328

docs/_static/switcher.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"name": "latest", "version": "latest", "url": "https://gamspy.readthedocs.io/en/latest/"}, {"name": "1.19.3 (stable)", "version": "v1.19.3", "url": "https://gamspy.readthedocs.io/en/v1.19.3/"}, {"name": "1.19.2", "version": "v1.19.2", "url": "https://gamspy.readthedocs.io/en/v1.19.2/"}, {"name": "1.19.1", "version": "v1.19.1", "url": "https://gamspy.readthedocs.io/en/v1.19.1/"}, {"name": "1.19.0", "version": "v1.19.0", "url": "https://gamspy.readthedocs.io/en/v1.19.0/"}, {"name": "1.18.4", "version": "v1.18.4", "url": "https://gamspy.readthedocs.io/en/v1.18.4/"}, {"name": "1.18.3", "version": "v1.18.3", "url": "https://gamspy.readthedocs.io/en/v1.18.3/"}, {"name": "1.18.2", "version": "v1.18.2", "url": "https://gamspy.readthedocs.io/en/v1.18.2/"}, {"name": "1.18.1", "version": "v1.18.1", "url": "https://gamspy.readthedocs.io/en/v1.18.1/"}, {"name": "1.18.0", "version": "v1.18.0", "url": "https://gamspy.readthedocs.io/en/v1.18.0/"}, {"name": "1.17.2", "version": "v1.17.2", "url": "https://gamspy.readthedocs.io/en/v1.17.2/"}, {"name": "1.17.1", "version": "v1.17.1", "url": "https://gamspy.readthedocs.io/en/v1.17.1/"}, {"name": "1.17.0", "version": "v1.17.0", "url": "https://gamspy.readthedocs.io/en/v1.17.0/"}, {"name": "1.16.0", "version": "v1.16.0", "url": "https://gamspy.readthedocs.io/en/v1.16.0/"}, {"name": "1.15.1", "version": "v1.15.1", "url": "https://gamspy.readthedocs.io/en/v1.15.1/"}, {"name": "1.15.0", "version": "v1.15.0", "url": "https://gamspy.readthedocs.io/en/v1.15.0/"}, {"name": "1.14.0", "version": "v1.14.0", "url": "https://gamspy.readthedocs.io/en/v1.14.0/"}, {"name": "1.13.0", "version": "v1.13.0", "url": "https://gamspy.readthedocs.io/en/v1.13.0/"}, {"name": "1.12.1", "version": "v1.12.1", "url": "https://gamspy.readthedocs.io/en/v1.12.1/"}, {"name": "1.12.0", "version": "v1.12.0", "url": "https://gamspy.readthedocs.io/en/v1.12.0/"}, {"name": "1.11.1", "version": "v1.11.1", "url": "https://gamspy.readthedocs.io/en/v1.11.1/"}, {"name": "1.11.0", "version": "v1.11.0", "url": "https://gamspy.readthedocs.io/en/v1.11.0/"}, {"name": "1.10.0", "version": "v1.10.0", "url": "https://gamspy.readthedocs.io/en/v1.10.0/"}, {"name": "1.9.0", "version": "v1.9.0", "url": "https://gamspy.readthedocs.io/en/v1.9.0/"}, {"name": "1.8.0", "version": "v1.8.0", "url": "https://gamspy.readthedocs.io/en/v1.8.0/"}, {"name": "1.7.0", "version": "v1.7.0", "url": "https://gamspy.readthedocs.io/en/v1.7.0/"}, {"name": "1.6.0", "version": "v1.6.0", "url": "https://gamspy.readthedocs.io/en/v1.6.0/"}, {"name": "1.5.1", "version": "v1.5.1", "url": "https://gamspy.readthedocs.io/en/v1.5.1/"}, {"name": "1.5.0", "version": "v1.5.0", "url": "https://gamspy.readthedocs.io/en/v1.5.0/"}, {"name": "1.4.0", "version": "v1.4.0", "url": "https://gamspy.readthedocs.io/en/v1.4.0/"}, {"name": "1.3.1", "version": "v1.3.1", "url": "https://gamspy.readthedocs.io/en/v1.3.1/"}, {"name": "1.3.0", "version": "v1.3.0", "url": "https://gamspy.readthedocs.io/en/v1.3.0/"}, {"name": "1.2.0", "version": "v1.2.0", "url": "https://gamspy.readthedocs.io/en/v1.2.0/"}, {"name": "1.1.0", "version": "v1.1.0", "url": "https://gamspy.readthedocs.io/en/v1.1.0/"}, {"name": "1.0.4", "version": "v1.0.4", "url": "https://gamspy.readthedocs.io/en/v1.0.4/"}, {"name": "1.0.3", "version": "v1.0.3", "url": "https://gamspy.readthedocs.io/en/v1.0.3/"}, {"name": "1.0.2", "version": "v1.0.2", "url": "https://gamspy.readthedocs.io/en/v1.0.2/"}, {"name": "1.0.1", "version": "v1.0.1", "url": "https://gamspy.readthedocs.io/en/v1.0.1/"}, {"name": "1.0.0", "version": "v1.0.0", "url": "https://gamspy.readthedocs.io/en/v1.0.0/"}, {"name": "0.14.7", "version": "v0.14.7", "url": "https://gamspy.readthedocs.io/en/v0.14.7/"}, {"name": "0.14.6", "version": "v0.14.6", "url": "https://gamspy.readthedocs.io/en/v0.14.6/"}, {"name": "0.14.5", "version": "v0.14.5", "url": "https://gamspy.readthedocs.io/en/v0.14.5/"}, {"name": "0.14.4", "version": "v0.14.4", "url": "https://gamspy.readthedocs.io/en/v0.14.4/"}, {"name": "0.14.3", "version": "v0.14.3", "url": "https://gamspy.readthedocs.io/en/v0.14.3/"}, {"name": "0.14.2", "version": "v0.14.2", "url": "https://gamspy.readthedocs.io/en/v0.14.2/"}, {"name": "0.14.1", "version": "v0.14.1", "url": "https://gamspy.readthedocs.io/en/v0.14.1/"}, {"name": "0.14.0", "version": "v0.14.0", "url": "https://gamspy.readthedocs.io/en/v0.14.0/"}]
1+
[{"name": "latest", "version": "latest", "url": "https://gamspy.readthedocs.io/en/latest/"}, {"name": "1.20.0 (stable)", "version": "v1.20.0", "url": "https://gamspy.readthedocs.io/en/v1.20.0/"}, {"name": "1.19.3", "version": "v1.19.3", "url": "https://gamspy.readthedocs.io/en/v1.19.3/"}, {"name": "1.19.2", "version": "v1.19.2", "url": "https://gamspy.readthedocs.io/en/v1.19.2/"}, {"name": "1.19.1", "version": "v1.19.1", "url": "https://gamspy.readthedocs.io/en/v1.19.1/"}, {"name": "1.19.0", "version": "v1.19.0", "url": "https://gamspy.readthedocs.io/en/v1.19.0/"}, {"name": "1.18.4", "version": "v1.18.4", "url": "https://gamspy.readthedocs.io/en/v1.18.4/"}, {"name": "1.18.3", "version": "v1.18.3", "url": "https://gamspy.readthedocs.io/en/v1.18.3/"}, {"name": "1.18.2", "version": "v1.18.2", "url": "https://gamspy.readthedocs.io/en/v1.18.2/"}, {"name": "1.18.1", "version": "v1.18.1", "url": "https://gamspy.readthedocs.io/en/v1.18.1/"}, {"name": "1.18.0", "version": "v1.18.0", "url": "https://gamspy.readthedocs.io/en/v1.18.0/"}, {"name": "1.17.2", "version": "v1.17.2", "url": "https://gamspy.readthedocs.io/en/v1.17.2/"}, {"name": "1.17.1", "version": "v1.17.1", "url": "https://gamspy.readthedocs.io/en/v1.17.1/"}, {"name": "1.17.0", "version": "v1.17.0", "url": "https://gamspy.readthedocs.io/en/v1.17.0/"}, {"name": "1.16.0", "version": "v1.16.0", "url": "https://gamspy.readthedocs.io/en/v1.16.0/"}, {"name": "1.15.1", "version": "v1.15.1", "url": "https://gamspy.readthedocs.io/en/v1.15.1/"}, {"name": "1.15.0", "version": "v1.15.0", "url": "https://gamspy.readthedocs.io/en/v1.15.0/"}, {"name": "1.14.0", "version": "v1.14.0", "url": "https://gamspy.readthedocs.io/en/v1.14.0/"}, {"name": "1.13.0", "version": "v1.13.0", "url": "https://gamspy.readthedocs.io/en/v1.13.0/"}, {"name": "1.12.1", "version": "v1.12.1", "url": "https://gamspy.readthedocs.io/en/v1.12.1/"}, {"name": "1.12.0", "version": "v1.12.0", "url": "https://gamspy.readthedocs.io/en/v1.12.0/"}, {"name": "1.11.1", "version": "v1.11.1", "url": "https://gamspy.readthedocs.io/en/v1.11.1/"}, {"name": "1.11.0", "version": "v1.11.0", "url": "https://gamspy.readthedocs.io/en/v1.11.0/"}, {"name": "1.10.0", "version": "v1.10.0", "url": "https://gamspy.readthedocs.io/en/v1.10.0/"}, {"name": "1.9.0", "version": "v1.9.0", "url": "https://gamspy.readthedocs.io/en/v1.9.0/"}, {"name": "1.8.0", "version": "v1.8.0", "url": "https://gamspy.readthedocs.io/en/v1.8.0/"}, {"name": "1.7.0", "version": "v1.7.0", "url": "https://gamspy.readthedocs.io/en/v1.7.0/"}, {"name": "1.6.0", "version": "v1.6.0", "url": "https://gamspy.readthedocs.io/en/v1.6.0/"}, {"name": "1.5.1", "version": "v1.5.1", "url": "https://gamspy.readthedocs.io/en/v1.5.1/"}, {"name": "1.5.0", "version": "v1.5.0", "url": "https://gamspy.readthedocs.io/en/v1.5.0/"}, {"name": "1.4.0", "version": "v1.4.0", "url": "https://gamspy.readthedocs.io/en/v1.4.0/"}, {"name": "1.3.1", "version": "v1.3.1", "url": "https://gamspy.readthedocs.io/en/v1.3.1/"}, {"name": "1.3.0", "version": "v1.3.0", "url": "https://gamspy.readthedocs.io/en/v1.3.0/"}, {"name": "1.2.0", "version": "v1.2.0", "url": "https://gamspy.readthedocs.io/en/v1.2.0/"}, {"name": "1.1.0", "version": "v1.1.0", "url": "https://gamspy.readthedocs.io/en/v1.1.0/"}, {"name": "1.0.4", "version": "v1.0.4", "url": "https://gamspy.readthedocs.io/en/v1.0.4/"}, {"name": "1.0.3", "version": "v1.0.3", "url": "https://gamspy.readthedocs.io/en/v1.0.3/"}, {"name": "1.0.2", "version": "v1.0.2", "url": "https://gamspy.readthedocs.io/en/v1.0.2/"}, {"name": "1.0.1", "version": "v1.0.1", "url": "https://gamspy.readthedocs.io/en/v1.0.1/"}, {"name": "1.0.0", "version": "v1.0.0", "url": "https://gamspy.readthedocs.io/en/v1.0.0/"}, {"name": "0.14.7", "version": "v0.14.7", "url": "https://gamspy.readthedocs.io/en/v0.14.7/"}, {"name": "0.14.6", "version": "v0.14.6", "url": "https://gamspy.readthedocs.io/en/v0.14.6/"}, {"name": "0.14.5", "version": "v0.14.5", "url": "https://gamspy.readthedocs.io/en/v0.14.5/"}, {"name": "0.14.4", "version": "v0.14.4", "url": "https://gamspy.readthedocs.io/en/v0.14.4/"}, {"name": "0.14.3", "version": "v0.14.3", "url": "https://gamspy.readthedocs.io/en/v0.14.3/"}, {"name": "0.14.2", "version": "v0.14.2", "url": "https://gamspy.readthedocs.io/en/v0.14.2/"}, {"name": "0.14.1", "version": "v0.14.1", "url": "https://gamspy.readthedocs.io/en/v0.14.1/"}, {"name": "0.14.0", "version": "v0.14.0", "url": "https://gamspy.readthedocs.io/en/v0.14.0/"}]

docs/cli/mps2gms.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Usage
1111

1212
::
1313

14-
gamspy mps2gms <input_file> [gdx_file] [gms_file] [OPTIONS]
14+
gamspy mps2gms <input_file> [OPTIONS]
1515

1616
.. note::
1717
If no output files are specified, the command automatically generates ``<input>.py`` and ``<input>.gdx``.
@@ -24,6 +24,14 @@ Usage
2424
- Short
2525
- Default
2626
- Description
27+
* - --gdx
28+
-
29+
- <input_file>.gdx
30+
- Name of GDX output file.
31+
* - --gms
32+
-
33+
- None
34+
- Name of GAMS program output file.
2735
* - --py
2836
-
2937
- None
@@ -48,6 +56,10 @@ Usage
4856
-
4957
- 2
5058
- Shift block numbers by this integer value for stage attributes.
59+
* - --compress
60+
-
61+
- None
62+
- Whether to compress output gdx.
5163
* - --convertsense
5264
-
5365
- 0

docs/release/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Release Notes
77
.. toctree::
88
:maxdepth: 1
99

10+
release_1.20.0
1011
release_1.19.3
1112
release_1.19.2
1213
release_1.19.1

docs/release/release_1.20.0.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
GAMSPy 1.20.0 (2026-02-18)
2+
==========================
3+
4+
Improvements in existing functionality
5+
--------------------------------------
6+
- #765: Return FormulationResult instance for Neural Network formulations (pooling, convolution, and linear layers).
7+
- #772: Allow specifying gdx and python files as an option in 'gamspy mps2gms' command. Add '--compress' option to 'gamspy mps2gms'.
8+
9+
Bug fixes
10+
---------
11+
- #777: Fix model attribute updates for frozen models.
12+
13+
Improved documentation
14+
----------------------
15+
- #764: Sync tabs in embed neural networks docs.
16+
- #771: Add a FAQ entry about running model instances in MPS or LP format.
17+
18+
Dependencies
19+
------------
20+
- #774: Upgrade gamspy_base and gamsapi dependency ranges.
21+
22+
Miscellaneous internal changes
23+
------------------------------
24+
- #768: Use pytest's tmp_path for tests instead of creating temp directories manually.
25+

docs/user/faq.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,46 @@ If you have a network license, you should declare ``CURL_PROXY`` environment var
329329
communication via proxy with the license server: ::
330330

331331
CURL_PROXY=<proxy_server> python <your_script>.py
332+
333+
How can I solve model instances in MPS or LP format with GAMSPy?
334+
----------------------------------------------------------------
335+
336+
GAMSPy cannot directly read MPS or LP files. The CLI command `mps2gms <https://gamspy.readthedocs.io/en/latest/cli/mps2gms.html>`_
337+
can be used to convert a model instance in MPS or LP format into a GAMSPy script: ::
338+
339+
gamspy mps2gms model.mps
340+
341+
This creates a GDX file model.gdx with all the instance data and a generic GAMSPy script to solve the
342+
corresponding model instance. Once the GAMSPy script is generated, you can run: ::
343+
344+
python model.py
345+
346+
to solve your model instance. You can easily customize the script model.py to select a solver or set solver options.
347+
For example, the following changes to the solve method in the last line of the script model.py set the solver to HiGHS,
348+
select the HiPO interior point method, set threads to 6, and instruct to do no crossover: ::
349+
350+
mps_model.solve(
351+
solver="highs",
352+
solver_options={
353+
"solver": "hipo",
354+
"threads": 6,
355+
"run_crossover": "off",
356+
},
357+
output=sys.stdout,
358+
)
359+
360+
The `mps2gms <https://gamspy.readthedocs.io/en/latest/cli/mps2gms.html>`_ CLI tool has a couple of options
361+
that can come in handy, e.g. with option --convertsense MIN you can turn the problem into a minimization
362+
problem independent of the original objective sense. Moreover, mps2gms also converts compressed (gzip)
363+
MPS and LP files. The GDX representation of the data can also be stored in compressed format, by setting
364+
the environment variable GDXCOMPRESS to 1, e.g. (on Linux): ::
365+
366+
GDXCOMPRESS=1 gamspy mps2gms model.mps.gz
367+
368+
The compressed GDX files are usually half the size of the compressed MPS files. Moreover, with the convert
369+
method one can again create MPS files: ::
370+
371+
mps_model.convert('.', file_format=gp.FileFormat.CPLEXMPS)
372+
373+
This creates cplex.mps in the current directory.
374+

0 commit comments

Comments
 (0)