Skip to content

cvxpy/constraint-unit-mismatch

Pack Severity Fix Versions
CVXPY warning none, edit by hand All versions

Compare quantities expressed in the same units. This rule recognizes literal CVXPY variable and parameter names ending in explicit tags such as [USD], [EUR], [fraction] and [percent]. It reports direct comparisons between differently tagged leaves in a known problem's constraints. Arithmetic conversions and unrecognized tags are outside its scope.

Convert both sides of the CVXPY constraint to the same units before comparing them.

See all rules in the CVXPY pack.