Skip to content

Commit cd002f3

Browse files
committed
fix: correctly fix the single peak plot issue with correct plot
1 parent c3d9984 commit cd002f3

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/diffpy/srmise/modelevaluators/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __lt__(self, other):
7676
assert self.method == other.method # Comparison between same types required
7777
assert self.stat is not None and other.stat is not None # The statistic must already be calculated
7878

79-
if self.higher_is_better is not None:
79+
if self.higher_is_better:
8080
return self.stat < other.stat
8181
else:
8282
return other.stat < self.stat
@@ -87,7 +87,7 @@ def __le__(self, other):
8787
assert self.method == other.method # Comparison between same types required
8888
assert self.stat is not None and other.stat is not None # The statistic must already be calculated
8989

90-
if self.higher_is_better is not None:
90+
if self.higher_is_better:
9191
return self.stat <= other.stat
9292
else:
9393
return other.stat <= self.stat
@@ -114,7 +114,7 @@ def __gt__(self, other):
114114
assert self.method == other.method # Comparison between same types required
115115
assert self.stat is not None and other.stat is not None # The statistic must already be calculated
116116

117-
if self.higher_is_better is not None:
117+
if self.higher_is_better:
118118
return self.stat > other.stat
119119
else:
120120
return other.stat > self.stat
@@ -125,7 +125,7 @@ def __ge__(self, other):
125125
assert self.method == other.method # Comparison between same types required
126126
assert self.stat is not None and other.stat is not None # The statistic must already be calculated
127127

128-
if self.higher_is_better is not None:
128+
if self.higher_is_better:
129129
return self.stat >= other.stat
130130
else:
131131
return other.stat >= self.stat

src/diffpy/srmise/peaks/gaussian.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,12 @@ def max(self, pars):
464464

465465
guesspars = [[2.7, 0.15, 5], [3.7, 0.3, 5]]
466466
guess_peaks = Peaks([pf.actualize(p, "pwa") for p in guesspars])
467-
cluster = ModelCluster(guess_peaks, r, y, err, None, AICc, [pf])
467+
cluster = ModelCluster(guess_peaks, None, r, y, err, None, AICc, [pf])
468468

469469
qual1 = cluster.quality()
470470
print(qual1.stat)
471471
cluster.fit()
472-
yfit = cluster.calc()
472+
yfit = cluster.value()
473473
qual2 = cluster.quality()
474474
print(qual2.stat)
475475

src/diffpy/srmise/peaks/gaussianoverr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def max(self, pars):
539539
qual1 = cluster.quality()
540540
print(qual1.stat)
541541
cluster.fit()
542-
yfit = cluster.calc()
542+
yfit = cluster.value()
543543
qual2 = cluster.quality()
544544
print(qual2.stat)
545545

src/diffpy/srmise/peaks/terminationripples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def extend_grid(self, r, dr):
421421
qual1 = cluster.quality()
422422
print(qual1.stat)
423423
cluster.fit()
424-
yfit = cluster.valuebl()
424+
yfit = cluster.value()
425425
qual2 = cluster.quality()
426426
print(qual2.stat)
427427

0 commit comments

Comments
 (0)