1717
1818import numpy
1919
20- from diffpy .utils .parsers . loaddata import loadData
20+ from diffpy .utils .parsers import load_data
2121from diffpy .utils .parsers .serialization import deserialize_data
2222
2323
24- def estimateScale (y_morph_in , y_target_in ):
24+ def estimate_scale (y_morph_in , y_target_in ):
2525 """Set the scale that best matches the morph to the target."""
2626 dot = numpy .dot
2727 scale = dot (y_morph_in , y_target_in ) / dot (y_morph_in , y_morph_in )
2828 return scale
2929
3030
31- def estimateBaselineSlope (r , gr , rmin = None , rmax = None ):
31+ def estimate_baseline_slope (r , gr , rmin = None , rmax = None ):
3232 """Estimate the slope of the linear baseline of a PDF.
3333
3434 This fits a slope into the equation slope*r through the bottom of the PDF.
@@ -85,7 +85,7 @@ def chiv(pars):
8585 return slope
8686
8787
88- def getRw (chain ):
88+ def get_rw (chain ):
8989 """Get Rw from the outputs of a morph or chain."""
9090 # Make sure we put these on the proper grid
9191 x_morph , y_morph , x_target , y_target = chain .xyallout
@@ -104,8 +104,8 @@ def get_pearson(chain):
104104 return pcc
105105
106106
107- def readPDF (fname ):
108- """Reads an .gr file, loads r and G(r ) vectors.
107+ def read_two_column (fname ):
108+ """Reads a two-column data file, loads x and f(x ) vectors.
109109
110110 Parameters
111111 ----------
@@ -114,11 +114,11 @@ def readPDF(fname):
114114
115115 Returns
116116 -------
117- r,gr
117+ x,fx
118118 Arrays read from data.
119119 """
120120
121- rv = loadData (fname , unpack = True )
121+ rv = load_data (fname , unpack = True )
122122 if len (rv ) >= 2 :
123123 return rv [:2 ]
124124 return (None , None )
@@ -207,7 +207,7 @@ def field_sort(
207207 files_field_values = []
208208 if serfile is None :
209209 for path in filepaths :
210- fhd = loadData (path , headers = True )
210+ fhd = load_data (path , headers = True )
211211 files_field_values .append (
212212 [path , case_insensitive_dictionary_search (field , fhd )]
213213 )
0 commit comments