dhhagan / py-opc

Python wrapper for the Alphasense OPC-N2 built around py-spidev
MIT License
30 stars 26 forks source link

TypeError: unorderable types:dict()<int() #80

Closed FlorentinBulotAQ closed 5 years ago

FlorentinBulotAQ commented 5 years ago

Hi,

I am getting this issue from time to time (I usually get it when I power the sensor for the first time):

  File "/home/pi/AQ/Code/classes/OPC.py", line 143, in read
    hist=self.alpha.histogram(number_concentration=False)
  File "/home/pi/.local/lib/python3.5/site-packages/opc/__init__.py", line 545, in histogram
    data['Sampling Period'] = self._calculate_period(resp[44:48])
  File "/home/pi/.local/lib/python3.5/site-packages/opc/__init__.py", line 176, in _calculate_period
    if self.firmware < 16:
TypeError: unorderable types: dict() < int()

I think that this change should fix it.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 15.982% when pulling ce2b278b69ed4bfacf15c394f3d45132a431499b on FlorentinBulotUoS:patch-1 into cd50f84bab4fcda264797d41d81bfa63905556e3 on dhhagan:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 15.982% when pulling ce2b278b69ed4bfacf15c394f3d45132a431499b on FlorentinBulotUoS:patch-1 into cd50f84bab4fcda264797d41d81bfa63905556e3 on dhhagan:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 15.982% when pulling ce2b278b69ed4bfacf15c394f3d45132a431499b on FlorentinBulotUoS:patch-1 into cd50f84bab4fcda264797d41d81bfa63905556e3 on dhhagan:master.