Line data Source code
1 : // SPDX-FileCopyrightText: 2024 PairInteraction Developers 2 : // SPDX-License-Identifier: LGPL-3.0-or-later 3 : 4 : #include "./Database.py.hpp" 5 : 6 : #include "pairinteraction/database/Database.hpp" 7 : 8 : #include <nanobind/nanobind.h> 9 : #include <nanobind/stl/filesystem.h> 10 : 11 : namespace nb = nanobind; 12 : using namespace nb::literals; 13 : using namespace pairinteraction; 14 : 15 2 : static void declare_database(nb::module_ &m) { 16 2 : nb::class_<Database>(m, "Database") 17 4 : .def(nb::init<>()) 18 2 : .def(nb::init<bool>(), "download_missing"_a) 19 2 : .def(nb::init<std::filesystem::path>(), "database_dir"_a) 20 2 : .def(nb::init<bool, bool, std::filesystem::path>(), "download_missing"_a, "use_cache"_a, 21 4 : "database_dir"_a); 22 2 : } 23 : 24 2 : void bind_database(nb::module_ &m) { declare_database(m); }