Skip to content

Commit 1f99f5e

Browse files
authored
Move epsilon parameter in MorphRGrid (#242)
* Move epsilon * news
1 parent c4eba1e commit 1f99f5e

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.
@@ -71,6 +68,8 @@ def morph(self, x_morph, y_morph, x_target, y_target):
7168
self.rmax = rmaxinc
7269
if self.rstep is None or self.rstep < rstepinc:
7370
self.rstep = rstepinc
71+
# roundoff tolerance for selecting bounds on arrays.
72+
epsilon = self.rstep / 2
7473
# Make sure that rmax is exclusive
7574
self.x_morph_out = numpy.arange(
7675
self.rmin, self.rmax - epsilon, self.rstep

0 commit comments

Comments
 (0)