LCOV - code coverage report
Current view: top level - bindings/database - Database.py.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 12 12 100.0 %
Date: 2026-01-22 14:02:01 Functions: 2 2 100.0 %

          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           2 :              "database_dir"_a)
      22           2 :         .def("get_download_missing", &Database::get_download_missing)
      23           2 :         .def("get_use_cache", &Database::get_use_cache)
      24           4 :         .def("get_database_dir", &Database::get_database_dir);
      25           2 : }
      26             : 
      27           2 : void bind_database(nb::module_ &m) { declare_database(m); }

Generated by: LCOV version 1.16