单位不一致错误

(类来自 pyomo.core.base.units_container)

class pyomo.core.base.units_container.InconsistentUnitsError(exp1, exp2, msg)[source]

基础:UnitsError

一个异常,表示表达式中存在不一致的单位。

例如,x == y,其中x的单位是千克,y的单位是米

__init__(exp1, exp2, msg)[source]

成员文档

add_note()

Exception.add_note(note) – 向异常添加一个注释

with_traceback()

Exception.with_traceback(tb) – 将 self.__traceback__ 设置为 tb 并返回 self。