LCOV - code coverage report
Current view: top level - python - scipp.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 37 37 100.0 %
Date: 2024-04-28 01:25:40 Functions: 3 3 100.0 %

          Line data    Source code
       1             : // SPDX-License-Identifier: BSD-3-Clause
       2             : // Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
       3             : /// @file
       4             : /// @author Simon Heybrock
       5             : #include "pybind11.h"
       6             : 
       7             : namespace py = pybind11;
       8             : 
       9             : void init_buckets(py::module &);
      10             : void init_comparison(py::module &);
      11             : void init_counts(py::module &);
      12             : void init_creation(py::module &);
      13             : void init_cumulative(py::module &);
      14             : void init_dataset(py::module &);
      15             : void init_dtype(py::module &);
      16             : void init_element_array_view(py::module &);
      17             : void init_exceptions(py::module &);
      18             : void init_groupby(py::module &);
      19             : void init_geometry(py::module &);
      20             : void init_histogram(py::module &);
      21             : void init_operations(py::module &);
      22             : void init_shape(py::module &);
      23             : void init_trigonometry(py::module &);
      24             : void init_unary(py::module &);
      25             : void init_units(py::module &);
      26             : void init_variable(py::module &);
      27             : void init_transform(py::module &);
      28             : 
      29             : void init_generated_arithmetic(py::module &);
      30             : void init_generated_bins(py::module &);
      31             : void init_generated_comparison(py::module &);
      32             : void init_generated_hyperbolic(py::module &);
      33             : void init_generated_logical(py::module &);
      34             : void init_generated_math(py::module &);
      35             : void init_generated_reduction(py::module &);
      36             : void init_generated_trigonometry(py::module &);
      37             : void init_generated_util(py::module &);
      38             : void init_generated_special_values(py::module &);
      39             : 
      40           3 : void init_core(py::module &m) {
      41           3 :   auto core = m.def_submodule("core");
      42             :   // Bind classes before any functions that use them to make sure that
      43             :   // pybind11 puts proper type annotations into the docstrings.
      44           3 :   init_units(core);
      45           3 :   init_exceptions(core);
      46           3 :   init_dtype(core);
      47           3 :   init_variable(core);
      48           3 :   init_dataset(core);
      49             : 
      50           3 :   init_counts(core);
      51           3 :   init_creation(core);
      52           3 :   init_cumulative(core);
      53           3 :   init_buckets(core);
      54           3 :   init_groupby(core);
      55           3 :   init_comparison(core);
      56           3 :   init_operations(core);
      57           3 :   init_shape(core);
      58           3 :   init_geometry(core);
      59           3 :   init_histogram(core);
      60           3 :   init_trigonometry(core);
      61           3 :   init_unary(core);
      62           3 :   init_element_array_view(core);
      63           3 :   init_transform(core);
      64             : 
      65           3 :   init_generated_arithmetic(core);
      66           3 :   init_generated_bins(core);
      67           3 :   init_generated_comparison(core);
      68           3 :   init_generated_hyperbolic(core);
      69           3 :   init_generated_logical(core);
      70           3 :   init_generated_math(core);
      71           3 :   init_generated_reduction(core);
      72           3 :   init_generated_trigonometry(core);
      73           3 :   init_generated_util(core);
      74           3 :   init_generated_special_values(core);
      75           3 : }
      76             : 
      77           6 : PYBIND11_MODULE(_scipp, m) {
      78             : #ifdef SCIPP_VERSION
      79           3 :   m.attr("__version__") = py::str(SCIPP_VERSION);
      80             : #else
      81             :   m.attr("__version__") = py::str("unknown version");
      82             : #endif
      83             : #ifdef NDEBUG
      84             :   m.attr("_debug_") = py::cast(false);
      85             : #else
      86           3 :   m.attr("_debug_") = py::cast(true);
      87             : #endif
      88           3 :   init_core(m);
      89           3 : }

Generated by: LCOV version 1.14