14#include "PyIndexedAttribute.h"
16#include <lagrange/IndexedAttribute.h>
19#include <lagrange/utils/warnoff.h>
20#include <nanobind/nanobind.h>
21#include <lagrange/utils/warnon.h>
24namespace lagrange::python {
26void bind_indexed_attribute(nanobind::module_& m)
28 namespace nb = nanobind;
29 using namespace nb::literals;
31 auto indexed_attr_class =
32 nb::class_<PyIndexedAttribute>(m,
"IndexedAttribute",
"Index attribute");
34 indexed_attr_class.def_prop_ro(
"element_type", [](PyIndexedAttribute& self) {
35 return self->get_element_type();
37 indexed_attr_class.def_prop_ro(
"usage", [](PyIndexedAttribute& self) {
38 return self->get_usage();
40 indexed_attr_class.def_prop_ro(
"num_channels", [](PyIndexedAttribute& self) {
41 return self->get_num_channels();
44 indexed_attr_class.def_prop_ro(
"values", &PyIndexedAttribute::values);
45 indexed_attr_class.def_prop_ro(
"indices", &PyIndexedAttribute::indices);