Ask Your Question

how to limit the verbosity in case of error

asked 2020-10-13 15:19:21 +0100

Cyrille gravatar image

The following problem has no solution. But, often, I need only the last line of the Sagemath comments to debug the problem. I have tried use set_verbose() but it doesn't change any thing.

%display latex
m=3 #nombre de contraintes
n=2 # nombre de variables
p = MixedIntegerLinearProgram(maximization=False, solver = "GLPK") # Création du MILP
# on peut remplacer GLPK par PPL pour obtenir une optimisation fractionnaire.
x = p.new_variable(integer=False, indices=[0..n-1]) # les nouvelles variables seront x[1]... x[7]}
B = A * x # m
# Construction des contraintes
for i in range(m):
    p.add_constraint(B[i], min=bmin[i], max=bmax[i])
    # remove_constraint() pour en retirer une
for i in range(n):
p.set_objective(4.1*x[0]+8*x[1])# définition de l'objectif    
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2020-10-13 18:07:30 +0100

nbruin gravatar image

In IPython/Jupyter, the python shell sage uses, there is some possibly more convenient control:

With %xmode Minimal you can suppress the traceback completely.

edit flag offensive delete link more

answered 2020-10-13 17:57:20 +0100

Emmanuel Charpentier gravatar image

Sorry to refer you again to the Python documentation...

edit flag offensive delete link more


Emmanuel there is no reason to be sorry. My problem is to know what to read. The documentation is so huge and I am obliged to surf between Sagemath and Python.

Cyrille gravatar imageCyrille ( 2020-10-14 09:30:18 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-10-13 15:19:21 +0100

Seen: 211 times

Last updated: Oct 13 '20