Skip to content

Commit 9606c64

Browse files
committed
fix small bug
1 parent faf2273 commit 9606c64

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/integrate.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def plotIntegral(data, a, b, typ, trapezoidals = False):
3939
plt.savefig(filename, dpi=600)
4040
plt.show()
4141

42-
def trapezoidalIntegration(data, a, b):
42+
def compositeTrapezoidalIntegration(data, a, b):
4343
""" returns trapezoidal integral between a, b
4444
finds nearest x values to a and b where b > a"""
4545
aIdx = (np.abs(data[:, 0] - a)).argmin()
@@ -95,7 +95,7 @@ def performIntegration(data, idx, f, typ):
9595
integrals[i], a, b = f(data, a, b)
9696
plotIntegral(data, a, b, typ)
9797

98-
print("type : {typ}"
98+
print("type : {typ}")
9999
for i in range(len(integrals)):
100100
print(f"I{i} = {integrals[i]}")
101101
print("---------")
@@ -122,7 +122,7 @@ def performIntegration(data, idx, f, typ):
122122
[14., 14.75],
123123
[20.1, 21.],
124124
[24.7, 25.6]])
125-
#performIntegration(dataUnknown, naclIdx, compositeSimpsonsIntegration, "unknown")
125+
performIntegration(dataUnknown, naclIdx, compositeSimpsonsIntegration, "unknown")
126126

127127
# indexes used by dataGAuss integration
128128
kclIdx = np.array([
@@ -133,17 +133,17 @@ def performIntegration(data, idx, f, typ):
133133
[13.5, 14.95],
134134
[19.5, 21.5],
135135
[24.7, 25.6]])
136-
#performIntegration(dataGauss, naclIdx, compositeSimpsonsIntegration, "gauss")
136+
performIntegration(dataGauss, naclIdx, compositeSimpsonsIntegration, "gauss")
137137

138138
# indexes used by si integration
139-
siIdx = np.array([
140-
[11.93, 13.86],
141-
[20.47, 21.9],
142-
[24.38, 25.59]])
143-
performIntegration(dataSi, siIdx, trapezoidalIntegration, "si")
144-
145-
siIdx = np.array([
146-
[12.25, 13.25],
147-
[20.75, 21.75],
148-
[24.37, 25.5]])
149-
performIntegration(dataSi, siIdx, trapezoidalIntegration, "si")
139+
#siIdx = np.array([
140+
# [11.93, 13.86],
141+
# [20.47, 21.9],
142+
# [24.38, 25.59]])
143+
#performIntegration(dataSi, siIdx, trapezoidalIntegration, "si")
144+
145+
#siIdx = np.array([
146+
# [12.25, 13.25],
147+
# [20.75, 21.75],
148+
# [24.37, 25.5]])
149+
#performIntegration(dataSi, siIdx, trapezoidalIntegration, "si")

0 commit comments

Comments
 (0)