1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-07 13:40:48 +00:00

instrument: convert channel labels in valid Python identifiers

Channel labels can contain punctuation which is not accepted in
Python identifiers.

Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
This commit is contained in:
Ionela Voinescu 2017-12-08 10:00:05 +00:00 committed by marcbonnici
parent 002939d599
commit 7393ab757e

View File

@ -18,6 +18,7 @@ import logging
import collections
from devlib.utils.types import numeric
from devlib.utils.types import identifier
# Channel modes describe what sort of measurement the instrument supports.
@ -172,7 +173,8 @@ class MeasurementsCsv(object):
if self.channels is None:
self._load_channels()
headings = [chan.label for chan in self.channels]
self.data_tuple = collections.namedtuple('csv_entry', headings)
self.data_tuple = collections.namedtuple('csv_entry',
map(identifier, headings))
def measurements(self):
return list(self.iter_measurements())