Skip to content

Unsupported bound type "MI" #886

@flomnes

Description

@flomnes

Details for the issue

What did you do?

I called

pulp.LpProblem.fromMPS("problem.mps")

with this problem

problem.zip

What did you expect to see?

I expected the problem to be loaded without errors.

What did you see instead?

This error (output truncated)

    File "/home/runner/work/Antares_Simulator/Antares_Simulator/src/tests/cucumber/features/steps/common_steps/mps_utils.py", line 4, in load_problem
     return pulp.LpProblem.fromMPS(path)[1]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/pulp/pulp.py", line 1702, in fromMPS
     data = mpslp.readMPS(filename, sense=sense, dropConsNames=dropConsNames)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/pulp/mps_lp.py", line 244, in readMPS
     readMPSSetBounds(line, variable_info)  # type: ignore[arg-type]
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/pulp/mps_lp.py", line 289, in readMPSSetBounds
     raise const.PulpError(f"Unknown bound {bound}")
 pulp.constants.PulpError: Unknown bound UI

Useful extra information

It looks like this line was added between 3.0.2 and 3.3.0

        else:
            raise const.PulpError(f"Unknown bound {bound}")

in the last nested if..else case, making fromMPS less tolerant to unknown bound types such as "UI".

According to this page, UI should be a valid bound qualifier

                 UI    integer variable   (0 <=) x <= b

What operating system are you using?

I have been able to reproduce in these environments

  • Windows: ( _version: Windows Server 2022)
  • Linux: ( _distro: Ubuntu 22.04)
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using python version:

  • 3.7
  • 3.8
  • 3.9
  • 3.10
  • 3.11
  • Other: 3.12

I installed PuLP via:

Did you also

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions