@@ -762,17 +762,16 @@ def single_morph(
762762 # if you think there requires special handling
763763
764764 # Input morph parameters
765- morph_inputs = {
766- "scale" : scale_in ,
767- "stretch" : stretch_in ,
768- "smear" : smear_in ,
769- }
770- morph_inputs .update ({"hshift" : hshift_in , "vshift" : vshift_in })
771- # More complex input morph parameters are only displayed conditionally
772- if opts .squeeze is not None :
773- squeeze_dict = squeeze_dict_in .copy ()
774- for idx , _ in enumerate (squeeze_dict ):
775- morph_inputs .update ({f"squeeze a{ idx } " : squeeze_dict [f"a{ idx } " ]})
765+ morph_inputs = io .build_morph_inputs_container (
766+ opts .scale ,
767+ opts .stretch ,
768+ opts .smear_pdf ,
769+ opts .smear ,
770+ opts .hshift ,
771+ opts .vshift ,
772+ opts .squeeze ,
773+ )
774+ # Special python morph inputs (for single morph only)
776775 if pymorphs is not None :
777776 if "funcxy" in pymorphs :
778777 for funcxy_param in pymorphs ["funcxy" ][1 ].keys ():
@@ -990,12 +989,15 @@ def multiple_targets(parser, opts, pargs, stdout_flag=True, python_wrap=False):
990989 for key in morph_results .keys ():
991990 target_file_names .append (key )
992991
993- morph_inputs = {
994- "scale" : opts .scale ,
995- "stretch" : opts .stretch ,
996- "smear" : opts .smear_pdf ,
997- }
998- morph_inputs .update ({"hshift" : opts .hshift , "vshift" : opts .vshift })
992+ morph_inputs = io .build_morph_inputs_container (
993+ opts .scale ,
994+ opts .stretch ,
995+ opts .smear_pdf ,
996+ opts .smear ,
997+ opts .hshift ,
998+ opts .vshift ,
999+ opts .squeeze ,
1000+ )
9991001
10001002 try :
10011003 # Print summary of morphs to terminal and to file (if requested)
@@ -1173,12 +1175,15 @@ def multiple_morphs(parser, opts, pargs, stdout_flag=True, python_wrap=False):
11731175 for key in morph_results .keys ():
11741176 morph_file_names .append (key )
11751177
1176- morph_inputs = {
1177- "scale" : opts .scale ,
1178- "stretch" : opts .stretch ,
1179- "smear" : opts .smear_pdf ,
1180- }
1181- morph_inputs .update ({"hshift" : opts .hshift , "vshift" : opts .vshift })
1178+ morph_inputs = io .build_morph_inputs_container (
1179+ opts .scale ,
1180+ opts .stretch ,
1181+ opts .smear_pdf ,
1182+ opts .smear ,
1183+ opts .hshift ,
1184+ opts .vshift ,
1185+ opts .squeeze ,
1186+ )
11821187
11831188 try :
11841189 # Print summary of morphs to terminal and to file (if requested)
0 commit comments