Hi,
I found another bug (I suspect). This time when using a Feat with values and unit keywords, when values is a set.
The following Feat results in the exception below:
@feat(values=set((50,60)), units='Hz')
def test(self):
return int(self.query('Ask:test?'))
If I remove the units='Hz' this works fine. This seems to be because a set of pint seems to convert the set not the values within the set. Exception below:
----> 1 p.lfrequency
/home/jschrod/Downloads/Python/Instrumentation/lantz/lantz/feat.py in get(self, instance, owner)
283
284 def get(self, instance, owner=None):
--> 285 return self.get(instance)
286
287 def set(self, instance, value):
/home/jschrod/Downloads/Python/Instrumentation/lantz/lantz/feat.py in get(self, instance, owner, key)
235 except Exception as e:
236 instance.log_error('While post-processing {} for {}: {}', value, name, e)
--> 237 raise e
238
239 instance.log_info('Got {} for {}', value, name, lantz_feat=(name, str(value)))
/home/jschrod/Downloads/Python/Instrumentation/lantz/lantz/feat.py in get(self, instance, owner, key)
232 instance.log_debug('(raw) Got {} for {}', value, name)
233 try:
--> 234 value = self.post_get(value, instance, key)
235 except Exception as e:
236 instance.log_error('While post-processing {} for {}: {}', value, name, e)
/home/jschrod/Downloads/Python/Instrumentation/lantz/lantz/feat.py in post_get(self, value, instance, key)
193 def post_get(self, value, instance=None, key=MISSING):
194 for processor in _dget(self.get_processors, instance, key):
--> 195 value = processor(value)
196 return value
197
/home/jschrod/Downloads/Python/Instrumentation/lantz/lantz/processors.py in _inner(value)
381
382 def _inner(value):
--> 383 if value not in container:
384 raise ValueError('{!r} not in {}'.format(value, container))
385 return value
TypeError: unhashable type: 'Quantity'