I encountered a couple errors in the ParametricSummarizer. I've traced it down to the xrange and iteritems methods/functions that is not supported in PythonV3.
Another error was in the SummaryStatistics class, where it throws an error if count is not divisible by two. I've also managed to fixed that using numpy to calculate the statistics instead.
Traceback (most recent call last):
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 190, in parse
self.parse_records(count)
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 165, in parse_records
self.send((recType, fields))
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\Pipeline.py", line 25, in new_fn
action(ds, *args)
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 54, in before_send
self.onMpr(row)
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 63, in onMpr
for i in xrange(row[mpr.RSLT_CNT]):
NameError: name 'xrange' is not defined
#Original code change to range for PythonV3 xdonu2x 8Nov2023
# for i in xrange(row[mpr.RSLT_CNT]):
for i in range(row[mpr.RSLT_CNT]):
values = self.rawMap.setdefault((row[ptr.SITE_NUM],row[ptr.TEST_NUM],i), [])
values.append(row[mpr.RTN_RSLT][i])
Traceback (most recent call last):
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 191, in parse
self.complete()
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\Pipeline.py", line 25, in new_fn
action(ds, *args)
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 43, in before_complete
for key, values in self.rawMap.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
# change .iteritems to .items for PyhonV3 xdonu2x 8Nov2023
# for key, values in self.rawMap.iteritems():
for key, values in self.rawMap.items():
def getAllRows(self):
# change .iteritems to .items for PyhonV3 Ejo 8Nov2023
#return self.summaryMap.iteritems()
return self.summaryMap.items()
Traceback (most recent call last):
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 191, in parse
self.complete()
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\Pipeline.py", line 25, in new_fn
action(ds, *args)
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 46, in before_complete
self.summaryMap[key] = SummaryStatistics(values)
File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\SummaryStatistics.py", line 29, in init
self.median = self.q2 = self.values[self.count / 2]
TypeError: list indices must be integers or slices, not float
Hi,
I encountered a couple errors in the ParametricSummarizer. I've traced it down to the xrange and iteritems methods/functions that is not supported in PythonV3.
Another error was in the SummaryStatistics class, where it throws an error if count is not divisible by two. I've also managed to fixed that using numpy to calculate the statistics instead.
Traceback (most recent call last): File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 190, in parse self.parse_records(count) File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 165, in parse_records self.send((recType, fields)) File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\Pipeline.py", line 25, in new_fn action(ds, *args) File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 54, in before_send self.onMpr(row) File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 63, in onMpr for i in xrange(row[mpr.RSLT_CNT]): NameError: name 'xrange' is not defined
Traceback (most recent call last): File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 191, in parse self.complete() File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\Pipeline.py", line 25, in new_fn action(ds, *args) File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 43, in before_complete for key, values in self.rawMap.iteritems(): AttributeError: 'dict' object has no attribute 'iteritems'
Traceback (most recent call last): File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\IO.py", line 191, in parse self.complete() File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\Pipeline.py", line 25, in new_fn action(ds, *args) File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\ParametricSummarizer.py", line 46, in before_complete self.summaryMap[key] = SummaryStatistics(values) File "C:\Users\xdonu2x\PycharmProjects\usingpySTDF\venv\lib\site-packages\pystdf\SummaryStatistics.py", line 29, in init self.median = self.q2 = self.values[self.count / 2] TypeError: list indices must be integers or slices, not float