LCOV - code coverage report
Current view: top level - bindings - bindings.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 23 23 100.0 %
Date: 2025-04-29 15:56:08 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 "./Info.py.hpp"
       5             : #include "./LoggerBridge.hpp"
       6             : #include "./basis/Basis.py.hpp"
       7             : #include "./database/Database.py.hpp"
       8             : #include "./diagonalize/Diagonalizer.py.hpp"
       9             : #include "./enums/FloatType.py.hpp"
      10             : #include "./enums/OperatorType.py.hpp"
      11             : #include "./enums/Parity.py.hpp"
      12             : #include "./enums/TransformationType.py.hpp"
      13             : #include "./interfaces/DiagonalizerInterface.py.hpp"
      14             : #include "./interfaces/TransformationBuilderInterface.py.hpp"
      15             : #include "./ket/Ket.py.hpp"
      16             : #include "./operator/Operator.py.hpp"
      17             : #include "./paths.py.hpp"
      18             : #include "./system/System.py.hpp"
      19             : #include "./tools/run_unit_tests.py.hpp"
      20             : #include "./version.py.hpp"
      21             : 
      22             : #include <nanobind/nanobind.h>
      23             : #include <nanobind/stl/string.h>
      24             : #include <nanobind/stl/vector.h>
      25             : 
      26             : namespace nb = nanobind;
      27             : 
      28           4 : NB_MODULE(_backend, m) // NOLINT
      29             : {
      30             :     // https://nanobind.readthedocs.io/en/latest/faq.html#why-am-i-getting-errors-about-leaked-functions-and-types
      31           1 :     nanobind::set_leak_warnings(false);
      32             : 
      33             :     // wrap the get_pending_logs method of the logger bridge instance
      34           1 :     static LoggerBridge bridge;
      35           2 :     nb::class_<LoggerBridge::LogEntry>(m, "LogEntry")
      36           1 :         .def_ro("level", &LoggerBridge::LogEntry::level)
      37             :         .def_ro("message", &LoggerBridge::LogEntry::message);
      38           1 :     m.def("get_pending_logs", []() { return bridge.get_pending_logs(); });
      39             : 
      40             :     // enums
      41           1 :     bind_operator_type(m);
      42           1 :     bind_parity(m);
      43           1 :     bind_transformation_type(m);
      44           1 :     bind_float_type(m);
      45             : 
      46             :     // interfaces
      47           1 :     bind_diagonalizer_interface(m);
      48           1 :     bind_transformation_builder_interface(m);
      49             : 
      50             :     // operator
      51           1 :     bind_operator(m);
      52             : 
      53             :     // database
      54           1 :     bind_database(m);
      55             : 
      56             :     // diagonalizer
      57           1 :     bind_diagonalizer(m);
      58             : 
      59             :     // ket
      60           1 :     bind_ket(m);
      61             : 
      62             :     // basis
      63           1 :     bind_basis(m);
      64             : 
      65             :     // system
      66           1 :     bind_system(m);
      67             : 
      68             :     // tools
      69           1 :     bind_run_unit_tests(m);
      70             : 
      71             :     // paths
      72           1 :     bind_paths(m);
      73             : 
      74             :     // version
      75           1 :     bind_version(m);
      76             : 
      77             :     // info
      78           1 :     bind_info(m);
      79           1 : }

Generated by: LCOV version 1.16