{
  "id": "task_libraries:optimization/python",
  "path": "/exapedia/python-optimization-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python optimization libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python optimization libraries find the inputs that minimize or maximize an objective, subject to constraints. A dedicated solver handles one class of problem, such as linear, quadratic, or conic programs, rather than an arbitrary function. These libraries let engineers and data scientists tune models, schedules, and designs toward the best result."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python optimization libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#scipy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#optuna",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F145"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ortools",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F162"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#highspy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#osqp",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F196"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pulp",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F213"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#clarabel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F228"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scs",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F245"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#scipy",
          "label": [
            {
              "t": "text",
              "text": "SciPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F131"
        },
        {
          "t": "text",
          "text": ", a count that covers all its scientific computing."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Mathematical-programming integer variables",
            "Arbitrary objective callbacks"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#scipy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#optuna",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F145"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ortools",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F162"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#highspy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#osqp",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F196"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pulp",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F213"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#clarabel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F228"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scs",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F245"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "scipy",
          "name": [
            {
              "t": "fact",
              "fact": "F130"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/scipy/scipy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/scipy"
            },
            {
              "label": "Docs",
              "href": "https://docs.scipy.org/doc/scipy/reference/optimize.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.scipy.org/doc/scipy/reference/optimize.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/scikit-learn/scikit-learn",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _constrained_optimization(self, obj_func, initial_theta, bounds):\n    if self.optimizer == \"fmin_l_bfgs_b\":\n        opt_res = scipy.optimize.minimize(\n            obj_func,\n            initial_theta,\n            method=\"L-BFGS-B\",\n            jac=True,\n            bounds=bounds,\n        )\n        _check_optimize_result(\"lbfgs\", opt_res)\n        theta_opt, func_min = opt_res.x, opt_res.fun\n    elif callable(self.optimizer):\n        theta_opt, func_min = self.optimizer(obj_func, initial_theta, bounds=bounds)\n    else:\n        raise ValueError(f\"Unknown optimizer {self.optimizer}.\")\n\n    return theta_opt, func_min",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/scikit-learn/scikit-learn/blob/a30a70e39ef550a01ea7234e9cf10d3d821df9cd/sklearn/gaussian_process/_gpr.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F142"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20scipy%20to%20build%20constrained%20models%20and%20optimize%20objectives&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from scipy.optimize import minimize\nresult = minimize(lambda x: (x[0] - 2.0) ** 2, x0=[0.0])\nprint(result.x)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.scipy.org/doc/scipy/reference/optimize.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "optimize.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F135"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "optuna",
          "name": [
            {
              "t": "fact",
              "fact": "F145"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/optuna/optuna"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/optuna"
            },
            {
              "label": "Docs",
              "href": "https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F152"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F145"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/optuna/optuna-examples",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def objective(trial):\n    iris = sklearn.datasets.load_iris()\n    x, y = iris.data, iris.target\n\n    classifier_name = trial.suggest_categorical(\"classifier\", [\"SVC\", \"RandomForest\"])\n    if classifier_name == \"SVC\":\n        svc_c = trial.suggest_float(\"svc_c\", 1e-10, 1e10, log=True)\n        classifier_obj = sklearn.svm.SVC(C=svc_c, gamma=\"auto\")\n    else:\n        rf_max_depth = trial.suggest_int(\"rf_max_depth\", 2, 32, log=True)\n        classifier_obj = sklearn.ensemble.RandomForestClassifier(\n            max_depth=rf_max_depth, n_estimators=10\n        )\n\n    score = sklearn.model_selection.cross_val_score(classifier_obj, x, y, n_jobs=-1, cv=3)\n    accuracy = score.mean()\n    return accuracy",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/optuna/optuna-examples/blob/9450de9b8b042e396bb816fdbe7fb4b5227b3323/sklearn/sklearn_simple.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F159"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=optuna%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F145"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import optuna\ndef objective(trial):\n    x = trial.suggest_float(\"x\", -10.0, 10.0)\n    return (x - 2.0) ** 2\nstudy = optuna.create_study()\nstudy.optimize(objective, n_trials=10)\nprint(study.best_params)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F150"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "ortools",
          "name": [
            {
              "t": "fact",
              "fact": "F162"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/google/or-tools"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/ortools"
            },
            {
              "label": "Docs",
              "href": "https://developers.google.com/optimization/lp/lp_example"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F169"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://developers.google.com/optimization/lp/lp_example",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F162"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/guillermo-navas-palencia/optbinning",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F177"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def build_model(self, divergence, n_nonevent, n_event, trend_change):\n    # Parameters\n    [D, V, pvalue_violation_indices,\n     min_diff_violation_indices] = model_data(\n        divergence, n_nonevent, n_event, self.max_pvalue,\n        self.max_pvalue_policy, self.min_event_rate_diff)\n\n    n = len(n_nonevent)\n    n_records = n_nonevent + n_event\n\n    # Initialize solver\n    if self.mip_solver == \"bop\":\n        solver = pywraplp.Solver(\n            'BinningMIP', pywraplp.Solver.BOP_INTEGER_PROGRAMMING)\n    elif self.mip_solver == \"cbc\":\n        solver = pywraplp.Solver(\n            'BinningMIP', pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING)\n\n    # Decision variables\n    x, y, t, d, u, bin_size_diff = self.decision_variables(solver, n)\n\n    # Objective function\n    if self.gamma:\n        total_records = int(n_records.sum())\n        regularization = self.gamma / total_records\n        pmax = solver.IntVar(0, total_records, \"pmax\")\n        pmin = solver.IntVar(0, total_records, \"pmin\")\n\n        solver.Maximize(solver.Sum([(V[i][i] * x[i, i]) +\n                        solver.Sum([(V[i][j] - V[i][j+1]) * x[i, j]\n                                    for j in range(i)])\n                                    for i in range(n)]) -\n                        regularization * (pmax - pmin))\n    else:\n        solver.Maximize(solver.Sum([(V[i][i] * x[i, i]) +\n                        solver.Sum([(V[i][j] - V[i][j+1]) * x[i, j]\n                                    for j in range(i)])\n                                    for i in range(n)]))\n\n    # Constraint: unique assignment\n    self.add_constraint_unique_assignment(solver, n, x)\n\n    # Constraint: continuity\n    self.add_constraint_continuity(solver, n, x)\n\n    # Constraint: min / max bins\n    self.add_constraint_min_max_bins(solver, n, x, d)\n\n    # Constraint: min / max bin size\n    self.add_constraint_min_max_bin_size(solver, n, x, u, n_records,\n                                         bin_size_diff)\n\n    # Constraint: min / max n_nonevent per bin\n    if (self.min_bin_n_nonevent is not None or\n            self.max_bin_n_nonevent is not None):\n        for i in range(n):\n            bin_ne_size = solver.Sum([n_nonevent[j] * x[i, j]\n                                      for j in range(i + 1)])\n\n            if self.min_bin_n_nonevent is not None:\n                solver.Add(bin_ne_size >= self.min_bin_n_nonevent*x[i, i])\n\n            if self.max_bin_n_nonevent is not None:\n                solver.Add(bin_ne_size <= self.max_bin_n_nonevent*x[i, i])\n\n    # Constraint: min / max n_event per bin\n    if (self.min_bin_n_event is not None or\n            self.max_bin_n_event is not None):\n        for i in range(n):\n            bin_e_size = solver.Sum([n_event[j] * x[i, j]\n                                     for j in range(i + 1)])\n\n            if self.min_bin_n_event is not None:\n                solver.Add(bin_e_size >= self.min_bin_n_event * x[i, i])\n\n            if self.max_bin_n_event is not None:\n                solver.Add(bin_e_size <= self.max_bin_n_event * x[i, i])\n\n    # Constraints: monotonicity\n    if self.monotonic_trend == \"ascending\":\n        self.add_constraint_monotonic_ascending(solver, n, D, x)\n\n    elif self.monotonic_trend == \"descending\":\n        self.add_constraint_monotonic_descending(solver, n, D, x)\n\n    elif self.monotonic_trend == \"concave\":\n        self.add_constraint_monotonic_concave(solver, n, D, x)\n\n    elif self.monotonic_trend == \"convex\":\n        self.add_constraint_monotonic_convex(solver, n, D, x)\n\n    elif self.monotonic_trend in (\"peak\", \"valley\"):\n        for i in range(n):\n            solver.Add(t >= i - n * (1 - y[i]))\n            solver.Add(t <= i + n * y[i])\n\n        if self.monotonic_trend == \"peak\":\n            self.add_constraint_monotonic_peak(solver, n, D, x, y)\n        else:\n            self.add_constraint_monotonic_valley(solver, n, D, x, y)\n\n    elif self.monotonic_trend == \"peak_heuristic\":\n        self.add_constraint_monotonic_peak_heuristic(\n            solver, n, D, x, trend_change)\n\n    elif self.monotonic_trend == \"valley_heuristic\":\n        self.add_constraint_monotonic_valley_heuristic(\n            solver, n, D, x, trend_change)\n\n    # Constraint: reduction of dominating bins\n    if self.gamma:\n        for i in range(n):\n            bin_size = solver.Sum([n_records[j] * x[i, j]\n                                   for j in range(i + 1)])\n\n            solver.Add(pmin <= total_records * (1 - x[i, i]) + bin_size)\n            solver.Add(pmax >= bin_size)\n        solver.Add(pmin <= pmax)\n\n    # Constraint: max-pvalue\n    self.add_constraint_violation(solver, x, pvalue_violation_indices)\n\n    # Constraint: min diff\n    self.add_constraint_violation(solver, x, min_diff_violation_indices)\n\n    # Constraint: fixed splits\n    self.add_constraint_fixed_splits(solver, n, x)\n\n    self.solver_ = solver\n    self._n = n\n    self._x = x",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/guillermo-navas-palencia/optbinning/blob/b5d8458454728a3a5be2bbde45ba5384663f1346/optbinning/binning/mip.py#L48-L178",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F176"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=ortools%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F162"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from ortools.linear_solver import pywraplp\nsolver = pywraplp.Solver.CreateSolver(\"GLOP\")\nx = solver.NumVar(0.0, 3.0, \"x\")\nsolver.Add(x >= 1.0)\nsolver.Minimize(x)\nstatus = solver.Solve()\nif status == pywraplp.Solver.OPTIMAL:\n    print(x.solution_value())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://developers.google.com/optimization/lp/lp_example",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F167"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "highspy",
          "name": [
            {
              "t": "fact",
              "fact": "F179"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ERGO-Code/HiGHS"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/highspy"
            },
            {
              "label": "Docs",
              "href": "https://ergo-code.github.io/HiGHS/stable/interfaces/python/example-py/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F186"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://ergo-code.github.io/HiGHS/stable/interfaces/python/example-py/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F179"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def solve_via_data(\n    self, data, warm_start: bool, verbose: bool, solver_opts, solver_cache=None\n):\n    \"\"\"Returns the result of the call to the solver.\n\n    minimize          cx\n        subject to    A x <=  b\n\n    in HiGHS, the opt problem format is,\n\n    minimize          cx\n        subject to    lboundA <= A x <= uboundA\n\n    Parameters\n    ----------\n    data : dict\n        Data used by the solver.\n    warm_start : bool\n        Whether to warm_start HiGHS.\n    verbose : bool\n        Should the solver print output?\n    solver_opts : dict\n        Additional arguments for the solver.\n\n    Returns\n    -------\n    tuple\n        (status, optimal value, primal, equality dual, inequality dual)\n    \"\"\"\n    import highspy as hp\n\n    # setup problem data\n    inf = hp.Highs().inf\n    dims = dims_to_solver_dict(data[s.DIMS])\n\n    c = data[s.C]\n    # A = sp.vstack([data[s.A], data[s.F]]).tocsc()\n    A = data[s.A].tocsc()\n    data[\"Ax\"] = A\n\n    leq_start = dims[s.EQ_DIM]\n    leq_end = dims[s.EQ_DIM] + dims[s.LEQ_DIM]\n    uboundA = data[s.B]\n    data[\"u\"] = uboundA\n    lboundA = np.concatenate(\n        [data[s.B][:leq_start], -inf * np.ones(data[s.B][leq_start:leq_end].shape)]\n    )\n    data[\"l\"] = lboundA\n\n    # setup highs model\n    model = hp.HighsModel()\n    lp = model.lp_\n    lp.num_col_ = A.shape[1]\n    # assert data['n_var'] == A.shape[1]\n    lp.num_row_ = A.shape[0]\n    # assert data['n_eq'] + data['n_ineq'] == A.shape[0]\n\n    # offset already applied in invert()\n    lp.offset_ = 0\n    lp.col_cost_ = c\n    lp.row_lower_ = lboundA\n    lp.row_upper_ = uboundA\n\n    assert A.format == \"csc\"\n    lp.a_matrix_.format_ = hp.MatrixFormat.kColwise\n    lp.a_matrix_.start_ = A.indptr\n    lp.a_matrix_.index_ = A.indices\n    lp.a_matrix_.value_ = A.data\n\n    # Define Variable bounds\n    lb = data[s.LOWER_BOUNDS]\n    ub = data[s.UPPER_BOUNDS]\n    col_lower = np.full(lp.num_col_, -inf, dtype=c.dtype) if lb is None else lb.copy()\n    col_upper = np.full(lp.num_col_, inf, dtype=c.dtype) if ub is None else ub.copy()\n    # update col_lower and col_upper to account for boolean variables,\n    # also set integrality_ for boolean or integers variables\n    if data[s.BOOL_IDX] or data[s.INT_IDX]:\n        # note that integrality_ can only be assigned a list\n        integrality = [hp.HighsVarType.kContinuous] * lp.num_col_\n        if data[s.BOOL_IDX]:\n            for ind in data[s.BOOL_IDX]:\n                integrality[ind] = hp.HighsVarType.kInteger\n            bool_mask = np.array(data[s.BOOL_IDX], dtype=int)\n            col_lower[bool_mask] = np.maximum(col_lower[bool_mask], 0)\n            col_upper[bool_mask] = np.minimum(col_upper[bool_mask], 1)\n        for ind in data[s.INT_IDX]:\n            integrality[ind] = hp.HighsVarType.kInteger\n        lp.integrality_ = integrality\n    lp.col_lower_ = col_lower\n    lp.col_upper_ = col_upper\n\n    solver = hp.Highs()\n\n    # setup options\n    unpack_highs_options_inplace(solver_opts)\n    write_model_file = solver_opts.pop(\"write_model_file\", None)\n    solver.setOptionValue(\"log_to_console\", verbose)\n    for name, value in solver_opts.items():\n        # note that calling setOptionValue directly on the solver\n        # allows one to pass advanced options that aren't available\n        # on the HighOptions class (e.g., presolve_rule_off)\n        if solver.setOptionValue(name, value) == hp.HighsStatus.kError:\n            raise ValueError(\n                f\"HIGHS returned status kError for option (name, value): ({name}, {value})\"\n            )\n\n    if write_model_file:\n        # TODO: Names can be collected upstream more systematically\n        # (or in the parent class) to be used by all solvers.\n        set_column_names_from_variables(lp, data[s.PARAM_PROB].variables)\n\n    solver.passModel(model)\n\n    if write_model_file:\n        solver.writeModel(write_model_file)\n\n    if warm_start and solver_cache is not None and self.name() in solver_cache:\n        old_solver, old_data, old_result = solver_cache[self.name()]\n        old_status = self.STATUS_MAP.get(old_result[\"model_status\"], s.SOLVER_ERROR)\n        if old_status in s.SOLUTION_PRESENT:\n            solver.setSolution(old_result[\"solution\"])\n\n    # initialize and solve problem\n    try:\n        solver.run()\n        results = {\n            \"solution\": solver.getSolution(),\n            \"basis\": solver.getBasis(),\n            \"info\": solver.getInfo(),\n            \"model_status\": solver.getModelStatus().name,\n            \"run_time\": solver.getRunTime(),\n        }\n        if results[\"model_status\"] == \"kInfeasible\":\n            results[\"dual_ray\"] = solver.getDualRay()\n    except ValueError as e:\n        raise SolverError(e)\n\n    if solver_cache is not None:\n        solver_cache[self.name()] = (solver, data, results)\n\n    return results",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy/blob/0fc467a64a66f5a0f3b7cc721779dca5f1b7ce6f/cvxpy/reductions/solvers/conic_solvers/highs_conif.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F193"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=highspy%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F179"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import highspy\nsolver = highspy.Highs()\nx = solver.addVariable(lb=0.0, ub=3.0)\nsolver.addConstr(x >= 1.0)\nsolver.minimize(x)\nprint(solver.val(x))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://ergo-code.github.io/HiGHS/stable/interfaces/python/example-py/",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F184"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "osqp",
          "name": [
            {
              "t": "fact",
              "fact": "F196"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/osqp/osqp-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/osqp"
            },
            {
              "label": "Docs",
              "href": "https://osqp.org/docs/interfaces/python.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F203"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://osqp.org/docs/interfaces/python.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F196"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F211"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def solve_via_data(self, data, warm_start: bool, verbose: bool, solver_opts,\n                   solver_cache=None):\n    import osqp\n    is_pre_v1 = float(osqp.__version__.split('.')[0]) < 1\n\n    P = data[s.P]\n    q = data[s.Q]\n    A = sp.vstack([data[s.A], data[s.F]]).tocsc()\n    data['Ax'] = A\n    uA = np.concatenate((data[s.B], data[s.G]))\n    data['u'] = uA\n    lA = np.concatenate([data[s.B], -np.inf*np.ones(data[s.G].shape)])\n    data['l'] = lA\n\n    if P is not None:\n        P = sp.csc_matrix((P.data, P.indices, P.indptr), shape=P.shape)\n    if A is not None:\n        A = sp.csc_matrix((A.data, A.indices, A.indptr), shape=A.shape)\n\n    # Overwrite defaults eps_abs=eps_rel=1e-3, max_iter=4000\n    solver_opts['eps_abs'] = solver_opts.get('eps_abs', 1e-5)\n    solver_opts['eps_rel'] = solver_opts.get('eps_rel', 1e-5)\n    solver_opts['max_iter'] = solver_opts.get('max_iter', 10000)\n\n    # Use cached data\n    if warm_start and solver_cache is not None and self.name() in solver_cache:\n        solver, old_data, results = solver_cache[self.name()]\n        new_args = {}\n        for key in ['q', 'l', 'u']:\n            if any(data[key] != old_data[key]):\n                new_args[key] = data[key]\n        factorizing = False\n        if P.data.shape != old_data[s.P].data.shape or any(\n                P.data != old_data[s.P].data):\n            P_triu = sp.csc_array(sp.triu(P, format='csc'))\n            new_args['Px'] = P_triu.data\n            factorizing = True\n        if A.data.shape != old_data['Ax'].data.shape or any(\n                A.data != old_data['Ax'].data):\n            new_args['Ax'] = A.data\n            factorizing = True\n\n        if new_args:\n            solver.update(**new_args)\n        # Map OSQP statuses back to CVXPY statuses\n        status_map = self.STATUS_MAP_PRE_V1 if is_pre_v1 else self.STATUS_MAP\n        status = status_map.get(results.info.status_val, s.SOLVER_ERROR)\n        if status == s.OPTIMAL:\n            solver.warm_start(results.x, results.y)\n        # Polish if factorizing.\n        polish_param = 'polish' if is_pre_v1 else 'polishing'\n        solver_opts[polish_param] = solver_opts.get(polish_param, factorizing)\n        solver.update_settings(verbose=verbose, **solver_opts)\n    else:\n        # Initialize and solve problem\n        polish_param = 'polish' if is_pre_v1 else 'polishing'\n        solver_opts[polish_param] = solver_opts.get(polish_param, True)\n        solver = osqp.OSQP()\n        try:\n            solver.setup(P, q, A, lA, uA, verbose=verbose, **solver_opts)\n        except Exception as e:\n            raise SolverError(e)\n\n    results = solver.solve(raise_error=False)\n\n    if solver_cache is not None:\n        solver_cache[self.name()] = (solver, data, results)\n    return results",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy/blob/0fc467a64a66f5a0f3b7cc721779dca5f1b7ce6f/cvxpy/reductions/solvers/qp_solvers/osqp_qpif.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F210"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=osqp%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F196"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import numpy as np\nfrom scipy import sparse\nimport osqp\nsolver = osqp.OSQP()\nsolver.setup(P=sparse.csc_matrix([[1.0]]), q=np.array([0.0]), A=sparse.csc_matrix([[1.0]]), l=np.array([1.0]), u=np.array([np.inf]), verbose=False)\nprint(solver.solve(raise_error=False).x)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://osqp.org/docs/interfaces/python.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "python.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F201"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pulp",
          "name": [
            {
              "t": "fact",
              "fact": "F213"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/coin-or/pulp"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pulp"
            },
            {
              "label": "Docs",
              "href": "https://coin-or.github.io/pulp/technical/pulp.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F36"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://coin-or.github.io/pulp/technical/pulp.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F213"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/snakemake/snakemake",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F226"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def __contains__(self, x: object) -> bool:\n        try:\n            import pulp\n\n            return pulp.getSolver(x).available()\n        except Exception:  # noqa: BLE001\n            return False",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/snakemake/snakemake/blob/6d007cf012b0d4dfb80d3a7a21c2cd39bec8f7c8/src/snakemake/scheduling/milp.py#L49-L55",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F225"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20pulp%20to%20build%20constrained%20models%20and%20optimize%20objectives&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F213"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pulp import LpProblem, LpMinimize, COIN_CMD, value\nproblem = LpProblem(\"demo\", LpMinimize)\nx = problem.add_variable(\"x\", 0.0, 3.0)\nproblem += x\nproblem += x >= 1.0\nstats = problem.solve(COIN_CMD(msg=False))\nprint(stats.status_str, value(x))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://coin-or.github.io/pulp/technical/pulp.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F218"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "clarabel",
          "name": [
            {
              "t": "fact",
              "fact": "F228"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/oxfordcontrol/Clarabel.rs"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/clarabel"
            },
            {
              "label": "Docs",
              "href": "https://oxfordcontrol.github.io/ClarabelDocs/stable/python/getting_started_py/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F235"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://oxfordcontrol.github.io/ClarabelDocs/stable/python/getting_started_py/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F228"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F243"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def solve_via_data(self, data, warm_start: bool, verbose: bool, solver_opts, solver_cache=None):\n    \"\"\"Returns the result of the call to the solver.\n\n    Parameters\n    ----------\n    data : dict\n        Data generated via an apply call.\n    warm_start : Bool\n        Whether to warm_start Clarabel.\n    verbose : Bool\n        Control the verbosity.\n    solver_opts : dict\n        Clarabel-specific solver options.\n\n    Returns\n    -------\n    The result returned by a call to clarabel.solve().\n    \"\"\"\n    import clarabel\n\n    A = data[s.A]\n    b = data[s.B]\n    q = data[s.C]\n\n    if s.P in data:\n        P = data[s.P]\n    else:\n        nvars = q.size\n        P = sp.csc_array((nvars, nvars))\n\n    P = sp.triu(P).tocsc()\n\n    cones = dims_to_solver_cones(data[ConicSolver.DIMS])\n\n    def new_solver():\n\n        _settings = self.parse_solver_opts(verbose, solver_opts)\n        _solver = clarabel.DefaultSolver(P, q, A, b, cones, _settings)\n        return _solver\n\n    def updated_solver():\n\n        if (not warm_start) or (solver_cache is None) or (self.name() not in solver_cache):\n            return None\n\n        _solver = solver_cache[self.name()]\n\n        if not hasattr(_solver, \"update\"):\n            return None\n        elif not _solver.is_data_update_allowed():\n            # disallow when presolve or chordal decomposition is used\n            return None\n        else:\n            # current internal settings, to be updated if needed\n            oldsettings = _solver.get_settings()\n            newsettings = self.parse_solver_opts(verbose, solver_opts, oldsettings)\n\n            # this overwrites all data in the solver but will not\n            # reallocate internal memory.  Could be faster if it\n            # were known which terms (or partial terms) have changed.\n            try:\n                _solver.update(P=P, q=q, A=A, b=b, settings=newsettings)\n                return _solver\n            except Exception:\n                # If sparsity pattern or dimensions changed, update() fails.\n                # Return None to trigger a full new_solver() re-initialization.\n                return None\n\n    # Try to get cached data\n    solver = updated_solver()\n\n    if solver is None:\n        solver = new_solver()\n\n    results = solver.solve()\n\n    if solver_cache is not None:\n        solver_cache[self.name()] = solver\n\n    return results",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy/blob/0fc467a64a66f5a0f3b7cc721779dca5f1b7ce6f/cvxpy/reductions/solvers/conic_solvers/clarabel_conif.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F242"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=clarabel%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F228"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import numpy as np\nfrom scipy import sparse\nimport clarabel\nsettings = clarabel.DefaultSettings()\nsettings.verbose = False\nsolver = clarabel.DefaultSolver(sparse.csc_matrix((1, 1)), np.array([1.0]), sparse.csc_matrix([[-1.0]]), np.array([-1.0]), [clarabel.NonnegativeConeT(1)], settings)\nprint(solver.solve().x)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://oxfordcontrol.github.io/ClarabelDocs/stable/python/getting_started_py/",
                  "label": [
                    {
                      "t": "text",
                      "text": "getting_started_py.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F233"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "scs",
          "name": [
            {
              "t": "fact",
              "fact": "F245"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/bodono/scs-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/scs"
            },
            {
              "label": "Docs",
              "href": "https://www.cvxgrp.org/scs/api/python.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F252"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://www.cvxgrp.org/scs/api/python.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F245"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F260"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F261"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F260"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def solve_via_data(self, data, warm_start: bool, verbose: bool, solver_opts, solver_cache=None):\n    \"\"\"Returns the result of the call to the solver.\n\n    Parameters\n    ----------\n    data : dict\n        Data generated via an apply call.\n    warm_start : Bool\n        Whether to warm_start SCS.\n    verbose : Bool\n        Control the verbosity.\n    solver_opts : dict\n        SCS-specific solver options.\n\n    Returns\n    -------\n    The result returned by a call to scs.solve().\n    \"\"\"\n    import scs\n    args = {\"A\": data[s.A], \"b\": data[s.B], \"c\": data[s.C]}\n    if s.P in data:\n        args[\"P\"] = data[s.P]\n    if warm_start and solver_cache is not None and \\\n            self.name() in solver_cache:\n        args[\"x\"] = solver_cache[self.name()][\"x\"]\n        args[\"y\"] = solver_cache[self.name()][\"y\"]\n        args[\"s\"] = solver_cache[self.name()][\"s\"]\n    cones = dims_to_solver_dict(data[ConicSolver.DIMS])\n\n    def solve(_solver_opts):\n        _results = scs.solve(args, cones, verbose=verbose, **_solver_opts)\n        _status = self.STATUS_MAP[_results[\"info\"][\"status_val\"]]\n        return _results, _status\n\n    solver_opts = SCS.parse_solver_options(solver_opts)\n    results, status = solve(solver_opts)\n    if solver_cache is not None and status == s.OPTIMAL:\n        solver_cache[self.name()] = results\n    return results",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/cvxpy/cvxpy/blob/0fc467a64a66f5a0f3b7cc721779dca5f1b7ce6f/cvxpy/reductions/solvers/conic_solvers/scs_conif.py#L200-L238",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F259"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=scs%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F245"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import numpy as np\nfrom scipy import sparse\nimport scs\ndata = {\"A\": sparse.csc_matrix([[-1.0]]), \"b\": np.array([-1.0]), \"c\": np.array([1.0])}\nsolver = scs.SCS(data, {\"l\": 1}, verbose=False)\nprint(solver.solve()[\"x\"])\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://www.cvxgrp.org/scs/api/python.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "python.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F250"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python optimization library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#scipy",
          "label": [
            {
              "t": "text",
              "text": "SciPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits general objective functions, least squares, and linear programs. "
        },
        {
          "t": "link",
          "href": "#ortools",
          "label": [
            {
              "t": "text",
              "text": "OR-Tools"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits scheduling, routing, and other discrete models. "
        },
        {
          "t": "link",
          "href": "#optuna",
          "label": [
            {
              "t": "text",
              "text": "Optuna"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits tuning hyperparameters and other black-box objectives."
        }
      ]
    },
    {
      "q": "What is Optuna?",
      "a": [
        {
          "t": "link",
          "href": "#optuna",
          "label": [
            {
              "t": "text",
              "text": "Optuna"
            }
          ]
        },
        {
          "t": "text",
          "text": " optimizes black-box objectives through trials that sample float, integer, and categorical parameters. It prunes unpromising trials and supports custom samplers."
        }
      ]
    },
    {
      "q": "What is scipy.optimize?",
      "a": [
        {
          "t": "text",
          "text": "The scipy.optimize module in "
        },
        {
          "t": "link",
          "href": "#scipy",
          "label": [
            {
              "t": "text",
              "text": "SciPy"
            }
          ]
        },
        {
          "t": "text",
          "text": " minimizes objective functions with local and global methods. It also handles nonlinear constraints, least squares, linear programming, and mixed-integer linear programming."
        }
      ]
    },
    {
      "q": "What is OSQP?",
      "a": [
        {
          "t": "link",
          "href": "#osqp",
          "label": [
            {
              "t": "text",
              "text": "OSQP"
            }
          ]
        },
        {
          "t": "text",
          "text": " solves convex quadratic programs from sparse matrix inputs. It can update the problem data and solve again without repeating the setup."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, scipy",
      "display": "SciPy",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, scipy",
      "display": "379.9M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, scipy",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, scipy",
      "display": "1.18.1, Aug 2026",
      "asOf": "2026-08-21"
    },
    "F5": {
      "label": "Package release date, scipy",
      "display": "Aug 2026",
      "asOf": "2026-08-21"
    },
    "F6": {
      "label": "Repository stars, scipy",
      "display": "15.2K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Linear programs, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Integer variables, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Nonlinear objectives, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Nonlinear constraints, scipy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, scipy",
      "display": "pip install scipy",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, scipy",
      "display": "Provides numerical optimization routines for objectives, constraints, and mixed-integer linear programs.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, scipy",
      "display": "Optimizes Python objective functions",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, scipy",
      "display": "Pass an objective function directly to minimize.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, scipy",
      "display": "Includes mixed-integer linear optimization",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, scipy",
      "display": "Use milp for linear models with integer decisions.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, scipy",
      "display": "Minimize targets local minima",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, scipy",
      "display": "Choose a global optimizer when a local minimum is insufficient.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "Quickstart, scipy",
      "display": "import numpy as np\n\nfrom scipy.optimize import minimize\n\ndef rosen(x):\n    \"\"\"The Rosenbrock function\"\"\"\n    return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)\n\nx0 = np.array([1.3, 0.7, 0.8, 1.9, 1.2])\n\nres = minimize(rosen, x0, method='nelder-mead',\n               options={'xatol': 1e-8, 'disp': True})\n\nprint(res.x)\n",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Project function, scipy",
      "display": "def _constrained_optimization(self, obj_func, initial_theta, bounds):\n    if self.optimizer == \"fmin_l_bfgs_b\":\n        opt_res = scipy.optimize.minimize(\n            obj_func,\n            initial_theta,\n            method=\"L-BFGS-B\",\n            jac=True,\n            bounds=bounds,\n        )\n        _check_optimize_result(\"lbfgs\", opt_res)\n        theta_opt, func_min = opt_res.x, opt_res.fun\n    elif callable(self.optimizer):\n        theta_opt, func_min = self.optimizer(obj_func, initial_theta, bounds=bounds)\n    else:\n        raise ValueError(f\"Unknown optimizer {self.optimizer}.\")\n\n    return theta_opt, func_min\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function reference, scipy",
      "display": "_gpr.py · _constrained_optimization()",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project repository, scipy",
      "display": "scikit-learn/scikit-learn",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project stars, scikit-learn/scikit-learn",
      "display": "68.2K",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project push date, scikit-learn/scikit-learn",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F25": {
      "label": "Library name, pulp",
      "display": "PuLP",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Monthly downloads, pulp",
      "display": "6.1M",
      "asOf": "2026-11-16"
    },
    "F27": {
      "label": "License, pulp",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Package release, pulp",
      "display": "4.2.0, Oct 2026",
      "asOf": "2026-10-22"
    },
    "F29": {
      "label": "Package release date, pulp",
      "display": "Oct 2026",
      "asOf": "2026-10-22"
    },
    "F30": {
      "label": "Repository stars, pulp",
      "display": "2.5K",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Linear programs, pulp",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Integer variables, pulp",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Nonlinear objectives, pulp",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Nonlinear constraints, pulp",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Install, pulp",
      "display": "pip install \"pulp[cbc]\"",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "What it does, pulp",
      "display": "Builds linear and mixed-integer models and sends them to selected solvers.",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths lead, pulp",
      "display": "Defines integer decisions",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths, pulp",
      "display": "Set integer variable types when building a linear model.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, pulp",
      "display": "Exports solver-ready models",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, pulp",
      "display": "Write LP or MPS files for external solver workflows.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "limitations lead, pulp",
      "display": "Solver binaries are installed separately",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations, pulp",
      "display": "Install a solver extra or supply an accessible solver.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, pulp",
      "display": "Native expressions stay linear",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, pulp",
      "display": "Use Pyomo for nonlinear objectives or constraints.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Quickstart, pulp",
      "display": "from pulp import *\nprob = LpProblem(\"myProblem\", LpMinimize)\nx = prob.add_variable(\"x\", 0, 3)\n\ny = prob.add_variable(\"y\", cat=\"Binary\")\n\nprob += x + y <= 2\n\nprob += -4*x + y\n\nstats = prob.solve()\n",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Library name, cvxpy",
      "display": "CVXPY",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Monthly downloads, cvxpy",
      "display": "5.0M",
      "asOf": "2026-11-16"
    },
    "F48": {
      "label": "License, cvxpy",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Package release, cvxpy",
      "display": "1.9.3, Sep 2026",
      "asOf": "2026-09-19"
    },
    "F50": {
      "label": "Package release date, cvxpy",
      "display": "Sep 2026",
      "asOf": "2026-09-19"
    },
    "F51": {
      "label": "Repository stars, cvxpy",
      "display": "6.4K",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Linear programs, cvxpy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Integer variables, cvxpy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Nonlinear objectives, cvxpy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Nonlinear constraints, cvxpy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Install, cvxpy",
      "display": "pip install cvxpy",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "What it does, cvxpy",
      "display": "Provides a modeling language for optimization with convex and supported nonlinear solving modes.",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "strengths lead, cvxpy",
      "display": "Expresses objectives with array operations",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "strengths, cvxpy",
      "display": "Build least-squares objectives and constraints with CVXPY expressions.",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "strengths lead, cvxpy",
      "display": "Offers convex and nonlinear modes",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "strengths, cvxpy",
      "display": "Use nlp=True for supported nonconvex problems.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "limitations lead, cvxpy",
      "display": "Nonconvex solves lack optimality guarantees",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "limitations, cvxpy",
      "display": "Check feasibility and initial-point sensitivity before relying on a nonconvex solution.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "Quickstart, cvxpy",
      "display": "# Import packages.\nimport cvxpy as cp\nimport numpy as np\n\n# Generate data.\nm = 20\nn = 15\nnp.random.seed(1)\nA = np.random.randn(m, n)\nb = np.random.randn(m)\n\n# Define and solve the CVXPY problem.\nx = cp.Variable(n)\ncost = cp.sum_squares(A @ x - b)\nprob = cp.Problem(cp.Minimize(cost))\nprob.solve()\n\n# Print result.\nprint(\"\\nThe optimal value is\", prob.value)\nprint(\"The optimal x is\")\nprint(x.value)\nprint(\"The norm of the residual is \", cp.norm(A @ x - b, p=2).value)\n\n",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "Project function, cvxpy",
      "display": "def _solve_cvxpy_opt_problem(self):\n    \"\"\"\n    Helper method to solve the cvxpy problem and check output,\n    once objectives and constraints have been defined\n\n    Raises\n    ------\n    exceptions.OptimizationError\n        if problem is not solvable by cvxpy\n    \"\"\"\n    try:\n        if self._opt is None:\n            self._opt = cp.Problem(cp.Minimize(self._objective), self._constraints)\n            self._initial_objective = self._objective.id\n            self._initial_constraint_ids = {const.id for const in self._constraints}\n        else:\n            if not self._objective.id == self._initial_objective:\n                raise InstantiationError(\n                    \"The objective function was changed after the initial optimization. \"\n                    \"Please create a new instance instead.\"\n                )\n\n            constr_ids = {const.id for const in self._constraints}\n            if not constr_ids == self._initial_constraint_ids:\n                raise InstantiationError(\n                    \"The constraints were changed after the initial optimization. \"\n                    \"Please create a new instance instead.\"\n                )\n        self._opt.solve(\n            solver=self._solver, verbose=self._verbose, **self._solver_options\n        )\n\n    except (TypeError, cp.DCPError) as e:\n        raise OptimizationError from e\n\n    if self._opt.status not in {\"optimal\", \"optimal_inaccurate\"}:\n        raise OptimizationError(\"Solver status: {}\".format(self._opt.status))\n    self.weights = self._w.value.round(16) + 0.0  # +0.0 removes signed zero\n    return self._make_output_weights()\n",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "Project function reference, cvxpy",
      "display": "_base_optimizer.py · _solve_cvxpy_opt_problem()",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "Project repository, cvxpy",
      "display": "PyPortfolio/PyPortfolioOpt",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Project stars, PyPortfolio/PyPortfolioOpt",
      "display": "6.2K",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Project push date, PyPortfolio/PyPortfolioOpt",
      "display": "Jul 2026",
      "asOf": "2026-07-07"
    },
    "F70": {
      "label": "Library name, pyomo",
      "display": "Pyomo",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Monthly downloads, pyomo",
      "display": "1.1M",
      "asOf": "2026-11-16"
    },
    "F72": {
      "label": "License, pyomo",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Package release, pyomo",
      "display": "6.10.1, Jun 2026",
      "asOf": "2026-06-04"
    },
    "F74": {
      "label": "Package release date, pyomo",
      "display": "Jun 2026",
      "asOf": "2026-06-04"
    },
    "F75": {
      "label": "Repository stars, pyomo",
      "display": "2.6K",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Linear programs, pyomo",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Integer variables, pyomo",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Nonlinear objectives, pyomo",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Nonlinear constraints, pyomo",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Install, pyomo",
      "display": "pip install pyomo",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "What it does, pyomo",
      "display": "Builds symbolic optimization models and connects them to commercial or open-source solvers.",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "strengths lead, pyomo",
      "display": "Models nonlinear and integer problems",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "strengths, pyomo",
      "display": "Define mixed-integer nonlinear models with symbolic expressions.",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths lead, pyomo",
      "display": "Builds reusable symbolic models",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "strengths, pyomo",
      "display": "Create problem instances from a general symbolic model.",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "limitations lead, pyomo",
      "display": "Requires a separate solver install",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "limitations, pyomo",
      "display": "Install a compatible solver before solving the model.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "Quickstart, pyomo",
      "display": "import pyomo.environ as pyo\n\nmodel = pyo.ConcreteModel()\n\nmodel.x = pyo.Var([1,2], domain=pyo.NonNegativeReals)\n\nmodel.OBJ = pyo.Objective(expr = 2*model.x[1] + 3*model.x[2])\n\nmodel.Constraint1 = pyo.Constraint(expr = 3*model.x[1] + 4*model.x[2] >= 1)\n\n",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Project function, pyomo",
      "display": "def declareCommodityBalanceConstraints(self, pyM):\n    r\"\"\"Declare commodity balance constraints (one balance constraint for each commodity, location and time step).\n\n    .. math::\n\n        \\\\underset{\\\\text{comp} \\\\in \\\\mathcal{C}^{comm}_{loc}}{\\\\sum} \\\\text{C}^{comp,comm}_{loc,ip,p,t} = 0\n\n    :param pyM: a pyomo ConcreteModel instance which contains parameters, sets, variables,\n        constraints and objective required for the optimization set up and solving.\n    :type pyM: pyomo ConcreteModel\n    \"\"\"\n    utils.output(\"Declaring commodity balances...\", self.verboseLogLevel, 0)\n\n    pooled_commodities = set(self.pooledCommodities.keys())\n\n    # Declare and initialize a set that states for which location and commodity the commodity balance constraints\n    # are non-trivial (i.e. not 0 == 0; trivial constraints raise errors in pyomo).\n    # Pooled commodities are excluded here — they get their own constraint below.\n    def initLocationCommoditySet(pyM):\n        return (\n            (loc, commod)\n            for loc in self.locations\n            for commod in self.commodities\n            if commod not in pooled_commodities\n            and any(\n                [\n                    mdl.hasOpVariablesForLocationCommodity(self, loc, commod)\n                    for mdl in self.componentModelingDict.values()\n                ]\n            )\n        )\n\n    pyM.locationCommoditySet = pyomo.Set(\n        dimen=2, initialize=initLocationCommoditySet\n    )\n\n    # Declare and initialize commodity balance constraints by checking for each location and commodity in the\n    # locationCommoditySet and for each period and time step within the period if the commodity source and sink\n    # terms add up to zero. For this, get the contribution to commodity balance from each modeling class.\n    def commodityBalanceConstraint(pyM, loc, commod, ip, p, t):\n        return (\n            sum(\n                mdl.getCommodityBalanceContribution(pyM, commod, loc, ip, p, t)\n                for mdl in self.componentModelingDict.values()\n            )\n            == 0\n        )\n\n    pyM.commodityBalanceConstraint = pyomo.Constraint(\n        pyM.locationCommoditySet, pyM.timeSet, rule=commodityBalanceConstraint\n    )\n\n    # Declare pool-level balance constraints for pooled commodities.\n    # For each (pool_name, commodity) pair the sum of contributions across all pool\n    # locations must equal zero at every time step.\n    def initPoolCommoditySet(pyM):\n        return (\n            (pool_name, commod)\n            for commod, pools in self.pooledCommodities.items()\n            for pool_name, locs in pools.items()\n            # include only pools with valid operation variable\n            if any(\n                mdl.hasOpVariablesForLocationCommodity(self, loc, commod)\n                for loc in locs\n                for mdl in self.componentModelingDict.values()\n            )\n        )\n\n    pyM.poolCommoditySet = pyomo.Set(dimen=2, initialize=initPoolCommoditySet)\n\n    def poolCommodityBalanceConstraint(pyM, pool_name, commod, ip, p, t):\n        pool_locs = self.pooledCommodities[commod][pool_name]\n        return (\n            sum(\n                mdl.getCommodityBalanceContribution(pyM, commod, loc, ip, p, t)\n                for loc in pool_locs\n                for mdl in self.componentModelingDict.values()\n            )\n            == 0\n        )\n\n    pyM.poolCommodityBalanceConstraint = pyomo.Constraint(\n        pyM.poolCommoditySet, pyM.timeSet, rule=poolCommodityBalanceConstraint\n    )\n",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Project function reference, pyomo",
      "display": "energySystemModel.py · declareCommodityBalanceConstraints()",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "Project repository, pyomo",
      "display": "FZJ-IEK3-VSA/FINE",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Project stars, FZJ-IEK3-VSA/FINE",
      "display": "102",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project push date, FZJ-IEK3-VSA/FINE",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F94": {
      "label": "Developer need",
      "display": "Numerical objective functions",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Why choose scipy",
      "display": "passing functions directly to an optimizer",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Developer need in introduction",
      "display": "numerical objective functions",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need",
      "display": "Array-based optimization expressions",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Why choose cvxpy",
      "display": "expressing constrained objectives with arrays",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need in introduction",
      "display": "array-based optimization expressions",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "When to consider pyomo",
      "display": "symbolic nonlinear model structure and solver integration dominate",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "Reusable nonlinear models",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose pyomo",
      "display": "symbolic mixed-integer nonlinear models",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "reusable nonlinear models",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "When to consider scipy",
      "display": "direct numerical objective callbacks are sufficient",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need",
      "display": "Linear and integer model workflows",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Why choose pulp",
      "display": "declaring integer decisions",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need in introduction",
      "display": "linear and integer model workflows",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "When to consider pyomo",
      "display": "the model requires nonlinear expressions",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Page introduction",
      "display": "Python optimization libraries let developers formulate and solve optimization problems.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Which Python optimization library should I choose?",
      "display": "SciPy supplies numerical objective and constraint solvers.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Which Python optimization library should I choose?",
      "display": "CVXPY expresses constrained least-squares objectives with array operations.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Which Python optimization library should I choose?",
      "display": "Pyomo builds symbolic problem instances and uses external solvers.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which Python optimization library should I choose?",
      "display": "PuLP models linear and mixed-integer problems.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Does minimize guarantee the best solution across all minima?",
      "display": "SciPy distinguishes global optimizers from the local minimize routine they can use internally.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Can SciPy solve a mixed-integer linear program?",
      "display": "The optimize API includes mixed-integer linear programming.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Does current CVXPY support nonconvex nonlinear models?",
      "display": "CVXPY supports disciplined nonlinear programs, including the documented nonconvex example.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Does current CVXPY support nonconvex nonlinear models?",
      "display": "Pass nlp=True to use the nonlinear solving mode.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does CVXPY nonlinear mode guarantee an optimal feasible result?",
      "display": "Nonconvex nonlinear solving guarantees neither global nor local optimality and can return an infeasible point.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Does CVXPY nonlinear mode guarantee an optimal feasible result?",
      "display": "The returned result can depend on the supplied initial point.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Can every CVXPY solver handle integer or nonlinear models?",
      "display": "Supported problem classes differ across the solver interfaces.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Can every CVXPY solver handle integer or nonlinear models?",
      "display": "The preferred mixed-integer solvers include both open-source and commercial choices.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Does installing Pyomo install its optimization solver?",
      "display": "Pyomo does not install or bundle third-party solvers automatically.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Does PuLP still bundle CBC?",
      "display": "CBC is not shipped inside the current PuLP package; install its CBC extra or provide a solver separately.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Do older PuLP variable and solve examples match the current API?",
      "display": "The current API creates variables with add_variable and solve returns a statistics object.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Can native PuLP expressions represent nonlinear products?",
      "display": "The native core objective and constraint interfaces accept affine expressions.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Can native PuLP expressions represent nonlinear products?",
      "display": "An affine expression is a sum of constant coefficients times variables plus a constant.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Can Pyomo represent a mixed-integer nonlinear problem?",
      "display": "Mixed-integer nonlinear programming is one of its supported model types.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Can Pyomo represent a mixed-integer nonlinear problem?",
      "display": "A compatible solver must be installed separately.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: What does the model output-format column mean?",
      "display": "PuLP can generate MPS or LP files for solver workflows.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "Library name, scipy",
      "display": "SciPy",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Monthly downloads, scipy",
      "display": "392.1M",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "License, scipy",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Package release, scipy",
      "display": "1.18.1",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Package release date, scipy",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Install, scipy",
      "display": "pip install scipy==1.18.1",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Quickstart, scipy",
      "display": "from scipy.optimize import minimize\nresult = minimize(lambda x: (x[0] - 2.0) ** 2, x0=[0.0])\nprint(result.x)\n",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Repository stars, scipy",
      "display": "15.2K",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Mathematical-programming integer variables, scipy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Arbitrary objective callbacks, scipy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Objective and modeling interface, scipy",
      "display": "Scientific-computing package with scipy.optimize local/global objective callbacks, nonlinear constraints, least squares, linear programming, and mixed-integer linear programming; full SciPy installs include many non-optimization submodules.",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Project function, scipy",
      "display": "def _constrained_optimization(self, obj_func, initial_theta, bounds):\n    if self.optimizer == \"fmin_l_bfgs_b\":\n        opt_res = scipy.optimize.minimize(\n            obj_func,\n            initial_theta,\n            method=\"L-BFGS-B\",\n            jac=True,\n            bounds=bounds,\n        )\n        _check_optimize_result(\"lbfgs\", opt_res)\n        theta_opt, func_min = opt_res.x, opt_res.fun\n    elif callable(self.optimizer):\n        theta_opt, func_min = self.optimizer(obj_func, initial_theta, bounds=bounds)\n    else:\n        raise ValueError(f\"Unknown optimizer {self.optimizer}.\")\n\n    return theta_opt, func_min",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project source file, scipy",
      "display": "sklearn/gaussian_process/_gpr.py",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Project full_name, scipy",
      "display": "scikit-learn/scikit-learn",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project stargazers_count, scipy",
      "display": "68.2K",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Library name, optuna",
      "display": "Optuna",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Monthly downloads, optuna",
      "display": "14.5M",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "License, optuna",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Package release, optuna",
      "display": "5.1.0",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Package release date, optuna",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Install, optuna",
      "display": "pip install optuna==5.1.0",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Quickstart, optuna",
      "display": "import optuna\ndef objective(trial):\n    x = trial.suggest_float(\"x\", -10.0, 10.0)\n    return (x - 2.0) ** 2\nstudy = optuna.create_study()\nstudy.optimize(objective, n_trials=10)\nprint(study.best_params)\n",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Official description, optuna",
      "display": "Optimizes hyperparameters.",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Quickstart source file, optuna",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Repository stars, optuna",
      "display": "15.1K",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Mathematical-programming integer variables, optuna",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Arbitrary objective callbacks, optuna",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Objective and modeling interface, optuna",
      "display": "Black-box objective trial optimization with sampled float/integer/categorical dimensions, studies, pruning, and extensible samplers. Real-valued mathematical objective callbacks qualify; it is not a mixed-integer linear-program modeler merely because trials sample integers.",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Project function, optuna",
      "display": "def objective(trial):\n    iris = sklearn.datasets.load_iris()\n    x, y = iris.data, iris.target\n\n    classifier_name = trial.suggest_categorical(\"classifier\", [\"SVC\", \"RandomForest\"])\n    if classifier_name == \"SVC\":\n        svc_c = trial.suggest_float(\"svc_c\", 1e-10, 1e10, log=True)\n        classifier_obj = sklearn.svm.SVC(C=svc_c, gamma=\"auto\")\n    else:\n        rf_max_depth = trial.suggest_int(\"rf_max_depth\", 2, 32, log=True)\n        classifier_obj = sklearn.ensemble.RandomForestClassifier(\n            max_depth=rf_max_depth, n_estimators=10\n        )\n\n    score = sklearn.model_selection.cross_val_score(classifier_obj, x, y, n_jobs=-1, cv=3)\n    accuracy = score.mean()\n    return accuracy",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project source file, optuna",
      "display": "sklearn/sklearn_simple.py",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project full_name, optuna",
      "display": "optuna/optuna-examples",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project stargazers_count, optuna",
      "display": "870",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Library name, ortools",
      "display": "OR-Tools",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Monthly downloads, ortools",
      "display": "8.4M",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "License, ortools",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Package release, ortools",
      "display": "9.15.6755",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Package release date, ortools",
      "display": "Jan 2026",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Install, ortools",
      "display": "pip install ortools==9.15.6755",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Quickstart, ortools",
      "display": "from ortools.linear_solver import pywraplp\nsolver = pywraplp.Solver.CreateSolver(\"GLOP\")\nx = solver.NumVar(0.0, 3.0, \"x\")\nsolver.Add(x >= 1.0)\nsolver.Minimize(x)\nstatus = solver.Solve()\nif status == pywraplp.Solver.OPTIMAL:\n    print(x.solution_value())\n",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Official description, ortools",
      "display": "Provides the Google OR-Tools Python libraries and modules.",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Quickstart source file, ortools",
      "display": "lp_example",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Repository stars, ortools",
      "display": "14.4K",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Mathematical-programming integer variables, ortools",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Arbitrary objective callbacks, ortools",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Objective and modeling interface, ortools",
      "display": "Optimization toolkit with LP/MIP linear-solver bindings, CP-SAT discrete models, routing, and related combinatorial tools; features depend on the chosen solver/build rather than one universal algorithm.",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Project function, ortools",
      "display": "def build_model(self, divergence, n_nonevent, n_event, trend_change):\n    # Parameters\n    [D, V, pvalue_violation_indices,\n     min_diff_violation_indices] = model_data(\n        divergence, n_nonevent, n_event, self.max_pvalue,\n        self.max_pvalue_policy, self.min_event_rate_diff)\n\n    n = len(n_nonevent)\n    n_records = n_nonevent + n_event\n\n    # Initialize solver\n    if self.mip_solver == \"bop\":\n        solver = pywraplp.Solver(\n            'BinningMIP', pywraplp.Solver.BOP_INTEGER_PROGRAMMING)\n    elif self.mip_solver == \"cbc\":\n        solver = pywraplp.Solver(\n            'BinningMIP', pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING)\n\n    # Decision variables\n    x, y, t, d, u, bin_size_diff = self.decision_variables(solver, n)\n\n    # Objective function\n    if self.gamma:\n        total_records = int(n_records.sum())\n        regularization = self.gamma / total_records\n        pmax = solver.IntVar(0, total_records, \"pmax\")\n        pmin = solver.IntVar(0, total_records, \"pmin\")\n\n        solver.Maximize(solver.Sum([(V[i][i] * x[i, i]) +\n                        solver.Sum([(V[i][j] - V[i][j+1]) * x[i, j]\n                                    for j in range(i)])\n                                    for i in range(n)]) -\n                        regularization * (pmax - pmin))\n    else:\n        solver.Maximize(solver.Sum([(V[i][i] * x[i, i]) +\n                        solver.Sum([(V[i][j] - V[i][j+1]) * x[i, j]\n                                    for j in range(i)])\n                                    for i in range(n)]))\n\n    # Constraint: unique assignment\n    self.add_constraint_unique_assignment(solver, n, x)\n\n    # Constraint: continuity\n    self.add_constraint_continuity(solver, n, x)\n\n    # Constraint: min / max bins\n    self.add_constraint_min_max_bins(solver, n, x, d)\n\n    # Constraint: min / max bin size\n    self.add_constraint_min_max_bin_size(solver, n, x, u, n_records,\n                                         bin_size_diff)\n\n    # Constraint: min / max n_nonevent per bin\n    if (self.min_bin_n_nonevent is not None or\n            self.max_bin_n_nonevent is not None):\n        for i in range(n):\n            bin_ne_size = solver.Sum([n_nonevent[j] * x[i, j]\n                                      for j in range(i + 1)])\n\n            if self.min_bin_n_nonevent is not None:\n                solver.Add(bin_ne_size >= self.min_bin_n_nonevent*x[i, i])\n\n            if self.max_bin_n_nonevent is not None:\n                solver.Add(bin_ne_size <= self.max_bin_n_nonevent*x[i, i])\n\n    # Constraint: min / max n_event per bin\n    if (self.min_bin_n_event is not None or\n            self.max_bin_n_event is not None):\n        for i in range(n):\n            bin_e_size = solver.Sum([n_event[j] * x[i, j]\n                                     for j in range(i + 1)])\n\n            if self.min_bin_n_event is not None:\n                solver.Add(bin_e_size >= self.min_bin_n_event * x[i, i])\n\n            if self.max_bin_n_event is not None:\n                solver.Add(bin_e_size <= self.max_bin_n_event * x[i, i])\n\n    # Constraints: monotonicity\n    if self.monotonic_trend == \"ascending\":\n        self.add_constraint_monotonic_ascending(solver, n, D, x)\n\n    elif self.monotonic_trend == \"descending\":\n        self.add_constraint_monotonic_descending(solver, n, D, x)\n\n    elif self.monotonic_trend == \"concave\":\n        self.add_constraint_monotonic_concave(solver, n, D, x)\n\n    elif self.monotonic_trend == \"convex\":\n        self.add_constraint_monotonic_convex(solver, n, D, x)\n\n    elif self.monotonic_trend in (\"peak\", \"valley\"):\n        for i in range(n):\n            solver.Add(t >= i - n * (1 - y[i]))\n            solver.Add(t <= i + n * y[i])\n\n        if self.monotonic_trend == \"peak\":\n            self.add_constraint_monotonic_peak(solver, n, D, x, y)\n        else:\n            self.add_constraint_monotonic_valley(solver, n, D, x, y)\n\n    elif self.monotonic_trend == \"peak_heuristic\":\n        self.add_constraint_monotonic_peak_heuristic(\n            solver, n, D, x, trend_change)\n\n    elif self.monotonic_trend == \"valley_heuristic\":\n        self.add_constraint_monotonic_valley_heuristic(\n            solver, n, D, x, trend_change)\n\n    # Constraint: reduction of dominating bins\n    if self.gamma:\n        for i in range(n):\n            bin_size = solver.Sum([n_records[j] * x[i, j]\n                                   for j in range(i + 1)])\n\n            solver.Add(pmin <= total_records * (1 - x[i, i]) + bin_size)\n            solver.Add(pmax >= bin_size)\n        solver.Add(pmin <= pmax)\n\n    # Constraint: max-pvalue\n    self.add_constraint_violation(solver, x, pvalue_violation_indices)\n\n    # Constraint: min diff\n    self.add_constraint_violation(solver, x, min_diff_violation_indices)\n\n    # Constraint: fixed splits\n    self.add_constraint_fixed_splits(solver, n, x)\n\n    self.solver_ = solver\n    self._n = n\n    self._x = x",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Project source file, ortools",
      "display": "optbinning/binning/mip.py",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Project full_name, ortools",
      "display": "guillermo-navas-palencia/optbinning",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project stargazers_count, ortools",
      "display": "539",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Library name, highspy",
      "display": "HiGHS",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Monthly downloads, highspy",
      "display": "7.2M",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "License, highspy",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Package release, highspy",
      "display": "1.16.0",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Package release date, highspy",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Install, highspy",
      "display": "pip install highspy==1.16.0",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Quickstart, highspy",
      "display": "import highspy\nsolver = highspy.Highs()\nx = solver.addVariable(lb=0.0, ub=3.0)\nsolver.addConstr(x >= 1.0)\nsolver.minimize(x)\nprint(solver.val(x))\n",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Official description, highspy",
      "display": "Wraps HiGHS in a thin set of pybind11 bindings.",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Quickstart source file, highspy",
      "display": "example-py",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Repository stars, highspy",
      "display": "1.9K",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Mathematical-programming integer variables, highspy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Arbitrary objective callbacks, highspy",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Objective and modeling interface, highspy",
      "display": "Direct HiGHS engine bindings for linear, mixed-integer, and convex quadratic programs, exposing both sparse model objects and a high-level expression interface.",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Project function, highspy",
      "display": "def solve_via_data(\n    self, data, warm_start: bool, verbose: bool, solver_opts, solver_cache=None\n):\n    \"\"\"Returns the result of the call to the solver.\n\n    minimize          cx\n        subject to    A x <=  b\n\n    in HiGHS, the opt problem format is,\n\n    minimize          cx\n        subject to    lboundA <= A x <= uboundA\n\n    Parameters\n    ----------\n    data : dict\n        Data used by the solver.\n    warm_start : bool\n        Whether to warm_start HiGHS.\n    verbose : bool\n        Should the solver print output?\n    solver_opts : dict\n        Additional arguments for the solver.\n\n    Returns\n    -------\n    tuple\n        (status, optimal value, primal, equality dual, inequality dual)\n    \"\"\"\n    import highspy as hp\n\n    # setup problem data\n    inf = hp.Highs().inf\n    dims = dims_to_solver_dict(data[s.DIMS])\n\n    c = data[s.C]\n    # A = sp.vstack([data[s.A], data[s.F]]).tocsc()\n    A = data[s.A].tocsc()\n    data[\"Ax\"] = A\n\n    leq_start = dims[s.EQ_DIM]\n    leq_end = dims[s.EQ_DIM] + dims[s.LEQ_DIM]\n    uboundA = data[s.B]\n    data[\"u\"] = uboundA\n    lboundA = np.concatenate(\n        [data[s.B][:leq_start], -inf * np.ones(data[s.B][leq_start:leq_end].shape)]\n    )\n    data[\"l\"] = lboundA\n\n    # setup highs model\n    model = hp.HighsModel()\n    lp = model.lp_\n    lp.num_col_ = A.shape[1]\n    # assert data['n_var'] == A.shape[1]\n    lp.num_row_ = A.shape[0]\n    # assert data['n_eq'] + data['n_ineq'] == A.shape[0]\n\n    # offset already applied in invert()\n    lp.offset_ = 0\n    lp.col_cost_ = c\n    lp.row_lower_ = lboundA\n    lp.row_upper_ = uboundA\n\n    assert A.format == \"csc\"\n    lp.a_matrix_.format_ = hp.MatrixFormat.kColwise\n    lp.a_matrix_.start_ = A.indptr\n    lp.a_matrix_.index_ = A.indices\n    lp.a_matrix_.value_ = A.data\n\n    # Define Variable bounds\n    lb = data[s.LOWER_BOUNDS]\n    ub = data[s.UPPER_BOUNDS]\n    col_lower = np.full(lp.num_col_, -inf, dtype=c.dtype) if lb is None else lb.copy()\n    col_upper = np.full(lp.num_col_, inf, dtype=c.dtype) if ub is None else ub.copy()\n    # update col_lower and col_upper to account for boolean variables,\n    # also set integrality_ for boolean or integers variables\n    if data[s.BOOL_IDX] or data[s.INT_IDX]:\n        # note that integrality_ can only be assigned a list\n        integrality = [hp.HighsVarType.kContinuous] * lp.num_col_\n        if data[s.BOOL_IDX]:\n            for ind in data[s.BOOL_IDX]:\n                integrality[ind] = hp.HighsVarType.kInteger\n            bool_mask = np.array(data[s.BOOL_IDX], dtype=int)\n            col_lower[bool_mask] = np.maximum(col_lower[bool_mask], 0)\n            col_upper[bool_mask] = np.minimum(col_upper[bool_mask], 1)\n        for ind in data[s.INT_IDX]:\n            integrality[ind] = hp.HighsVarType.kInteger\n        lp.integrality_ = integrality\n    lp.col_lower_ = col_lower\n    lp.col_upper_ = col_upper\n\n    solver = hp.Highs()\n\n    # setup options\n    unpack_highs_options_inplace(solver_opts)\n    write_model_file = solver_opts.pop(\"write_model_file\", None)\n    solver.setOptionValue(\"log_to_console\", verbose)\n    for name, value in solver_opts.items():\n        # note that calling setOptionValue directly on the solver\n        # allows one to pass advanced options that aren't available\n        # on the HighOptions class (e.g., presolve_rule_off)\n        if solver.setOptionValue(name, value) == hp.HighsStatus.kError:\n            raise ValueError(\n                f\"HIGHS returned status kError for option (name, value): ({name}, {value})\"\n            )\n\n    if write_model_file:\n        # TODO: Names can be collected upstream more systematically\n        # (or in the parent class) to be used by all solvers.\n        set_column_names_from_variables(lp, data[s.PARAM_PROB].variables)\n\n    solver.passModel(model)\n\n    if write_model_file:\n        solver.writeModel(write_model_file)\n\n    if warm_start and solver_cache is not None and self.name() in solver_cache:\n        old_solver, old_data, old_result = solver_cache[self.name()]\n        old_status = self.STATUS_MAP.get(old_result[\"model_status\"], s.SOLVER_ERROR)\n        if old_status in s.SOLUTION_PRESENT:\n            solver.setSolution(old_result[\"solution\"])\n\n    # initialize and solve problem\n    try:\n        solver.run()\n        results = {\n            \"solution\": solver.getSolution(),\n            \"basis\": solver.getBasis(),\n            \"info\": solver.getInfo(),\n            \"model_status\": solver.getModelStatus().name,\n            \"run_time\": solver.getRunTime(),\n        }\n        if results[\"model_status\"] == \"kInfeasible\":\n            results[\"dual_ray\"] = solver.getDualRay()\n    except ValueError as e:\n        raise SolverError(e)\n\n    if solver_cache is not None:\n        solver_cache[self.name()] = (solver, data, results)\n\n    return results",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Project source file, highspy",
      "display": "cvxpy/reductions/solvers/conic_solvers/highs_conif.py",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Project full_name, highspy",
      "display": "cvxpy/cvxpy",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Project stargazers_count, highspy",
      "display": "6.4K",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Library name, osqp",
      "display": "OSQP",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Monthly downloads, osqp",
      "display": "6.6M",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "License, osqp",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Package release, osqp",
      "display": "1.1.3",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Package release date, osqp",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Install, osqp",
      "display": "pip install osqp==1.1.3",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Quickstart, osqp",
      "display": "import numpy as np\nfrom scipy import sparse\nimport osqp\nsolver = osqp.OSQP()\nsolver.setup(P=sparse.csc_matrix([[1.0]]), q=np.array([0.0]), A=sparse.csc_matrix([[1.0]]), l=np.array([1.0]), u=np.array([np.inf]), verbose=False)\nprint(solver.solve(raise_error=False).x)\n",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Official description, osqp",
      "display": "Solves quadratic programs with operator splitting.",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Quickstart source file, osqp",
      "display": "python.rst",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Repository stars, osqp",
      "display": "130",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Mathematical-programming integer variables, osqp",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Arbitrary objective callbacks, osqp",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Objective and modeling interface, osqp",
      "display": "Specialized convex quadratic-program solver with sparse matrix inputs, bound-form linear constraints, reusable setup, and numerical-data updates; not a generic Python objective callback engine.",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Project function, osqp",
      "display": "def solve_via_data(self, data, warm_start: bool, verbose: bool, solver_opts,\n                   solver_cache=None):\n    import osqp\n    is_pre_v1 = float(osqp.__version__.split('.')[0]) < 1\n\n    P = data[s.P]\n    q = data[s.Q]\n    A = sp.vstack([data[s.A], data[s.F]]).tocsc()\n    data['Ax'] = A\n    uA = np.concatenate((data[s.B], data[s.G]))\n    data['u'] = uA\n    lA = np.concatenate([data[s.B], -np.inf*np.ones(data[s.G].shape)])\n    data['l'] = lA\n\n    if P is not None:\n        P = sp.csc_matrix((P.data, P.indices, P.indptr), shape=P.shape)\n    if A is not None:\n        A = sp.csc_matrix((A.data, A.indices, A.indptr), shape=A.shape)\n\n    # Overwrite defaults eps_abs=eps_rel=1e-3, max_iter=4000\n    solver_opts['eps_abs'] = solver_opts.get('eps_abs', 1e-5)\n    solver_opts['eps_rel'] = solver_opts.get('eps_rel', 1e-5)\n    solver_opts['max_iter'] = solver_opts.get('max_iter', 10000)\n\n    # Use cached data\n    if warm_start and solver_cache is not None and self.name() in solver_cache:\n        solver, old_data, results = solver_cache[self.name()]\n        new_args = {}\n        for key in ['q', 'l', 'u']:\n            if any(data[key] != old_data[key]):\n                new_args[key] = data[key]\n        factorizing = False\n        if P.data.shape != old_data[s.P].data.shape or any(\n                P.data != old_data[s.P].data):\n            P_triu = sp.csc_array(sp.triu(P, format='csc'))\n            new_args['Px'] = P_triu.data\n            factorizing = True\n        if A.data.shape != old_data['Ax'].data.shape or any(\n                A.data != old_data['Ax'].data):\n            new_args['Ax'] = A.data\n            factorizing = True\n\n        if new_args:\n            solver.update(**new_args)\n        # Map OSQP statuses back to CVXPY statuses\n        status_map = self.STATUS_MAP_PRE_V1 if is_pre_v1 else self.STATUS_MAP\n        status = status_map.get(results.info.status_val, s.SOLVER_ERROR)\n        if status == s.OPTIMAL:\n            solver.warm_start(results.x, results.y)\n        # Polish if factorizing.\n        polish_param = 'polish' if is_pre_v1 else 'polishing'\n        solver_opts[polish_param] = solver_opts.get(polish_param, factorizing)\n        solver.update_settings(verbose=verbose, **solver_opts)\n    else:\n        # Initialize and solve problem\n        polish_param = 'polish' if is_pre_v1 else 'polishing'\n        solver_opts[polish_param] = solver_opts.get(polish_param, True)\n        solver = osqp.OSQP()\n        try:\n            solver.setup(P, q, A, lA, uA, verbose=verbose, **solver_opts)\n        except Exception as e:\n            raise SolverError(e)\n\n    results = solver.solve(raise_error=False)\n\n    if solver_cache is not None:\n        solver_cache[self.name()] = (solver, data, results)\n    return results",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Project source file, osqp",
      "display": "cvxpy/reductions/solvers/qp_solvers/osqp_qpif.py",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Project full_name, osqp",
      "display": "cvxpy/cvxpy",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Project stargazers_count, osqp",
      "display": "6.4K",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Library name, pulp",
      "display": "PuLP",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Monthly downloads, pulp",
      "display": "6.4M",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "License, pulp",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Package release, pulp",
      "display": "4.2.0",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Package release date, pulp",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Install, pulp",
      "display": "pip install \"pulp[cbc]==4.2.0\"",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Quickstart, pulp",
      "display": "from pulp import LpProblem, LpMinimize, COIN_CMD, value\nproblem = LpProblem(\"demo\", LpMinimize)\nx = problem.add_variable(\"x\", 0.0, 3.0)\nproblem += x\nproblem += x >= 1.0\nstats = problem.solve(COIN_CMD(msg=False))\nprint(stats.status_str, value(x))\n",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Repository stars, pulp",
      "display": "2.5K",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Mathematical-programming integer variables, pulp",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Arbitrary objective callbacks, pulp",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Objective and modeling interface, pulp",
      "display": "Linear/mixed-integer modeler with separate backend solver integrations. Selected4.2 uses problem-owned variables and solve stats; CBC is an optional install rather than a bundled executable.",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Project function, pulp",
      "display": "def __contains__(self, x: object) -> bool:\n        try:\n            import pulp\n\n            return pulp.getSolver(x).available()\n        except Exception:  # noqa: BLE001\n            return False",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Project source file, pulp",
      "display": "src/snakemake/scheduling/milp.py",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Project full_name, pulp",
      "display": "snakemake/snakemake",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Project stargazers_count, pulp",
      "display": "2.9K",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Library name, clarabel",
      "display": "Clarabel",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Monthly downloads, clarabel",
      "display": "5.4M",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "License, clarabel",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Package release, clarabel",
      "display": "0.11.1",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Package release date, clarabel",
      "display": "Jun 2025",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Install, clarabel",
      "display": "pip install clarabel==0.11.1",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Quickstart, clarabel",
      "display": "import numpy as np\nfrom scipy import sparse\nimport clarabel\nsettings = clarabel.DefaultSettings()\nsettings.verbose = False\nsolver = clarabel.DefaultSolver(sparse.csc_matrix((1, 1)), np.array([1.0]), sparse.csc_matrix([[-1.0]]), np.array([-1.0]), [clarabel.NonnegativeConeT(1)], settings)\nprint(solver.solve().x)\n",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Official description, clarabel",
      "display": "Solves conic problems with an interior-point method.",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Quickstart source file, clarabel",
      "display": "getting_started_py.md",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Repository stars, clarabel",
      "display": "629",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Mathematical-programming integer variables, clarabel",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Arbitrary objective callbacks, clarabel",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Objective and modeling interface, clarabel",
      "display": "Interior-point solver for convex conic programs with quadratic objectives and supported cone types; native matrix/cone inputs and structural limits differ from general nonlinear callbacks.",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Project function, clarabel",
      "display": "def solve_via_data(self, data, warm_start: bool, verbose: bool, solver_opts, solver_cache=None):\n    \"\"\"Returns the result of the call to the solver.\n\n    Parameters\n    ----------\n    data : dict\n        Data generated via an apply call.\n    warm_start : Bool\n        Whether to warm_start Clarabel.\n    verbose : Bool\n        Control the verbosity.\n    solver_opts : dict\n        Clarabel-specific solver options.\n\n    Returns\n    -------\n    The result returned by a call to clarabel.solve().\n    \"\"\"\n    import clarabel\n\n    A = data[s.A]\n    b = data[s.B]\n    q = data[s.C]\n\n    if s.P in data:\n        P = data[s.P]\n    else:\n        nvars = q.size\n        P = sp.csc_array((nvars, nvars))\n\n    P = sp.triu(P).tocsc()\n\n    cones = dims_to_solver_cones(data[ConicSolver.DIMS])\n\n    def new_solver():\n\n        _settings = self.parse_solver_opts(verbose, solver_opts)\n        _solver = clarabel.DefaultSolver(P, q, A, b, cones, _settings)\n        return _solver\n\n    def updated_solver():\n\n        if (not warm_start) or (solver_cache is None) or (self.name() not in solver_cache):\n            return None\n\n        _solver = solver_cache[self.name()]\n\n        if not hasattr(_solver, \"update\"):\n            return None\n        elif not _solver.is_data_update_allowed():\n            # disallow when presolve or chordal decomposition is used\n            return None\n        else:\n            # current internal settings, to be updated if needed\n            oldsettings = _solver.get_settings()\n            newsettings = self.parse_solver_opts(verbose, solver_opts, oldsettings)\n\n            # this overwrites all data in the solver but will not\n            # reallocate internal memory.  Could be faster if it\n            # were known which terms (or partial terms) have changed.\n            try:\n                _solver.update(P=P, q=q, A=A, b=b, settings=newsettings)\n                return _solver\n            except Exception:\n                # If sparsity pattern or dimensions changed, update() fails.\n                # Return None to trigger a full new_solver() re-initialization.\n                return None\n\n    # Try to get cached data\n    solver = updated_solver()\n\n    if solver is None:\n        solver = new_solver()\n\n    results = solver.solve()\n\n    if solver_cache is not None:\n        solver_cache[self.name()] = solver\n\n    return results",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Project source file, clarabel",
      "display": "cvxpy/reductions/solvers/conic_solvers/clarabel_conif.py",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Project full_name, clarabel",
      "display": "cvxpy/cvxpy",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Project stargazers_count, clarabel",
      "display": "6.4K",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Library name, scs",
      "display": "SCS",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Monthly downloads, scs",
      "display": "5.3M",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "License, scs",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Package release, scs",
      "display": "3.3.2",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Package release date, scs",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Install, scs",
      "display": "pip install scs==3.3.2",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Quickstart, scs",
      "display": "import numpy as np\nfrom scipy import sparse\nimport scs\ndata = {\"A\": sparse.csc_matrix([[-1.0]]), \"b\": np.array([-1.0]), \"c\": np.array([1.0])}\nsolver = scs.SCS(data, {\"l\": 1}, verbose=False)\nprint(solver.solve()[\"x\"])\n",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Official description, scs",
      "display": "Solves conic problems with a splitting method.",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Quickstart source file, scs",
      "display": "python.rst",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Repository stars, scs",
      "display": "48",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Mathematical-programming integer variables, scs",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Arbitrary objective callbacks, scs",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Objective and modeling interface, scs",
      "display": "Splitting conic solver Python binding for continuous convex cone programs with optional quadratic objective. Class/functional APIs expose primal/dual/slack arrays and info diagnostics; backend availability depends on wheel/build.",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Project function, scs",
      "display": "def solve_via_data(self, data, warm_start: bool, verbose: bool, solver_opts, solver_cache=None):\n    \"\"\"Returns the result of the call to the solver.\n\n    Parameters\n    ----------\n    data : dict\n        Data generated via an apply call.\n    warm_start : Bool\n        Whether to warm_start SCS.\n    verbose : Bool\n        Control the verbosity.\n    solver_opts : dict\n        SCS-specific solver options.\n\n    Returns\n    -------\n    The result returned by a call to scs.solve().\n    \"\"\"\n    import scs\n    args = {\"A\": data[s.A], \"b\": data[s.B], \"c\": data[s.C]}\n    if s.P in data:\n        args[\"P\"] = data[s.P]\n    if warm_start and solver_cache is not None and \\\n            self.name() in solver_cache:\n        args[\"x\"] = solver_cache[self.name()][\"x\"]\n        args[\"y\"] = solver_cache[self.name()][\"y\"]\n        args[\"s\"] = solver_cache[self.name()][\"s\"]\n    cones = dims_to_solver_dict(data[ConicSolver.DIMS])\n\n    def solve(_solver_opts):\n        _results = scs.solve(args, cones, verbose=verbose, **_solver_opts)\n        _status = self.STATUS_MAP[_results[\"info\"][\"status_val\"]]\n        return _results, _status\n\n    solver_opts = SCS.parse_solver_options(solver_opts)\n    results, status = solve(solver_opts)\n    if solver_cache is not None and status == s.OPTIMAL:\n        solver_cache[self.name()] = results\n    return results",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Project source file, scs",
      "display": "cvxpy/reductions/solvers/conic_solvers/scs_conif.py",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Project full_name, scs",
      "display": "cvxpy/cvxpy",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Project stargazers_count, scs",
      "display": "6.4K",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python optimization libraries SciPy CVXPY Pyomo PuLP code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
