mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
Nanosecond times in Python (#522)
* initital implementation * datetime replaces with sls::Duration in Python C bindings * using custom type caster * fix for conversion to seconds * added set_count in python * common header for pybind11 includes authored-by: Erik Frojdh <erik.frojdh@psi.ch>
This commit is contained in:
@ -1,9 +1,6 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include <pybind11/chrono.h>
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include "py_headers.h"
|
||||
|
||||
#include "mythenFileIO.h"
|
||||
#include "sls/Detector.h"
|
||||
@ -11,8 +8,6 @@
|
||||
#include <chrono>
|
||||
#include <vector>
|
||||
|
||||
#include "typecaster.h"
|
||||
|
||||
using ds = std::chrono::duration<double>;
|
||||
|
||||
namespace py = pybind11;
|
||||
@ -23,6 +18,7 @@ void init_network(py::module &);
|
||||
void init_pattern(py::module &);
|
||||
void init_scan(py::module &);
|
||||
void init_source(py::module &);
|
||||
void init_duration(py::module &);
|
||||
PYBIND11_MODULE(_slsdet, m) {
|
||||
m.doc() = R"pbdoc(
|
||||
C/C++ API
|
||||
@ -40,6 +36,7 @@ PYBIND11_MODULE(_slsdet, m) {
|
||||
init_pattern(m);
|
||||
init_scan(m);
|
||||
init_source(m);
|
||||
init_duration(m);
|
||||
// init_experimental(m);
|
||||
|
||||
py::module io = m.def_submodule("io", "Submodule for io");
|
||||
|
Reference in New Issue
Block a user