Skip to main content

Tiny utilities to summarize CVXPY problems (variables, constraints, DCP/DQCP/DPP, solver stats).

Project description

CVXPY Summary

cvxpy_summary is a lightweight utility package for inspecting and debugging CVXPY optimization models. It provides a compact summary of a cvxpy.Problem, including DCP/DQCP/DPP status, constraint and variable counts (with scalar breakdown), parameter presence, and solver statistics. Optional detailed listings report each variable/parameter’s name, shape, size, and integrality (boolean/integer) flags to quickly diagnose modeling and scalability issues.

An example output is shown below when I am solving a unit commitment problem with CVXPY.

Example output

Install

From PyPI:

pip install cvxpy-summary

Editable from a local checkout:

pip install -e .

Or pin to a GitHub tag/commit:

pip install "git+https://github.com/xuwkk/cvxpy_summary.git@v0.1.2"
# or @<commit-sha>

Usage

import cvxpy as cp
from cvxpy_summary import print_summary

x = cp.Variable(3)
prob = cp.Problem(cp.Minimize(cp.sum_squares(x)), [x >= 0])
print_summary(prob, include_entity_details=True)

The attributes of the print_summary function are:

  • prob: The CVXPY problem to summarize.
  • include_entity_details: If True, include detailed listings of variables and parameters.
  • sort_entities_by: The sorting order for the detailed listings.
  • max_entities: The maximum number of entities to include in the detailed listings.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvxpy_summary-0.1.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cvxpy_summary-0.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file cvxpy_summary-0.1.2.tar.gz.

File metadata

  • Download URL: cvxpy_summary-0.1.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.18

File hashes

Hashes for cvxpy_summary-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9c35f672e78ab54731e116410b28d18b52cba91cf92a4c4cbf858aee58b310ec
MD5 477753fa85be2d228438584938c8156a
BLAKE2b-256 4e6f2baa067cac64cc27f5cbadc3d0cfcb23108eb07319e2c48ae78cc94cc2bb

See more details on using hashes here.

File details

Details for the file cvxpy_summary-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cvxpy_summary-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.18

File hashes

Hashes for cvxpy_summary-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3fd37c60a74e6e21eac07d1447e49e98086f2b01357a35be67fc712108923225
MD5 b56ecaa37bf22ea4df450b4b97540fb0
BLAKE2b-256 ec138abe7817571c98bc509e131e5216623ae3f692935c1e3506e2e7017b148c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page