Source: tiledb-py Version: 0.19.1-1 Severity: serious Tags: ftbfs Justification: fails to build from source (but built successfully in the past)
https://buildd.debian.org/status/fetch.php?pkg=tiledb-py&arch=amd64&ver=0.19.1-1%2Bb1&stamp=1675121783&raw=0 x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/pybind11/include -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.11 -c tiledb/cc/array.cc -o build/temp.linux-x86_64-cpython-311/tiledb/cc/array.o -fvisibility=hidden -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -std=c++17 -Wno-deprecated-declarations -fvisibility=hidden tiledb/cc/array.cc: In function ‘void libtiledbcpp::init_array(pybind11::module&)’: tiledb/cc/array.cc:149:11: error: no matching function for call to ‘pybind11::class_<tiledb::Array>::def(const char [13], <unresolved overloaded function type>)’ 15 | py::class_<tiledb::Array>(m, "Array") | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | //.def(py::init<py::object, py::object, py::iterable, py::object, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17 | // py::object, py::object>()) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .def( | ~~~~~ 19 | py::init<const Context &, const std::string &, tiledb_query_type_t>(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 | py::keep_alive<1, 2>() /* Array keeps Context alive */) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | // TODO capsule Array(const Context& ctx, tiledb_array_t* carray, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | // tiledb_config_t* config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 | .def("is_open", &Array::is_open) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | .def("uri", &Array::uri) | ~~~~~~~~~~~~~~~~~~~~~~~~ 25 | .def("schema", &Array::schema) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | //.def("ptr", [](Array& arr){ return py::capsule(arr.ptr()); } ) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | // open with encryption key | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | .def("open", | ~~~~~~~~~~~~ 29 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | const std::string &)) & | ~~~~~~~~~~~~~~~~~~~~~~~ 31 | Array::open) | ~~~~~~~~~~~~ 32 | // open with encryption key and timestamp | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 | .def("open", | ~~~~~~~~~~~~ 34 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | const std::string &, uint64_t)) & | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | Array::open) | ~~~~~~~~~~~~ 37 | .def("reopen", &Array::reopen) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | .def("set_open_timestamp_start", &Array::set_open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | .def("set_open_timestamp_end", &Array::set_open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | .def_property_readonly("open_timestamp_start", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 | &Array::open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | .def_property_readonly("open_timestamp_end", &Array::open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | .def("set_config", &Array::set_config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | .def("config", &Array::config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | .def("close", &Array::close) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 47 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 50 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | //(void (Array::*)(const Context&, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | // tiledb_encryption_type_t, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | // Config* const)&Array::consolidate)&Array::consolidate) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | .def("vacuum", &Array::vacuum) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | .def("create", | ~~~~~~~~~~~~~~ 58 | py::overload_cast<const std::string &, const ArraySchema &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | tiledb_encryption_type_t, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | &Array::create)) | ~~~~~~~~~~~~~~~~ 61 | .def("create", | ~~~~~~~~~~~~~~ 62 | py::overload_cast<const std::string &, const ArraySchema &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 | &Array::create)) | ~~~~~~~~~~~~~~~~ 64 | .def("load_schema", | ~~~~~~~~~~~~~~~~~~~ 65 | py::overload_cast<const Context &, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | &Array::load_schema)) | ~~~~~~~~~~~~~~~~~~~~~ 67 | .def("encryption_type", &Array::encryption_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | | 69 | // TODO non_empty_domain | ~~~~~~~~~~~~~~~~~~~~~~~~ 70 | // TODO non_empty_domain_var | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | | 72 | .def("query_type", &Array::query_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | .def("consolidate_metadata", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | Config *const>(&Array::consolidate_metadata)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | .def("put_metadata", | ~~~~~~~~~~~~~~~~~~~~ 78 | [](Array &self, std::string &key, tiledb_datatype_t tdb_type, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | const py::buffer &b) { | ~~~~~~~~~~~~~~~~~~~~~~ 80 | py::buffer_info info = b.request(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 | | 82 | // size_t size = std::reduce(info.shape.begin(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 | // info.shape.end()); | ~~~~~~~~~~~~~~~~~~~~~ 84 | size_t size = 1; | ~~~~~~~~~~~~~~~~ 85 | for (auto s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 | size *= s; | ~~~~~~~~~~ 87 | } | ~ 88 | // size_t nbytes = size * info.itemsize; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 | | 90 | self.put_metadata(key, tdb_type, size, info.ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | /* | ~~ 92 | std::cout << "ndim: " << info.ndim << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | | 94 | | 95 | std::cout << "sz: " << size << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | std::cout << "imsz: " << info.itemsize << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 | | 98 | std::cout << "--|" << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 | for (auto& s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100 | std::cout << s << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | } | ~ 102 | */ | ~~ 103 | }) | ~~ 104 | .def("get_metadata", | ~~~~~~~~~~~~~~~~~~~~ 105 | [](Array &self, std::string &key) -> py::buffer { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 108 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 109 | | 110 | self.get_metadata(key, &tdb_type, &value_num, &data_ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | | 112 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 114 | } | ~ 115 | | 116 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 | return py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 | }) | ~~ 120 | .def("get_metadata_from_index", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | [](Array &self, uint64_t index) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 124 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 125 | std::string key; | ~~~~~~~~~~~~~~~~ 126 | | 127 | self.get_metadata_from_index(index, &key, &tdb_type, &value_num, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 128 | &data_ptr); | ~~~~~~~~~~~ 129 | | 130 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 132 | } | ~ 133 | // TODO handle empty value case | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134 | | 135 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | auto buf = py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 | | 139 | return py::make_tuple(tdb_type, buf); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140 | }) | ~~ 141 | .def("delete_metadata", &Array::delete_metadata) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | .def("has_metadata", | ~~~~~~~~~~~~~~~~~~~~ 143 | [](Array &self, std::string &key) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 144 | tiledb_datatype_t has_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 | bool has_it = self.has_metadata(key, &has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 146 | return py::make_tuple(has_it, has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 147 | }) | ~~ 148 | .def("metadata_num", &Array::metadata_num) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 149 | .def("delete_array", &Array::delete_array); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/lib/python3/dist-packages/pybind11/include/pybind11/numpy.h:12, from tiledb/cc/array.cc:4: /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1567:13: note: candidate: ‘template<class Func, class ... Extra> pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(const char*, Func&&, const Extra& ...) [with Extra = Func; type_ = tiledb::Array; options = {}]’ 1567 | class_ &def(const char *name_, Func &&f, const Extra &...extra) { | ^~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1567:13: note: template argument deduction/substitution failed: tiledb/cc/array.cc:149:11: note: couldn’t deduce template parameter ‘Func’ 15 | py::class_<tiledb::Array>(m, "Array") | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | //.def(py::init<py::object, py::object, py::iterable, py::object, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17 | // py::object, py::object>()) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .def( | ~~~~~ 19 | py::init<const Context &, const std::string &, tiledb_query_type_t>(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 | py::keep_alive<1, 2>() /* Array keeps Context alive */) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | // TODO capsule Array(const Context& ctx, tiledb_array_t* carray, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | // tiledb_config_t* config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 | .def("is_open", &Array::is_open) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | .def("uri", &Array::uri) | ~~~~~~~~~~~~~~~~~~~~~~~~ 25 | .def("schema", &Array::schema) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | //.def("ptr", [](Array& arr){ return py::capsule(arr.ptr()); } ) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | // open with encryption key | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | .def("open", | ~~~~~~~~~~~~ 29 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | const std::string &)) & | ~~~~~~~~~~~~~~~~~~~~~~~ 31 | Array::open) | ~~~~~~~~~~~~ 32 | // open with encryption key and timestamp | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 | .def("open", | ~~~~~~~~~~~~ 34 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | const std::string &, uint64_t)) & | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | Array::open) | ~~~~~~~~~~~~ 37 | .def("reopen", &Array::reopen) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | .def("set_open_timestamp_start", &Array::set_open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | .def("set_open_timestamp_end", &Array::set_open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | .def_property_readonly("open_timestamp_start", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 | &Array::open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | .def_property_readonly("open_timestamp_end", &Array::open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | .def("set_config", &Array::set_config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | .def("config", &Array::config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | .def("close", &Array::close) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 47 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 50 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | //(void (Array::*)(const Context&, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | // tiledb_encryption_type_t, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | // Config* const)&Array::consolidate)&Array::consolidate) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | .def("vacuum", &Array::vacuum) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | .def("create", | ~~~~~~~~~~~~~~ 58 | py::overload_cast<const std::string &, const ArraySchema &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | tiledb_encryption_type_t, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | &Array::create)) | ~~~~~~~~~~~~~~~~ 61 | .def("create", | ~~~~~~~~~~~~~~ 62 | py::overload_cast<const std::string &, const ArraySchema &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 | &Array::create)) | ~~~~~~~~~~~~~~~~ 64 | .def("load_schema", | ~~~~~~~~~~~~~~~~~~~ 65 | py::overload_cast<const Context &, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | &Array::load_schema)) | ~~~~~~~~~~~~~~~~~~~~~ 67 | .def("encryption_type", &Array::encryption_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | | 69 | // TODO non_empty_domain | ~~~~~~~~~~~~~~~~~~~~~~~~ 70 | // TODO non_empty_domain_var | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | | 72 | .def("query_type", &Array::query_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | .def("consolidate_metadata", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | Config *const>(&Array::consolidate_metadata)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | .def("put_metadata", | ~~~~~~~~~~~~~~~~~~~~ 78 | [](Array &self, std::string &key, tiledb_datatype_t tdb_type, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | const py::buffer &b) { | ~~~~~~~~~~~~~~~~~~~~~~ 80 | py::buffer_info info = b.request(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 | | 82 | // size_t size = std::reduce(info.shape.begin(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 | // info.shape.end()); | ~~~~~~~~~~~~~~~~~~~~~ 84 | size_t size = 1; | ~~~~~~~~~~~~~~~~ 85 | for (auto s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 | size *= s; | ~~~~~~~~~~ 87 | } | ~ 88 | // size_t nbytes = size * info.itemsize; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 | | 90 | self.put_metadata(key, tdb_type, size, info.ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | /* | ~~ 92 | std::cout << "ndim: " << info.ndim << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | | 94 | | 95 | std::cout << "sz: " << size << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | std::cout << "imsz: " << info.itemsize << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 | | 98 | std::cout << "--|" << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 | for (auto& s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100 | std::cout << s << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | } | ~ 102 | */ | ~~ 103 | }) | ~~ 104 | .def("get_metadata", | ~~~~~~~~~~~~~~~~~~~~ 105 | [](Array &self, std::string &key) -> py::buffer { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 108 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 109 | | 110 | self.get_metadata(key, &tdb_type, &value_num, &data_ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | | 112 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 114 | } | ~ 115 | | 116 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 | return py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 | }) | ~~ 120 | .def("get_metadata_from_index", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | [](Array &self, uint64_t index) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 124 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 125 | std::string key; | ~~~~~~~~~~~~~~~~ 126 | | 127 | self.get_metadata_from_index(index, &key, &tdb_type, &value_num, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 128 | &data_ptr); | ~~~~~~~~~~~ 129 | | 130 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 132 | } | ~ 133 | // TODO handle empty value case | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134 | | 135 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | auto buf = py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 | | 139 | return py::make_tuple(tdb_type, buf); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140 | }) | ~~ 141 | .def("delete_metadata", &Array::delete_metadata) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | .def("has_metadata", | ~~~~~~~~~~~~~~~~~~~~ 143 | [](Array &self, std::string &key) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 144 | tiledb_datatype_t has_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 | bool has_it = self.has_metadata(key, &has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 146 | return py::make_tuple(has_it, has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 147 | }) | ~~ 148 | .def("metadata_num", &Array::metadata_num) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 149 | .def("delete_array", &Array::delete_array); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1592:13: note: candidate: ‘template<class T, class ... Extra, typename std::enable_if<T::op_enable_if_hook, int>::type <anonymous> > pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(const T&, const Extra& ...) [with Extra = T; typename std::enable_if<T::op_enable_if_hook, int>::type <anonymous> = {Extra ...}; type_ = tiledb::Array; options = {}]’ 1592 | class_ &def(const T &op, const Extra &...extra) { | ^~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1592:13: note: template argument deduction/substitution failed: /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1591:95: error: ‘op_enable_if_hook’ is not a member of ‘char [13]’ 1591 | template <typename T, typename... Extra, detail::enable_if_t<T::op_enable_if_hook, int> = 0> | ^ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1604:13: note: candidate: ‘template<class ... Args, class ... Extra> pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(const pybind11::detail::initimpl::constructor<Args ...>&, const Extra& ...) [with Args = {Args ...}; Extra = {Extra ...}; type_ = tiledb::Array; options = {}]’ 1604 | class_ &def(const detail::initimpl::constructor<Args...> &init, const Extra &...extra) { | ^~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1604:13: note: template argument deduction/substitution failed: tiledb/cc/array.cc:149:11: note: mismatched types ‘const pybind11::detail::initimpl::constructor<Args ...>’ and ‘const char [13]’ 15 | py::class_<tiledb::Array>(m, "Array") | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | //.def(py::init<py::object, py::object, py::iterable, py::object, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17 | // py::object, py::object>()) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .def( | ~~~~~ 19 | py::init<const Context &, const std::string &, tiledb_query_type_t>(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 | py::keep_alive<1, 2>() /* Array keeps Context alive */) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | // TODO capsule Array(const Context& ctx, tiledb_array_t* carray, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | // tiledb_config_t* config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 | .def("is_open", &Array::is_open) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | .def("uri", &Array::uri) | ~~~~~~~~~~~~~~~~~~~~~~~~ 25 | .def("schema", &Array::schema) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | //.def("ptr", [](Array& arr){ return py::capsule(arr.ptr()); } ) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | // open with encryption key | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | .def("open", | ~~~~~~~~~~~~ 29 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | const std::string &)) & | ~~~~~~~~~~~~~~~~~~~~~~~ 31 | Array::open) | ~~~~~~~~~~~~ 32 | // open with encryption key and timestamp | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 | .def("open", | ~~~~~~~~~~~~ 34 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | const std::string &, uint64_t)) & | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | Array::open) | ~~~~~~~~~~~~ 37 | .def("reopen", &Array::reopen) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | .def("set_open_timestamp_start", &Array::set_open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | .def("set_open_timestamp_end", &Array::set_open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | .def_property_readonly("open_timestamp_start", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 | &Array::open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | .def_property_readonly("open_timestamp_end", &Array::open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | .def("set_config", &Array::set_config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | .def("config", &Array::config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | .def("close", &Array::close) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 47 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 50 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | //(void (Array::*)(const Context&, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | // tiledb_encryption_type_t, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | // Config* const)&Array::consolidate)&Array::consolidate) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | .def("vacuum", &Array::vacuum) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | .def("create", | ~~~~~~~~~~~~~~ 58 | py::overload_cast<const std::string &, const ArraySchema &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | tiledb_encryption_type_t, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | &Array::create)) | ~~~~~~~~~~~~~~~~ 61 | .def("create", | ~~~~~~~~~~~~~~ 62 | py::overload_cast<const std::string &, const ArraySchema &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 | &Array::create)) | ~~~~~~~~~~~~~~~~ 64 | .def("load_schema", | ~~~~~~~~~~~~~~~~~~~ 65 | py::overload_cast<const Context &, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | &Array::load_schema)) | ~~~~~~~~~~~~~~~~~~~~~ 67 | .def("encryption_type", &Array::encryption_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | | 69 | // TODO non_empty_domain | ~~~~~~~~~~~~~~~~~~~~~~~~ 70 | // TODO non_empty_domain_var | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | | 72 | .def("query_type", &Array::query_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | .def("consolidate_metadata", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | Config *const>(&Array::consolidate_metadata)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | .def("put_metadata", | ~~~~~~~~~~~~~~~~~~~~ 78 | [](Array &self, std::string &key, tiledb_datatype_t tdb_type, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | const py::buffer &b) { | ~~~~~~~~~~~~~~~~~~~~~~ 80 | py::buffer_info info = b.request(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 | | 82 | // size_t size = std::reduce(info.shape.begin(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 | // info.shape.end()); | ~~~~~~~~~~~~~~~~~~~~~ 84 | size_t size = 1; | ~~~~~~~~~~~~~~~~ 85 | for (auto s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 | size *= s; | ~~~~~~~~~~ 87 | } | ~ 88 | // size_t nbytes = size * info.itemsize; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 | | 90 | self.put_metadata(key, tdb_type, size, info.ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | /* | ~~ 92 | std::cout << "ndim: " << info.ndim << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | | 94 | | 95 | std::cout << "sz: " << size << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | std::cout << "imsz: " << info.itemsize << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 | | 98 | std::cout << "--|" << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 | for (auto& s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100 | std::cout << s << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | } | ~ 102 | */ | ~~ 103 | }) | ~~ 104 | .def("get_metadata", | ~~~~~~~~~~~~~~~~~~~~ 105 | [](Array &self, std::string &key) -> py::buffer { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 108 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 109 | | 110 | self.get_metadata(key, &tdb_type, &value_num, &data_ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | | 112 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 114 | } | ~ 115 | | 116 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 | return py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 | }) | ~~ 120 | .def("get_metadata_from_index", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | [](Array &self, uint64_t index) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 124 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 125 | std::string key; | ~~~~~~~~~~~~~~~~ 126 | | 127 | self.get_metadata_from_index(index, &key, &tdb_type, &value_num, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 128 | &data_ptr); | ~~~~~~~~~~~ 129 | | 130 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 132 | } | ~ 133 | // TODO handle empty value case | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134 | | 135 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | auto buf = py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 | | 139 | return py::make_tuple(tdb_type, buf); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140 | }) | ~~ 141 | .def("delete_metadata", &Array::delete_metadata) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | .def("has_metadata", | ~~~~~~~~~~~~~~~~~~~~ 143 | [](Array &self, std::string &key) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 144 | tiledb_datatype_t has_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 | bool has_it = self.has_metadata(key, &has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 146 | return py::make_tuple(has_it, has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 147 | }) | ~~ 148 | .def("metadata_num", &Array::metadata_num) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 149 | .def("delete_array", &Array::delete_array); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1611:13: note: candidate: ‘template<class ... Args, class ... Extra> pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(const pybind11::detail::initimpl::alias_constructor<Args ...>&, const Extra& ...) [with Args = {Args ...}; Extra = {Extra ...}; type_ = tiledb::Array; options = {}]’ 1611 | class_ &def(const detail::initimpl::alias_constructor<Args...> &init, const Extra &...extra) { | ^~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1611:13: note: template argument deduction/substitution failed: tiledb/cc/array.cc:149:11: note: mismatched types ‘const pybind11::detail::initimpl::alias_constructor<Args ...>’ and ‘const char [13]’ 15 | py::class_<tiledb::Array>(m, "Array") | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | //.def(py::init<py::object, py::object, py::iterable, py::object, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17 | // py::object, py::object>()) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .def( | ~~~~~ 19 | py::init<const Context &, const std::string &, tiledb_query_type_t>(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 | py::keep_alive<1, 2>() /* Array keeps Context alive */) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | // TODO capsule Array(const Context& ctx, tiledb_array_t* carray, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | // tiledb_config_t* config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 | .def("is_open", &Array::is_open) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | .def("uri", &Array::uri) | ~~~~~~~~~~~~~~~~~~~~~~~~ 25 | .def("schema", &Array::schema) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | //.def("ptr", [](Array& arr){ return py::capsule(arr.ptr()); } ) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | // open with encryption key | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | .def("open", | ~~~~~~~~~~~~ 29 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | const std::string &)) & | ~~~~~~~~~~~~~~~~~~~~~~~ 31 | Array::open) | ~~~~~~~~~~~~ 32 | // open with encryption key and timestamp | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 | .def("open", | ~~~~~~~~~~~~ 34 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | const std::string &, uint64_t)) & | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | Array::open) | ~~~~~~~~~~~~ 37 | .def("reopen", &Array::reopen) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | .def("set_open_timestamp_start", &Array::set_open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | .def("set_open_timestamp_end", &Array::set_open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | .def_property_readonly("open_timestamp_start", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 | &Array::open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | .def_property_readonly("open_timestamp_end", &Array::open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | .def("set_config", &Array::set_config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | .def("config", &Array::config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | .def("close", &Array::close) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 47 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 50 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | //(void (Array::*)(const Context&, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | // tiledb_encryption_type_t, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | // Config* const)&Array::consolidate)&Array::consolidate) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | .def("vacuum", &Array::vacuum) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | .def("create", | ~~~~~~~~~~~~~~ 58 | py::overload_cast<const std::string &, const ArraySchema &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | tiledb_encryption_type_t, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | &Array::create)) | ~~~~~~~~~~~~~~~~ 61 | .def("create", | ~~~~~~~~~~~~~~ 62 | py::overload_cast<const std::string &, const ArraySchema &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 | &Array::create)) | ~~~~~~~~~~~~~~~~ 64 | .def("load_schema", | ~~~~~~~~~~~~~~~~~~~ 65 | py::overload_cast<const Context &, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | &Array::load_schema)) | ~~~~~~~~~~~~~~~~~~~~~ 67 | .def("encryption_type", &Array::encryption_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | | 69 | // TODO non_empty_domain | ~~~~~~~~~~~~~~~~~~~~~~~~ 70 | // TODO non_empty_domain_var | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | | 72 | .def("query_type", &Array::query_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | .def("consolidate_metadata", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | Config *const>(&Array::consolidate_metadata)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | .def("put_metadata", | ~~~~~~~~~~~~~~~~~~~~ 78 | [](Array &self, std::string &key, tiledb_datatype_t tdb_type, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | const py::buffer &b) { | ~~~~~~~~~~~~~~~~~~~~~~ 80 | py::buffer_info info = b.request(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 | | 82 | // size_t size = std::reduce(info.shape.begin(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 | // info.shape.end()); | ~~~~~~~~~~~~~~~~~~~~~ 84 | size_t size = 1; | ~~~~~~~~~~~~~~~~ 85 | for (auto s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 | size *= s; | ~~~~~~~~~~ 87 | } | ~ 88 | // size_t nbytes = size * info.itemsize; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 | | 90 | self.put_metadata(key, tdb_type, size, info.ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | /* | ~~ 92 | std::cout << "ndim: " << info.ndim << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | | 94 | | 95 | std::cout << "sz: " << size << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | std::cout << "imsz: " << info.itemsize << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 | | 98 | std::cout << "--|" << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 | for (auto& s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100 | std::cout << s << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | } | ~ 102 | */ | ~~ 103 | }) | ~~ 104 | .def("get_metadata", | ~~~~~~~~~~~~~~~~~~~~ 105 | [](Array &self, std::string &key) -> py::buffer { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 108 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 109 | | 110 | self.get_metadata(key, &tdb_type, &value_num, &data_ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | | 112 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 114 | } | ~ 115 | | 116 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 | return py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 | }) | ~~ 120 | .def("get_metadata_from_index", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | [](Array &self, uint64_t index) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 124 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 125 | std::string key; | ~~~~~~~~~~~~~~~~ 126 | | 127 | self.get_metadata_from_index(index, &key, &tdb_type, &value_num, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 128 | &data_ptr); | ~~~~~~~~~~~ 129 | | 130 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 132 | } | ~ 133 | // TODO handle empty value case | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134 | | 135 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | auto buf = py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 | | 139 | return py::make_tuple(tdb_type, buf); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140 | }) | ~~ 141 | .def("delete_metadata", &Array::delete_metadata) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | .def("has_metadata", | ~~~~~~~~~~~~~~~~~~~~ 143 | [](Array &self, std::string &key) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 144 | tiledb_datatype_t has_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 | bool has_it = self.has_metadata(key, &has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 146 | return py::make_tuple(has_it, has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 147 | }) | ~~ 148 | .def("metadata_num", &Array::metadata_num) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 149 | .def("delete_array", &Array::delete_array); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1618:13: note: candidate: ‘template<class ... Args, class ... Extra> pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(pybind11::detail::initimpl::factory<Args ...>&&, const Extra& ...) [with Args = {Args ...}; Extra = {Extra ...}; type_ = tiledb::Array; options = {}]’ 1618 | class_ &def(detail::initimpl::factory<Args...> &&init, const Extra &...extra) { | ^~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1618:13: note: template argument deduction/substitution failed: tiledb/cc/array.cc:149:11: note: mismatched types ‘pybind11::detail::initimpl::factory<Args ...>’ and ‘const char [13]’ 15 | py::class_<tiledb::Array>(m, "Array") | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | //.def(py::init<py::object, py::object, py::iterable, py::object, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17 | // py::object, py::object>()) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .def( | ~~~~~ 19 | py::init<const Context &, const std::string &, tiledb_query_type_t>(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 | py::keep_alive<1, 2>() /* Array keeps Context alive */) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | // TODO capsule Array(const Context& ctx, tiledb_array_t* carray, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | // tiledb_config_t* config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 | .def("is_open", &Array::is_open) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | .def("uri", &Array::uri) | ~~~~~~~~~~~~~~~~~~~~~~~~ 25 | .def("schema", &Array::schema) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | //.def("ptr", [](Array& arr){ return py::capsule(arr.ptr()); } ) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | // open with encryption key | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | .def("open", | ~~~~~~~~~~~~ 29 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | const std::string &)) & | ~~~~~~~~~~~~~~~~~~~~~~~ 31 | Array::open) | ~~~~~~~~~~~~ 32 | // open with encryption key and timestamp | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 | .def("open", | ~~~~~~~~~~~~ 34 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | const std::string &, uint64_t)) & | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | Array::open) | ~~~~~~~~~~~~ 37 | .def("reopen", &Array::reopen) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | .def("set_open_timestamp_start", &Array::set_open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | .def("set_open_timestamp_end", &Array::set_open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | .def_property_readonly("open_timestamp_start", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 | &Array::open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | .def_property_readonly("open_timestamp_end", &Array::open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | .def("set_config", &Array::set_config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | .def("config", &Array::config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | .def("close", &Array::close) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 47 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 50 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | //(void (Array::*)(const Context&, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | // tiledb_encryption_type_t, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | // Config* const)&Array::consolidate)&Array::consolidate) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | .def("vacuum", &Array::vacuum) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | .def("create", | ~~~~~~~~~~~~~~ 58 | py::overload_cast<const std::string &, const ArraySchema &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | tiledb_encryption_type_t, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | &Array::create)) | ~~~~~~~~~~~~~~~~ 61 | .def("create", | ~~~~~~~~~~~~~~ 62 | py::overload_cast<const std::string &, const ArraySchema &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 | &Array::create)) | ~~~~~~~~~~~~~~~~ 64 | .def("load_schema", | ~~~~~~~~~~~~~~~~~~~ 65 | py::overload_cast<const Context &, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | &Array::load_schema)) | ~~~~~~~~~~~~~~~~~~~~~ 67 | .def("encryption_type", &Array::encryption_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | | 69 | // TODO non_empty_domain | ~~~~~~~~~~~~~~~~~~~~~~~~ 70 | // TODO non_empty_domain_var | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | | 72 | .def("query_type", &Array::query_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | .def("consolidate_metadata", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | Config *const>(&Array::consolidate_metadata)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | .def("put_metadata", | ~~~~~~~~~~~~~~~~~~~~ 78 | [](Array &self, std::string &key, tiledb_datatype_t tdb_type, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | const py::buffer &b) { | ~~~~~~~~~~~~~~~~~~~~~~ 80 | py::buffer_info info = b.request(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 | | 82 | // size_t size = std::reduce(info.shape.begin(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 | // info.shape.end()); | ~~~~~~~~~~~~~~~~~~~~~ 84 | size_t size = 1; | ~~~~~~~~~~~~~~~~ 85 | for (auto s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 | size *= s; | ~~~~~~~~~~ 87 | } | ~ 88 | // size_t nbytes = size * info.itemsize; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 | | 90 | self.put_metadata(key, tdb_type, size, info.ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | /* | ~~ 92 | std::cout << "ndim: " << info.ndim << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | | 94 | | 95 | std::cout << "sz: " << size << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | std::cout << "imsz: " << info.itemsize << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 | | 98 | std::cout << "--|" << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 | for (auto& s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100 | std::cout << s << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | } | ~ 102 | */ | ~~ 103 | }) | ~~ 104 | .def("get_metadata", | ~~~~~~~~~~~~~~~~~~~~ 105 | [](Array &self, std::string &key) -> py::buffer { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 108 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 109 | | 110 | self.get_metadata(key, &tdb_type, &value_num, &data_ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | | 112 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 114 | } | ~ 115 | | 116 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 | return py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 | }) | ~~ 120 | .def("get_metadata_from_index", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | [](Array &self, uint64_t index) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 124 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 125 | std::string key; | ~~~~~~~~~~~~~~~~ 126 | | 127 | self.get_metadata_from_index(index, &key, &tdb_type, &value_num, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 128 | &data_ptr); | ~~~~~~~~~~~ 129 | | 130 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 132 | } | ~ 133 | // TODO handle empty value case | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134 | | 135 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | auto buf = py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 | | 139 | return py::make_tuple(tdb_type, buf); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140 | }) | ~~ 141 | .def("delete_metadata", &Array::delete_metadata) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | .def("has_metadata", | ~~~~~~~~~~~~~~~~~~~~ 143 | [](Array &self, std::string &key) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 144 | tiledb_datatype_t has_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 | bool has_it = self.has_metadata(key, &has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 146 | return py::make_tuple(has_it, has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 147 | }) | ~~ 148 | .def("metadata_num", &Array::metadata_num) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 149 | .def("delete_array", &Array::delete_array); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1624:13: note: candidate: ‘template<class ... Args, class ... Extra> pybind11::class_<type_, options>& pybind11::class_<type_, options>::def(pybind11::detail::initimpl::pickle_factory<Args ...>&&, const Extra& ...) [with Args = {Args ...}; Extra = {Extra ...}; type_ = tiledb::Array; options = {}]’ 1624 | class_ &def(detail::initimpl::pickle_factory<Args...> &&pf, const Extra &...extra) { | ^~~ /usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:1624:13: note: template argument deduction/substitution failed: tiledb/cc/array.cc:149:11: note: mismatched types ‘pybind11::detail::initimpl::pickle_factory<Args ...>’ and ‘const char [13]’ 15 | py::class_<tiledb::Array>(m, "Array") | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 | //.def(py::init<py::object, py::object, py::iterable, py::object, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17 | // py::object, py::object>()) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18 | .def( | ~~~~~ 19 | py::init<const Context &, const std::string &, tiledb_query_type_t>(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 | py::keep_alive<1, 2>() /* Array keeps Context alive */) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | // TODO capsule Array(const Context& ctx, tiledb_array_t* carray, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | // tiledb_config_t* config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 23 | .def("is_open", &Array::is_open) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 24 | .def("uri", &Array::uri) | ~~~~~~~~~~~~~~~~~~~~~~~~ 25 | .def("schema", &Array::schema) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 | //.def("ptr", [](Array& arr){ return py::capsule(arr.ptr()); } ) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 27 | // open with encryption key | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 | .def("open", | ~~~~~~~~~~~~ 29 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | const std::string &)) & | ~~~~~~~~~~~~~~~~~~~~~~~ 31 | Array::open) | ~~~~~~~~~~~~ 32 | // open with encryption key and timestamp | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 | .def("open", | ~~~~~~~~~~~~ 34 | (void (Array::*)(tiledb_query_type_t, tiledb_encryption_type_t, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 | const std::string &, uint64_t)) & | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 36 | Array::open) | ~~~~~~~~~~~~ 37 | .def("reopen", &Array::reopen) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | .def("set_open_timestamp_start", &Array::set_open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | .def("set_open_timestamp_end", &Array::set_open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | .def_property_readonly("open_timestamp_start", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 | &Array::open_timestamp_start) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 42 | .def_property_readonly("open_timestamp_end", &Array::open_timestamp_end) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | .def("set_config", &Array::set_config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | .def("config", &Array::config) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | .def("close", &Array::close) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 47 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | .def("consolidate", | ~~~~~~~~~~~~~~~~~~~ 50 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | Config *const>(&Array::consolidate)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 53 | //(void (Array::*)(const Context&, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | // tiledb_encryption_type_t, const std::string&, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | // Config* const)&Array::consolidate)&Array::consolidate) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | .def("vacuum", &Array::vacuum) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | .def("create", | ~~~~~~~~~~~~~~ 58 | py::overload_cast<const std::string &, const ArraySchema &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | tiledb_encryption_type_t, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | &Array::create)) | ~~~~~~~~~~~~~~~~ 61 | .def("create", | ~~~~~~~~~~~~~~ 62 | py::overload_cast<const std::string &, const ArraySchema &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 | &Array::create)) | ~~~~~~~~~~~~~~~~ 64 | .def("load_schema", | ~~~~~~~~~~~~~~~~~~~ 65 | py::overload_cast<const Context &, const std::string &>( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 | &Array::load_schema)) | ~~~~~~~~~~~~~~~~~~~~~ 67 | .def("encryption_type", &Array::encryption_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | | 69 | // TODO non_empty_domain | ~~~~~~~~~~~~~~~~~~~~~~~~ 70 | // TODO non_empty_domain_var | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | | 72 | .def("query_type", &Array::query_type) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | .def("consolidate_metadata", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | py::overload_cast<const Context &, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | tiledb_encryption_type_t, const std::string &, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | Config *const>(&Array::consolidate_metadata)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | .def("put_metadata", | ~~~~~~~~~~~~~~~~~~~~ 78 | [](Array &self, std::string &key, tiledb_datatype_t tdb_type, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | const py::buffer &b) { | ~~~~~~~~~~~~~~~~~~~~~~ 80 | py::buffer_info info = b.request(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 | | 82 | // size_t size = std::reduce(info.shape.begin(), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 | // info.shape.end()); | ~~~~~~~~~~~~~~~~~~~~~ 84 | size_t size = 1; | ~~~~~~~~~~~~~~~~ 85 | for (auto s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 | size *= s; | ~~~~~~~~~~ 87 | } | ~ 88 | // size_t nbytes = size * info.itemsize; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 | | 90 | self.put_metadata(key, tdb_type, size, info.ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 91 | /* | ~~ 92 | std::cout << "ndim: " << info.ndim << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 | | 94 | | 95 | std::cout << "sz: " << size << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | std::cout << "imsz: " << info.itemsize << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 97 | | 98 | std::cout << "--|" << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 99 | for (auto& s : info.shape) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 100 | std::cout << s << std::endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | } | ~ 102 | */ | ~~ 103 | }) | ~~ 104 | .def("get_metadata", | ~~~~~~~~~~~~~~~~~~~~ 105 | [](Array &self, std::string &key) -> py::buffer { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 106 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 108 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 109 | | 110 | self.get_metadata(key, &tdb_type, &value_num, &data_ptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 | | 112 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 114 | } | ~ 115 | | 116 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 | return py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 | }) | ~~ 120 | .def("get_metadata_from_index", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | [](Array &self, uint64_t index) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | tiledb_datatype_t tdb_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | uint32_t value_num; | ~~~~~~~~~~~~~~~~~~~ 124 | const void *data_ptr; | ~~~~~~~~~~~~~~~~~~~~~ 125 | std::string key; | ~~~~~~~~~~~~~~~~ 126 | | 127 | self.get_metadata_from_index(index, &key, &tdb_type, &value_num, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 128 | &data_ptr); | ~~~~~~~~~~~ 129 | | 130 | if (data_ptr == nullptr && value_num != 1) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 131 | throw py::key_error(); | ~~~~~~~~~~~~~~~~~~~~~~ 132 | } | ~ 133 | // TODO handle empty value case | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134 | | 135 | assert(data_ptr != nullptr); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | auto buf = py::memoryview::from_memory( | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 | data_ptr, value_num * tiledb_datatype_size(tdb_type)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 | | 139 | return py::make_tuple(tdb_type, buf); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140 | }) | ~~ 141 | .def("delete_metadata", &Array::delete_metadata) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 142 | .def("has_metadata", | ~~~~~~~~~~~~~~~~~~~~ 143 | [](Array &self, std::string &key) -> py::tuple { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 144 | tiledb_datatype_t has_type; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 | bool has_it = self.has_metadata(key, &has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 146 | return py::make_tuple(has_it, has_type); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 147 | }) | ~~ 148 | .def("metadata_num", &Array::metadata_num) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 149 | .def("delete_array", &Array::delete_array); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 E: pybuild pybuild:388: build: plugin distutils failed with: exit code=1: /usr/bin/python3 setup.py build dh_auto_build: error: pybuild --build -i python{version} -p 3.11 returned exit code 13 make[1]: *** [debian/rules:21: override_dh_auto_build] Error 25 Cheers -- Sebastian Ramacher