@@ -458,25 +458,23 @@ void init_Attributable(py::module &m)
458458 // double, 7 > >)
459459
460460 // C++ pass-through API: Getter
461- .def (
462- " get_attribute" ,
463- [](Attributable &attr, std::string const &key) {
464- auto v = attr.getAttribute (key);
465- return v.getResource ();
466- // TODO instead of returning lists, return all arrays (ndim > 0)
467- // as numpy arrays?
468- })
469- .def_property_readonly (
470- " attribute_dtypes" ,
471- [](Attributable const &attributable) {
472- std::map<std::string, pybind11::dtype> dtypes;
473- for (auto const &attr : attributable.attributes ())
474- {
475- dtypes[attr] =
476- dtype_to_numpy (attributable.getAttribute (attr).dtype );
477- }
478- return dtypes;
479- })
461+ .def (" get_attribute" , []( Attributable & attr, std::string const & key ) {
462+ auto v = attr.getAttribute (key);
463+ std::cout << " Attribute '" << key << " ' has type: " << v.dtype
464+ << std::endl
465+ << " and value: " << std::to_string (v) << std::endl;
466+ return v.getResource ();
467+ // TODO instead of returning lists, return all arrays (ndim > 0) as numpy arrays?
468+ })
469+ .def_property_readonly (" attribute_dtypes" , []( Attributable const & attributable ) {
470+ std::map< std::string, pybind11::dtype > dtypes;
471+ for ( auto const & attr : attributable.attributes () )
472+ {
473+ dtypes[ attr ] =
474+ dtype_to_numpy ( attributable.getAttribute ( attr ).dtype );
475+ }
476+ return dtypes;
477+ })
480478 .def (" delete_attribute" , &Attributable::deleteAttribute)
481479 .def (" contains_attribute" , &Attributable::containsAttribute)
482480
0 commit comments