Skip to content

Commit e8bcecf

Browse files
Merge branch 'master' into gentle-optimization-status
2 parents 6871ad3 + cf3df99 commit e8bcecf

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

doc/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Version 0.4.4
1111

1212
* **IMPORTANT BUGFIX**: The last slice of constraints was not correctly written to LP files in case the constraint size was not a multiple of the slice size. This is fixed now.
1313
* Solution files that following a different naming scheme of variables and constraints using more than on initial letter in the prefix (e.g. `col123`, `row456`) are now supported.
14+
* GLPK solver is always called with the `--freemps` option instead of the `--mps` when using the Solver API to solve an external MPS file. `--mps` is for the older fixed-column MPS format that is rarely used nowadays. Almost all fixed MPS files can be parsed by the free MPS format.
1415

1516
Version 0.4.3
1617
--------------

linopy/solvers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ def solve_problem_from_file(
556556
Path(solution_fn).parent.mkdir(exist_ok=True)
557557

558558
# TODO use --nopresol argument for non-optimal solution output
559-
command = f"glpsol --{io_api} {problem_fn} --output {solution_fn} "
559+
io_api_arg = "freemps" if io_api == "mps" else io_api
560+
command = f"glpsol --{io_api_arg} {problem_fn} --output {solution_fn} "
560561
if log_fn is not None:
561562
command += f"--log {log_fn} "
562563
if warmstart_fn:

test/test_solvers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from linopy import solvers
1111

12-
free_mps_problem = """NAME sample_mip
12+
free_mps_problem = """NAME sample_mip
1313
ROWS
1414
N obj
1515
G c1

0 commit comments

Comments
 (0)