python suggested "is not" instead of "!="

This commit is contained in:
2026-03-12 22:38:38 +00:00
parent b4c9a4a191
commit f836a53829

View File

@@ -105,18 +105,14 @@ elif args.mode == "SIM":
samplesize = args.samplesize
df = samplesize - 1
prob = 0
if args.upperbound != None and args.lowerbound != None:
prob_upper = 1
prob_lower = 0
if args.upperbound is not None:
prob_upper = t.cdf(df=df,x=args.upperbound, loc=mean, scale=stddev)
if args.lowerbound is not None:
prob_lower = t.cdf(df=df,x=args.lowerbound, loc=mean, scale=stddev)
prob = prob_upper - prob_lower
elif args.upperbound != None:
prob = t.cdf(df=df,x=args.upperbound, loc=mean, scale=stddev)
elif args.lowerbound != None:
prob = 1 - t.cdf(df=df,x=args.lowerbound, loc=mean, scale=stddev)
else:
prob = 1# no bounds set!
prob = prob_upper - prob_lower
#print("probability: %f", prob)
info = -np.emath.log2(prob)
#print("information content: %f bits", info)
@@ -148,9 +144,9 @@ y = norm.pdf(x, loc=mean, scale=stddev)
if args.normalizey:
y = y * stddev#rescale back to unity area
plt.axvline(x=mean, color="green", linestyle="dashed", label="mean")
if args.lowerbound != None:
if args.lowerbound is not None:
plt.axvline(args.lowerbound, color="red")
if args.upperbound != None:
if args.upperbound is not None:
plt.axvline(args.upperbound, color="red")
plt.plot(x, y, 'b-', label='Normal distribution')