code: def test_formulation_with_continuous_variables():
      model = onnx.load(Path(__file__).parent / "continuous_model.onnx")
  
      m = pe.ConcreteModel()
  
      m.x = pe.Var(range(4), bounds=(-2.0, 2.0))
      m.x[3].setlb(0.0)
      m.x[3].setub(1.0)
  
      m.z = pe.Var()
  
      m.gbt = OmltBlock()
      m.gbt.build_formulation(
          GBTBigMFormulation(GradientBoostedTreeModel(model))
      )
  
      assert (
          len(list(m.gbt.component_data_objects(pe.Var))) == 202 + 10
      )  # our auto-created variables
      assert (
          len(list(m.gbt.component_data_objects(pe.Constraint))) == 423
      )  # TODO: fix?
  
      assert len(m.gbt.z_l) == 160
      assert len(m.gbt.y) == 42
  
      assert len(m.gbt.single_leaf) == 20
      assert len(m.gbt.left_split) == 140
      assert len(m.gbt.right_split) == 140
      assert len(m.gbt.categorical) == 0
      assert len(m.gbt.var_lower) == 42
      assert len(m.gbt.var_upper) == 42
  
file_path: OMLT/tests/gbt/test_gbt_formulation.py
imports: from pathlib import Path
  import pyomo.environ
  import pytest
  from omlt import OmltBlock
  from omlt.dependencies import onnx, onnx_available
  from omlt.gbt.gbt_formulation import GBTBigMFormulation
  from omlt.gbt.model import GradientBoostedTreeModel
label_desc: Use image node_id 1 for calling a global function with example usage: test_formulation_with_continuous_variables() without return types