Skip to content

py::enum_ is deprecated #307

Description

@nsmith-

To expose the parsed TFormula nodes for use in downstream libraries like correctionlib-gradients, we expose py::enum_ types such as

correctionlib/src/python.cc

Lines 141 to 146 in f5c490f

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency fileevaluatorIssues related to the evaluator

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions