Coverage for backend/idaes_service/solver/custom/custom_variable.py: 87%
15 statements
« prev ^ index » next coverage.py v7.10.7, created at 2025-11-06 23:27 +0000
« prev ^ index » next coverage.py v7.10.7, created at 2025-11-06 23:27 +0000
1from idaes.models.control.controller import PIDControllerData, ControllerType, ControllerMVBoundType, ControllerAntiwindupType, smooth_bound, smooth_heaviside
2from pyomo.environ import Var
3from idaes.core import UnitModelBlockData, declare_process_block_class
4from pyomo.common.config import ConfigValue, In, Bool
5import pyomo.environ as pyo
6from idaes.core.util.exceptions import ConfigurationError
7import pyomo.dae as pyodae
8from idaes.core.util import scaling as iscale
9import functools
12@declare_process_block_class(
13 "CustomVariable",
14 doc="Custom variable model block. You can finally be free!",
15)
16class CustomVariableData(UnitModelBlockData):
18 CONFIG = UnitModelBlockData.CONFIG()
20 def build(self):
21 """
22 Build the custom variable block
23 """
24 super().build()
25 self.variable = Var(
26 self.flowsheet().time,
27 initialize=0.0,
28 doc="A variable you are free to do whatever you want with",
29 )