@@ -124,61 +124,9 @@ def build_morph_inputs_container(
124124 return morph_inputs
125125
126126
127- def get_terminal_morph_output (mr_copy , uncertainties ):
128- morphs_out = "# Optimized morphing parameters:\n "
129- # Handle special inputs (numerical)
130- if "squeeze" in mr_copy :
131- sq_dict = mr_copy .pop ("squeeze" )
132- rw_pos = list (mr_copy .keys ()).index ("Rw" )
133- morph_results_list = list (mr_copy .items ())
134- for idx , _ in enumerate (sq_dict ):
135- morph_results_list .insert (
136- rw_pos + idx , (f"squeeze a{ idx } " , sq_dict [f"a{ idx } " ])
137- )
138- mr_copy = dict (morph_results_list )
139-
140- # Handle special inputs (functional remove)
141- func_dicts = {
142- "funcxy" : [None , None ],
143- "funcx" : [None , None ],
144- "funcy" : [None , None ],
145- }
146- for func in func_dicts .keys ():
147- if f"{ func } _function" in mr_copy :
148- func_dicts [func ][0 ] = mr_copy .pop (f"{ func } _function" )
149- if func in mr_copy :
150- func_dicts [func ][1 ] = mr_copy .pop (func )
151- rw_pos = list (mr_copy .keys ()).index ("Rw" )
152- morph_results_list = list (mr_copy .items ())
153- for idx , key in enumerate (func_dicts [func ][1 ]):
154- morph_results_list .insert (
155- rw_pos + idx , (f"{ func } { key } " , func_dicts [func ][1 ][key ])
156- )
157- mr_copy = dict (morph_results_list )
158-
159- # Get uncertainties
160- if uncertainties is None :
161- morphs_out += "\n " .join (
162- f"# { key } = { mr_copy [key ]:.6f} " for key in mr_copy .keys ()
163- )
164- else :
165- morphs_out += "\n " .join (
166- f"# { key } = { mr_copy [key ]:.6f} "
167- + (
168- f" +/- { uncertainties [key ]:.6f} "
169- if key in uncertainties
170- else ""
171- )
172- for key in mr_copy
173- )
174-
175- return morphs_out , func_dicts
176-
177-
178127def single_morph_output (
179128 morph_inputs ,
180129 morph_results ,
181- uncertainties = None ,
182130 save_file = None ,
183131 morph_file = None ,
184132 xy_out = None ,
@@ -194,8 +142,6 @@ def single_morph_output(
194142 Parameters given by the user.
195143 morph_results: dict
196144 Resulting data after morphing.
197- uncertainties: dict
198- Uncertainties of all morphed parameters.
199145 save_file
200146 Name of file to print to. If None (default) print to terminal.
201147 morph_file
@@ -220,7 +166,41 @@ def single_morph_output(
220166 )
221167
222168 mr_copy = morph_results .copy ()
223- morphs_out , func_dicts = get_terminal_morph_output (mr_copy , uncertainties )
169+ morphs_out = "# Optimized morphing parameters:\n "
170+ # Handle special inputs (numerical)
171+ if "squeeze" in mr_copy :
172+ sq_dict = mr_copy .pop ("squeeze" )
173+ rw_pos = list (mr_copy .keys ()).index ("Rw" )
174+ morph_results_list = list (mr_copy .items ())
175+ for idx , _ in enumerate (sq_dict ):
176+ morph_results_list .insert (
177+ rw_pos + idx , (f"squeeze a{ idx } " , sq_dict [f"a{ idx } " ])
178+ )
179+ mr_copy = dict (morph_results_list )
180+
181+ # Handle special inputs (functional remove)
182+ func_dicts = {
183+ "funcxy" : [None , None ],
184+ "funcx" : [None , None ],
185+ "funcy" : [None , None ],
186+ }
187+ for func in func_dicts .keys ():
188+ if f"{ func } _function" in mr_copy :
189+ func_dicts [func ][0 ] = mr_copy .pop (f"{ func } _function" )
190+ if func in mr_copy :
191+ func_dicts [func ][1 ] = mr_copy .pop (func )
192+ rw_pos = list (mr_copy .keys ()).index ("Rw" )
193+ morph_results_list = list (mr_copy .items ())
194+ for idx , key in enumerate (func_dicts [func ][1 ]):
195+ morph_results_list .insert (
196+ rw_pos + idx , (f"{ func } { key } " , func_dicts [func ][1 ][key ])
197+ )
198+ mr_copy = dict (morph_results_list )
199+
200+ # Normal inputs
201+ morphs_out += "\n " .join (
202+ f"# { key } = { mr_copy [key ]:.6f} " for key in mr_copy .keys ()
203+ )
224204
225205 # Handle special inputs (functional add)
226206 for func in func_dicts .keys ():
@@ -360,7 +340,6 @@ def multiple_morph_output(
360340 morph_inputs ,
361341 morph_results ,
362342 target_files ,
363- uncertainties_dict = None ,
364343 field = None ,
365344 field_list = None ,
366345 save_directory = None ,
@@ -381,8 +360,6 @@ def multiple_morph_output(
381360 Resulting data after morphing.
382361 target_files: list
383362 Files that acted as targets to morphs.
384- uncertainties_dict: dict
385- Dictionary of uncertainties for each morph.
386363 save_directory
387364 Name of directory to save morphs in.
388365 field
@@ -422,11 +399,11 @@ def multiple_morph_output(
422399 output = f"\n # Target: { target } \n "
423400 else :
424401 output = f"\n # Morph: { target } \n "
425-
426- mr_copy = morph_results [ target ]. copy ()
427- uncertainties = uncertainties_dict [target ]
428- output_body , _ = get_terminal_morph_output ( mr_copy , uncertainties )
429- output += output_body
402+ output += "# Optimized morphing parameters: \n "
403+ output += " \n " . join (
404+ f"# { param } = { morph_results [target ][ param ]:.6f } "
405+ for param in morph_results [ target ]
406+ )
430407 verbose_outputs += f"{ output } \n "
431408
432409 # Get items we want to put in table
0 commit comments