mirror of
https://github.com/ARM-software/devlib.git
synced 2025-04-17 07:10:03 +01: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:
parent
002939d599
commit
7393ab757e
@ -18,6 +18,7 @@ import logging
|
|||||||
import collections
|
import collections
|
||||||
|
|
||||||
from devlib.utils.types import numeric
|
from devlib.utils.types import numeric
|
||||||
|
from devlib.utils.types import identifier
|
||||||
|
|
||||||
|
|
||||||
# Channel modes describe what sort of measurement the instrument supports.
|
# Channel modes describe what sort of measurement the instrument supports.
|
||||||
@ -172,7 +173,8 @@ class MeasurementsCsv(object):
|
|||||||
if self.channels is None:
|
if self.channels is None:
|
||||||
self._load_channels()
|
self._load_channels()
|
||||||
headings = [chan.label for chan in self.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):
|
def measurements(self):
|
||||||
return list(self.iter_measurements())
|
return list(self.iter_measurements())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user