Skip to content

Fix: reject non-MPS files and undeclared rows in MPS reader - #118

Merged
ZedongPeng merged 3 commits into
MIT-Lu-Lab:mainfrom
ZedongPeng:fix/reject-non-mps-files
Nov 20, 2026
Merged

ZedongPeng merged 3 commits into
MIT-Lu-Lab:mainfrom
ZedongPeng:fix/reject-non-mps-files

Conversation

@ZedongPeng

Copy link
Copy Markdown
Collaborator

Fixes #117.

The MPS reader silently skipped lines it didn't recognize, so non-MPS input (e.g. an .lp file) was read as an empty model.

  • Only .mps / .mps.gz are accepted; a file without a ROWS section is rejected.
  • Entries referencing rows not declared in ROWS, and unknown row types, now raise instead of being dropped.

Tested on GPU: pytest 120 passed.

@ZedongPeng
ZedongPeng merged commit 581df4c into MIT-Lu-Lab:main Nov 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.lp files fed into read() end up running with empty model

1 participant