Skip to content

installing sage_numerical_backends_gurobi changes output of certain __repr__ #2

Open
@saliola

Description

@saliola

I noticed this over at https://trac.sagemath.org/ticket/29955, but that ticket is not necessary to expose the problem. Basically, the __repr__ output changes when this package is installed.

First of all, I installed this package via:

sage -i sage_numerical_backends_gurobi

Here is an example that causes the problem:

sage: milp = MixedIntegerLinearProgram()
sage: x = milp.new_variable(binary=True, indices=[0,1])
sage: milp.add_constraint(x[0] + x[1] == 1)
sage: milp.show()
Maximization:


Constraints:
  R0: 1.0 <= x_ + x_ <= 1.0
Variables:
  x_ = x_0 is a boolean variable (min=0.0, max=1.0)
  x_ = x_1 is a boolean variable (min=0.0, max=1.0)

Note that both variables in the Constraints section are called x_ instead of x_0 and x_1.

Without this package I get the following:

sage: milp = MixedIntegerLinearProgram()
sage: x = milp.new_variable(binary=True, indices=[0,1])
sage: milp.add_constraint(x[0] + x[1] == 1)
sage: milp.show()
Maximization:


Constraints:
  1.0 <= x_0 + x_1 <= 1.0
Variables:
  x_0 is a boolean variable (min=0.0, max=1.0)
  x_1 is a boolean variable (min=0.0, max=1.0)

Version number: SageMath version 9.2.beta1, Release Date: 2020-06-13, but I also noticed this on version 9.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions