Skip to content

Commit c59b09e

Browse files
committed
test: adding test and empty function
1 parent c4ed0e6 commit c59b09e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from diffpy.morph.morphs.morph import LABEL_GR, LABEL_RA, Morph
2+
3+
4+
class MorphSqueeze(Morph):
5+
"""Squeeze the morph function.
6+
7+
This applies a polynomial to squeeze the morph non-linearly. The resulting
8+
squeezed morph is interpolated to the (trimmed) target grid.
9+
Only the overlapping region between the squeezed morph and the target
10+
grid is used. The target is trimmed (or not) accordingly, and the final
11+
outputs (morph and target) are returned on the same grid, defined by this
12+
trimmed target range.
13+
14+
Configuration Variables
15+
-----------------------
16+
squeeze
17+
list or array-like
18+
Polynomial coefficients [a0, a1, ..., an] for the squeeze function.
19+
"""
20+
21+
# Define input output types
22+
summary = "Squeeze morph by polynomial shift"
23+
xinlabel = LABEL_RA
24+
yinlabel = LABEL_GR
25+
xoutlabel = LABEL_RA
26+
youtlabel = LABEL_GR
27+
parnames = ["squeeze"]
28+
29+
def morph(self, x_morph, y_morph, x_target, y_target):
30+
Morph.morph(self, x_morph, y_morph, x_target, y_target)
31+
if self.squeeze is None:
32+
self.x_morph_out = self.x_morph_in
33+
self.y_morph_out = self.y_morph_in
34+
return self.xyallout
35+
36+
return self.xyallout

0 commit comments

Comments
 (0)