2020class MorphChain (list ):
2121 """Class for chaining morphs together.
2222
23- This class is a queue of morphs that get executed in order via the 'morph' method.
24- This class derives from the built-in list, and list methods are used to modify the queue.
23+ This class is a queue of morphs that get executed in order via the 'morph'
24+ method. This class derives from the built-in list, and list methods are
25+ used to modify the queue.
2526
2627 This derives from list and relies on its methods where possible.
2728
@@ -57,7 +58,8 @@ class MorphChain(list):
5758 xy_target_out
5859 Tuple of (x_target_out, y_target_out) from last morph.
5960 xyallout
60- Tuple of (x_morph_out, y_morph_out, x_target_out, y_target_out) from last morph.
61+ Tuple of (x_morph_out, y_morph_out, x_target_out, y_target_out)
62+ from last morph.
6163 parnames
6264 Names of parameters collected from morphs (Read only).
6365
@@ -66,19 +68,47 @@ class MorphChain(list):
6668 The properties return tuples of None if there are no morphs.
6769 """
6870
69- x_morph_in = property (lambda self : None if len (self ) == 0 else self [0 ].x_morph_in )
70- y_morph_in = property (lambda self : None if len (self ) == 0 else self [0 ].y_morph_in )
71- x_target_in = property (lambda self : None if len (self ) == 0 else self [0 ].x_target_in )
72- y_target_in = property (lambda self : None if len (self ) == 0 else self [0 ].y_target_in )
73- x_morph_out = property (lambda self : None if len (self ) == 0 else self [- 1 ].x_morph_out )
74- y_morph_out = property (lambda self : None if len (self ) == 0 else self [- 1 ].y_morph_out )
75- x_target_out = property (lambda self : None if len (self ) == 0 else self [- 1 ].x_target_out )
76- y_target_out = property (lambda self : None if len (self ) == 0 else self [- 1 ].y_target_out )
77- xy_morph_in = property (lambda self : (None , None ) if len (self ) == 0 else self [0 ].xy_morph_in )
78- xy_morph_out = property (lambda self : (None , None ) if len (self ) == 0 else self [- 1 ].xy_morph_out )
79- xy_target_in = property (lambda self : (None , None ) if len (self ) == 0 else self [0 ].xy_target_in )
80- xy_target_out = property (lambda self : (None , None ) if len (self ) == 0 else self [- 1 ].xy_target_out )
81- xyallout = property (lambda self : (None , None , None , None ) if len (self ) == 0 else self [- 1 ].xyallout )
71+ x_morph_in = property (
72+ lambda self : None if len (self ) == 0 else self [0 ].x_morph_in
73+ )
74+ y_morph_in = property (
75+ lambda self : None if len (self ) == 0 else self [0 ].y_morph_in
76+ )
77+ x_target_in = property (
78+ lambda self : None if len (self ) == 0 else self [0 ].x_target_in
79+ )
80+ y_target_in = property (
81+ lambda self : None if len (self ) == 0 else self [0 ].y_target_in
82+ )
83+ x_morph_out = property (
84+ lambda self : None if len (self ) == 0 else self [- 1 ].x_morph_out
85+ )
86+ y_morph_out = property (
87+ lambda self : None if len (self ) == 0 else self [- 1 ].y_morph_out
88+ )
89+ x_target_out = property (
90+ lambda self : None if len (self ) == 0 else self [- 1 ].x_target_out
91+ )
92+ y_target_out = property (
93+ lambda self : None if len (self ) == 0 else self [- 1 ].y_target_out
94+ )
95+ xy_morph_in = property (
96+ lambda self : (None , None ) if len (self ) == 0 else self [0 ].xy_morph_in
97+ )
98+ xy_morph_out = property (
99+ lambda self : (None , None ) if len (self ) == 0 else self [- 1 ].xy_morph_out
100+ )
101+ xy_target_in = property (
102+ lambda self : (None , None ) if len (self ) == 0 else self [0 ].xy_target_in
103+ )
104+ xy_target_out = property (
105+ lambda self : (None , None ) if len (self ) == 0 else self [- 1 ].xy_target_out
106+ )
107+ xyallout = property (
108+ lambda self : (
109+ (None , None , None , None ) if len (self ) == 0 else self [- 1 ].xyallout
110+ )
111+ )
82112 parnames = property (lambda self : set (p for m in self for p in m .parnames ))
83113
84114 def __init__ (self , config , * args ):
@@ -89,7 +119,8 @@ def __init__(self, config, *args):
89119
90120 Notes
91121 -----
92- Additional arguments are morphs that will extend the queue of morphs.
122+ Additional arguments are morphs that will extend the queue of
123+ morphs.
93124 """
94125 self .config = config
95126 self .extend (args )
@@ -108,7 +139,8 @@ def morph(self, x_morph, y_morph, x_target, y_target):
108139 Returns
109140 -------
110141 tuple
111- A tuple of numpy arrays (x_morph_out, y_morph_out, x_target_out, y_target_out).
142+ A tuple of numpy arrays
143+ (x_morph_out, y_morph_out, x_target_out, y_target_out).
112144
113145 Notes
114146 -----
0 commit comments