Skip to content

Commit 077b09c

Browse files
authored
Merge branch 'diffpy:main' into morphfuncxy
2 parents 5ab8983 + 1f99f5e commit 077b09c

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

news/epsilon.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* MorphRGrid can now handle grids denser than 1e-08. Previously, it was possible that multiple points on the intersection range could be excluded.
20+
21+
**Security:**
22+
23+
* <news item>

src/diffpy/morph/morphs/morphrgrid.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
from diffpy.morph.morphs.morph import LABEL_GR, LABEL_RA, Morph
2121

22-
# roundoff tolerance for selecting bounds on arrays.
23-
epsilon = 1e-8
24-
2522

2623
class MorphRGrid(Morph):
2724
"""Resample to specified r-grid.
@@ -75,6 +72,8 @@ def morph(self, x_morph, y_morph, x_target, y_target):
7572
self.rmax = rmaxinc
7673
if self.rstep is None or self.rstep < rstepinc:
7774
self.rstep = rstepinc
75+
# roundoff tolerance for selecting bounds on arrays.
76+
epsilon = self.rstep / 2
7877
# Make sure that rmax is exclusive
7978
self.x_morph_out = numpy.arange(
8079
self.rmin, self.rmax - epsilon, self.rstep

0 commit comments

Comments
 (0)