XOP in a loop

Version: 2023b

Type: Bug Fixes

Category: Programming

Subcategory: Python

Jira: ORG-23387

When use Python function to do Linear Fit in a loop, it fails. Create XYY data in active worksheet with random numbers then run below code to see the failure.

import originpro as op
wks_all = op.find_sheet()
for i in range(wks_all.cols):
    if i==0:
    lr = op.LinearFit()
    lr.set_data(wks_all, 0, i)
    rr = lr.result()
    b = rr['Parameters']['Slope']['Value']
    b_err = rr['Parameters']['Slope']['Error']

Fixed in Origin2023b