Decision Optimization

 View Only
  • 1.  docplex deactivate notifications

    Posted Mon June 20, 2022 09:21 AM
    hi All,

    I have been using docplex for a while, but for some reason (recent update?) its logging behavior has changed recently:
    Whenever I call :
    from docplex.mp.model
    m = Model()
    .... # create my model
    m.solve()

    I get this type of UNDESIRED information :
    Notify start solve: engine_type=None, solve_details={
    "MODEL_DETAIL_INTEGER_VARS": 0,
    "MODEL_DETAIL_CONTINUOUS_VARS": 13,
    "MODEL_DETAIL_CONSTRAINTS": 11,
    "MODEL_DETAIL_BOOLEAN_VARS": 0,
    "MODEL_DETAIL_KPIS": "[]",
    "STAT.cplex.size.integerVariables": 0,
    "STAT.cplex.size.continousVariables": 13,
    "STAT.cplex.size.linearConstraints": 11,
    "STAT.cplex.size.booleanVariables": 0,
    "STAT.cplex.size.constraints": 11,
    "STAT.cplex.size.quadraticConstraints": 0,
    "STAT.cplex.size.variables": 13,
    "STAT.cplex.modelType": "LP",
    "MODEL_DETAIL_OBJECTIVE_SENSE": "minimize"
    }
    06/20 02:36:57 Notify end solve, status=JobSolveStatus.OPTIMAL_SOLUTION, solve_time=None

    This does not happen when printing to the console, but happens when using logging module instead of print (for other parts of my code).
    I tried several things like: m.solve(log_output=False) or m.logger.set_quiet() but nothing worked so far.
    So my question is how to avoid printing these solve details ?

    Thanks in advance for your help!


    #DecisionOptimization


  • 2.  RE: docplex deactivate notifications

    Posted Mon June 20, 2022 09:44 AM
    Can you give more details how your run docplex (python interpreter, notebooks, Cloud pack for Data,...)? 
    Did you change the logging in any way (level for example?)?

    ------------------------------
    Vincent Beraudier
    ------------------------------



  • 3.  RE: docplex deactivate notifications

    Posted Mon June 20, 2022 09:51 AM
    I am using PyCharm 2020.1.2, python 3.7, docplex 2.22.213, solve locally (I have the academic license).
    No I have not changed the logging in any way.


  • 4.  RE: docplex deactivate notifications

    Posted Mon June 20, 2022 10:13 AM
    OK, I just updated docplex and cplex and it is working now!!