Archived
1
0

conditions in name (split by ' at ') are now moved to condition field for individual value page and aggregate data table

This commit is contained in:
Rob tB 2014-05-14 13:44:43 +02:00
parent 7e984b60d8
commit 50c79e3b1f

View File

@ -73,12 +73,21 @@ class NIST(Source):
data = []
for td in tr.xpath('td'):
data.append(''.join(td.xpath('node()').extract()))
name = symbol_table[data[0]]
condition = ''
m = re.match(r'(.*) at (.*)', name)
if m:
name = m.group(1)
condition = m.group(2)
result = Result({
'attribute': symbol_table[data[0]],
'attribute': name,
'value': data[1] + ' ' + data[2],
'source': 'NIST',
'reliability': 'Unknown',
'conditions': ''
'conditions': condition
})
log.msg('NIST: |%s|' % data, level=log.DEBUG)
results.append(result)
@ -158,6 +167,12 @@ class NIST(Source):
results = []
name = table.xpath('@summary').extract()[0]
condition = ''
m = re.match(r'(.*) at (.*)', name)
if m:
name = m.group(1)
condition = m.group(2)
tr_unit = ''.join(table.xpath('tr[1]/th[1]/node()').extract())
m = re.search(r'\((.*)\)', tr_unit)
unit = '!'
@ -176,7 +191,7 @@ class NIST(Source):
'value': '%s %s%s' % (tds[0], uncertainty, unit),
'source': 'NIST',
'reliability': 'Unknown',
'conditions': ''
'conditions': condition
})
results.append(result)