Commit 1093439e authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Handles case when reading is empty for sp property

Showing with 1 addition and 1 deletion
+1 -1
......@@ -118,7 +118,7 @@ class OhmPiHardware:
@property
def sp(self):
if len(self.readings[self.readings[:,2]==1, :]) < 1 or len(self.readings[self.readings[:,2]==-1, :]) < 1:
if self.readings.shape == (0,) or len(self.readings[self.readings[:,2]==1, :]) < 1 or len(self.readings[self.readings[:,2]==-1, :]) < 1:
self.exec_logger.warning('Unable to compute sp: readings should at least contain one positive and one negative pulse')
return 0.
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment