more tests

This commit is contained in:
Erik Frojdh
2019-09-20 10:46:28 +02:00
parent 27d223d199
commit af9c67539f
6 changed files with 251 additions and 23 deletions

View File

@ -2,7 +2,16 @@
Utility functions that are useful for testing and troubleshooting
but not directly used in controlling the detector
"""
from collections import namedtuple
import _sls_detector #C++ lib
Geometry = namedtuple('Geometry', ['x', 'y'])
def to_geo(value):
if isinstance(value, _sls_detector.xy):
return Geometry(x = value.x, y = value.y)
else:
raise ValueError("Can only convert sls_detector.xy")
def all_equal(mylist):
"""If all elements are equal return true otherwise false"""