@@ -37,18 +37,22 @@ def morph(self, x_morph, y_morph, x_target, y_target):
3737 -------
3838 Import the funcy morph function:
3939 >>> from diffpy.morph.morphs.morphfuncy import MorphFuncy
40+
4041 Define or import the user-supplied transformation function:
4142 >>> def sine_function(x, y, amplitude, frequency):
4243 >>> return amplitude * np.sin(frequency * x) * y
44+
4345 Provide initial guess for parameters:
4446 >>> parameters = {'amplitude': 2, 'frequency': 2}
47+
4548 Run the funcy morph given input morph array (x_morph, y_morph)
4649 and target array (x_target, y_target):
4750 >>> morph = MorphFuncy()
4851 >>> morph.function = sine_function
4952 >>> morph.parameters = parameters
50- >>> x_morph_out, y_morph_out, x_target_out, y_target_out = morph(
53+ >>> x_morph_out, y_morph_out, x_target_out, y_target_out = morph.morph (
5154 ... x_morph, y_morph, x_target, y_target)
55+
5256 To access parameters from the morph instance:
5357 >>> x_morph_in = morph.x_morph_in
5458 >>> y_morph_in = morph.y_morph_in
@@ -61,5 +65,4 @@ def morph(self, x_morph, y_morph, x_target, y_target):
6165 self .y_morph_out = self .function (
6266 self .x_morph_in , self .y_morph_in , ** self .parameters
6367 )
64-
6568 return self .xyallout
0 commit comments