mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-12-14 08:41:17 +01: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,17 +1,13 @@
|
||||
// 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 "sls/Detector.h"
|
||||
#include "sls/ToString.h"
|
||||
#include "sls/network_utils.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#include "typecaster.h"
|
||||
|
||||
#include "sls/TimeHelper.h"
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
namespace py = pybind11;
|
||||
@@ -23,7 +19,7 @@ void init_det(py::module &m) {
|
||||
using sls::Result;
|
||||
|
||||
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
|
||||
CppDetectorApi.def(py::init<int>())
|
||||
CppDetectorApi.def(py::init<int>());
|
||||
|
||||
[[FUNCTIONS]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user