mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +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:
@ -79,7 +79,7 @@ def element_if_equal(mylist):
|
||||
|
||||
def reduce_time(mylist):
|
||||
res = element_if_equal(element_if_equal(mylist))
|
||||
if isinstance(res, dt.timedelta):
|
||||
if isinstance(res, (dt.timedelta, _slsdet.DurationWrapper)):
|
||||
return res.total_seconds()
|
||||
elif isinstance(res[0], list):
|
||||
return [[item.total_seconds() for item in subl] for subl in res]
|
||||
|
Reference in New Issue
Block a user