LCOV - code coverage report
Current view: top level - bindings - bindings.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 22 22 100.0 %
Date: 2025-06-06 09:03:14 Functions: 2 3 66.7 %

          Line data    Source code
       1             : // SPDX-FileCopyrightText: 2024 Pairinteraction Developers
       2             : // SPDX-License-Identifier: LGPL-3.0-or-later
       3             : 
       4             : #include "./LoggerBridge.hpp"
       5             : #include "./basis/Basis.py.hpp"
       6             : #include "./database/Database.py.hpp"
       7             : #include "./diagonalize/Diagonalizer.py.hpp"
       8             : #include "./enums/FloatType.py.hpp"
       9             : #include "./enums/OperatorType.py.hpp"
      10             : #include "./enums/Parity.py.hpp"
      11             : #include "./enums/TransformationType.py.hpp"
      12             : #include "./interfaces/DiagonalizerInterface.py.hpp"
      13             : #include "./interfaces/TransformationBuilderInterface.py.hpp"
      14             : #include "./ket/Ket.py.hpp"
      15             : #include "./operator/Operator.py.hpp"
      16             : #include "./paths.py.hpp"
      17             : #include "./system/System.py.hpp"
      18             : #include "./tools/run_unit_tests.py.hpp"
      19             : #include "./version.py.hpp"
      20             : 
      21             : #include <nanobind/nanobind.h>
      22             : #include <nanobind/stl/string.h>
      23             : #include <nanobind/stl/vector.h>
      24             : 
      25             : namespace nb = nanobind;
      26             : 
      27           4 : NB_MODULE(_backend, m) // NOLINT
      28             : {
      29             :     // https://nanobind.readthedocs.io/en/latest/faq.html#why-am-i-getting-errors-about-leaked-functions-and-types
      30           1 :     nb::set_leak_warnings(false);
      31             : 
      32             :     // wrap the get_pending_logs method of the logger bridge instance
      33           1 :     static LoggerBridge bridge;
      34           2 :     nb::class_<LoggerBridge::LogEntry>(m, "LogEntry")
      35           1 :         .def_ro("level", &LoggerBridge::LogEntry::level)
      36             :         .def_ro("message", &LoggerBridge::LogEntry::message);
      37           1 :     m.def("get_pending_logs", []() { return bridge.get_pending_logs(); });
      38             : 
      39             :     // enums
      40           1 :     bind_operator_type(m);
      41           1 :     bind_parity(m);
      42           1 :     bind_transformation_type(m);
      43           1 :     bind_float_type(m);
      44             : 
      45             :     // interfaces
      46           1 :     bind_diagonalizer_interface(m);
      47           1 :     bind_transformation_builder_interface(m);
      48             : 
      49             :     // operator
      50           1 :     bind_operator(m);
      51             : 
      52             :     // database
      53           1 :     bind_database(m);
      54             : 
      55             :     // diagonalizer
      56           1 :     bind_diagonalizer(m);
      57             : 
      58             :     // ket
      59           1 :     bind_ket(m);
      60             : 
      61             :     // basis
      62           1 :     bind_basis(m);
      63             : 
      64             :     // system
      65           1 :     bind_system(m);
      66             : 
      67             :     // tools
      68           1 :     bind_run_unit_tests(m);
      69             : 
      70             :     // paths
      71           1 :     bind_paths(m);
      72             : 
      73             :     // version
      74           1 :     bind_version(m);
      75           1 : }

Generated by: LCOV version 1.16