@@ -46,10 +46,11 @@ def single_morph_output(
4646 save_file
4747 Name of file to print to. If None (default) print to terminal.
4848 morph_file
49- Name of the morphed PDF file. Required when printing to a non-terminal file.
49+ Name of the morphed PDF file. Required when printing to a
50+ non-terminal file.
5051 param xy_out: list
51- List of the form [x_morph_out, y_morph_out]. x_morph_out is a List of r values and
52- y_morph_out is a List of gr values.
52+ List of the form [x_morph_out, y_morph_out]. x_morph_out is a List of
53+ r values and y_morph_out is a List of gr values.
5354 verbose: bool
5455 Print additional details about the morph when True (default False).
5556 stdout_flag: bool
@@ -107,14 +108,16 @@ def single_morph_output(
107108def create_morphs_directory (save_directory ):
108109 """Create a directory for saving multiple morphed PDFs.
109110
110- Takes in a user-given path to a directory save_directory and create a subdirectory named Morphs.
111- PDFmorph will save all morphs into the Morphs subdirectory while metadata about the morphs will
112- be stored in save_directory outside Morphs.
111+ Takes in a user-given path to a directory save_directory and create a
112+ subdirectory named Morphs. PDFmorph will save all morphs into the Morphs
113+ subdirectory while metadata about the morphs will be stored in
114+ save_directory outside Morphs.
113115
114116 Parameters
115117 ----------
116118 save_directory
117- Path to a directory. PDFmorph will save all generated files within this directory.
119+ Path to a directory. PDFmorph will save all generated files within
120+ this directory.
118121
119122 Returns
120123 -------
@@ -133,8 +136,9 @@ def create_morphs_directory(save_directory):
133136
134137def get_multisave_names (target_list : list , save_names_file = None , mm = False ):
135138 """Create or import a dictionary that specifies names to save morphs as.
136- First attempt to import names from a specified file. If names for certain morphs not found,
137- use default naming scheme: 'Morph_with_Target_<target file name>.cgr'.
139+ First attempt to import names from a specified file.
140+ If names for certain morphs not found, use default naming scheme:
141+ 'Morph_with_Target_<target file name>.cgr'.
138142
139143 Used when saving multiple morphs.
140144
@@ -150,7 +154,8 @@ def get_multisave_names(target_list: list, save_names_file=None, mm=False):
150154 Returns
151155 -------
152156 dict
153- The names to save each morph as. Keys are the target PDF file names used to produce that morph.
157+ The names to save each morph as. Keys are the target PDF file names
158+ used to produce that morph.
154159 """
155160
156161 # Dictionary storing save file names
@@ -167,15 +172,19 @@ def get_multisave_names(target_list: list, save_names_file=None, mm=False):
167172 save_names .update (
168173 {
169174 target_file .name : {
170- __save_morph_as__ : f"Morph_with_Target_{ target_file .stem } .cgr"
175+ __save_morph_as__ : (
176+ f"Morph_with_Target_{ target_file .stem } .cgr"
177+ )
171178 }
172179 }
173180 )
174181 else :
175182 save_names .update (
176183 {
177184 target_file .name : {
178- __save_morph_as__ : f"Morph_of_{ target_file .stem } .cgr"
185+ __save_morph_as__ : (
186+ f"Morph_of_{ target_file .stem } .cgr"
187+ )
179188 }
180189 }
181190 )
@@ -209,11 +218,14 @@ def multiple_morph_output(
209218 save_directory
210219 Name of directory to save morphs in.
211220 field
212- Name of field if data was sorted by a particular field. Otherwise, leave blank.
221+ Name of field if data was sorted by a particular field.
222+ Otherwise, leave blank.
213223 field_list: list
214- List of field values for each target PDF. Generated by diffpy.pdfmorph.tools.field_sort().
224+ List of field values for each target PDF.
225+ Generated by diffpy.pdfmorph.tools.field_sort().
215226 morph_file
216- Name of the morphed PDF file. Required to give summary data after saving to a directory.
227+ Name of the morphed PDF file.
228+ Required to give summary data after saving to a directory.
217229 target_directory
218230 Name of the directory containing the target PDF files.
219231 Required to give summary data after saving to a directory.
@@ -222,8 +234,8 @@ def multiple_morph_output(
222234 stdout_flag: bool
223235 Print to terminal when True (default False).
224236 mm: bool
225- Multiple morphs done with a single target rather than multiple targets for a single morphed file.
226- Swaps morph and target in the code.
237+ Multiple morphs done with a single target rather than multiple
238+ targets for a single morphed file. Swaps morph and target in the code.
227239 """
228240
229241 # Input parameters used for every morph
@@ -235,7 +247,8 @@ def multiple_morph_output(
235247 # Verbose to get output for every morph
236248 verbose_outputs = ""
237249 if verbose :
238- # Output for every morph (information repeated in a succinct table below)
250+ # Output for every morph
251+ # (information repeated in a succinct table below)
239252 for target in morph_results .keys ():
240253 if not mm :
241254 output = f"\n # Target: { target } \n "
@@ -307,24 +320,27 @@ def multiple_morph_output(
307320
308321
309322def tabulate_results (multiple_morph_results ):
310- """Helper function to make a data table summarizing details about the results of multiple morphs.
323+ """Helper function to make a data table summarizing details about the
324+ results of multiple morphs.
311325
312326 Parameters
313327 ----------
314328 multiple_morph_results
315- A collection of Dictionaries. Each Dictionary summarizes the resultsof a single morph.
329+ A collection of Dictionaries. Each Dictionary summarizes the
330+ resultsof a single morph.
316331
317332 Returns
318333 -------
319334 tabulated_results: dict
320- Keys in tabulated_results are the table's column names and each corresponding value is a list
321- of data for that column.
335+ Keys in tabulated_results are the table's column names and each
336+ corresponding value is a list of data for that column.
322337 """
323338
324339 # We only care about the following parameters in our data tables
325340 relevant_parameters = ["Scale" , "Smear" , "Stretch" , "Pearson" , "Rw" ]
326341
327- # Keys in this table represent column names and the value will be a list of column data
342+ # Keys in this table represent column names and the value will be a list
343+ # of column data
328344 tabulated_results = {}
329345 for param in relevant_parameters :
330346 tabulated_results .update (
0 commit comments