To expose the parsed TFormula nodes for use in downstream libraries like correctionlib-gradients, we expose py::enum_ types such as
|
py::enum_<FormulaAst::NodeType>(formula_ast, "NodeType") |
|
.value("LITERAL", FormulaAst::NodeType::Literal) |
|
.value("VARIABLE", FormulaAst::NodeType::Variable) |
|
.value("PARAMETER", FormulaAst::NodeType::Parameter) |
|
.value("UNARY", FormulaAst::NodeType::Unary) |
|
.value("BINARY", FormulaAst::NodeType::Binary); |
As of pybind11 v3, these are deprecated in favor of
py::native_enum
See
https://pybind11.readthedocs.io/en/stable/classes.html#enumerations-and-internal-types for details.
To expose the parsed
TFormulanodes for use in downstream libraries like correctionlib-gradients, we exposepy::enum_types such ascorrectionlib/src/python.cc
Lines 141 to 146 in f5c490f
As of pybind11 v3, these are deprecated in favor of
py::native_enumSee https://pybind11.readthedocs.io/en/stable/classes.html#enumerations-and-internal-types for details.