Standard Deviation Function missing in Ignition V8.1

In one of our projects we're using stdDev function to calculate the standard deviation.Recently We've Upgraded the Ignition version from 7.5 to 8.1.In 8.1version we found the StdDev function is missing form the Math Library. It seems the new function system.math.standardDeviation is used in the latest version is there is any way to use the old function stdDev

Are you talking about an expression or scripting? Can you provide an example of what was previously working but now does not?

7.5 was a while ago. Were you by chance using this?

We're using it in the scripting. Earlier it was working. we're using it in button in a template repeater

Code samples please. Nobody knows what you're talking about, though I suspect @JordanCClark has made a good guess.

1 Like

import math
stdDev(Bag1,Bag2,Bag3,Bag4,Bag5)

we have this script in a button.Earlier it was working now its showing stdDev is not defined. In the ignition user manual we found "system.math.standardDeviation" function .this function is working in the script console but when I put the same in the Button its not working. Note: the button is in the template and we're calling it in a template repeater. Pls help us in this.

Yep. That starting to look more like mine.

If that's the only one you're using out of the extensions, toss this into a project script. Do NOT call it math, as that will override the default library. Example, I have mine in shared.math

def stdDev(*args):
	sumargs=float(0)
	sumsquares=float(0)
	countargs=0
	for i in args:
		sumargs += i
		countargs += 1
	mean=sumargs/countargs
	for i in args:
		sumsquares += (i-mean)**2
	meansquares=sumsquares/countargs
	stdDeviation=meansquares ** (0.5)
	return stdDeviation

Put the fully qualified path to the function.
shared.math.stdDev(Bag1,Bag2,Bag3,Bag4,Bag5)

2 Likes

And before anyone says, 'Jordan, that could be rewritten a bit'... yes. Yes, I know. But, nearly 14 years ago, when I wrote it, I was just starting out on the scripting side of life. It works. :stuck_out_tongue:

3 Likes