1010 Profile ,
1111)
1212from diffpy .srfit .pdf import DebyePDFGenerator , PDFGenerator , PDFParser
13- from diffpy .srfit .structure import constrainAsSpaceGroup
14- from diffpy .structure .parsers import getParser
13+ from diffpy .srfit .structure import constrain_as_space_group
14+ from diffpy .structure .parsers import get_parser
1515
1616_DATA_DIR = Path (__file__ ).parent / "data"
1717
@@ -49,21 +49,21 @@ def run_ni_example():
4949 QBROAD_I = 0.02
5050 RUN_PARALLEL = True
5151
52- p_cif = getParser ("cif" )
53- stru1 = p_cif .parseFile (structure_path )
52+ p_cif = get_parser ("cif" )
53+ stru1 = p_cif .parse_file (structure_path )
5454 sg = p_cif .spacegroup .short_name
5555 profile = Profile ()
5656 parser = PDFParser ()
57- parser .parseFile (profile_path )
58- profile .loadParsedData (parser )
59- profile .setCalculationRange (xmin = PDF_RMIN , xmax = PDF_RMAX , dx = PDF_RSTEP )
57+ parser .parse_file (profile_path )
58+ profile .load_parsed_data (parser )
59+ profile .set_calculation_range (xmin = PDF_RMIN , xmax = PDF_RMAX , dx = PDF_RSTEP )
6060 generator_crystal1 = PDFGenerator ("G1" )
6161 generator_crystal1 .setStructure (stru1 , periodic = True )
6262 generator_crystal1 .setQmax (QMAX )
6363 generator_crystal1 .setQmin (QMIN )
6464 generator_crystal1 .delta2 .value = DELTA2_I
6565 contribution = FitContribution ("crystal" )
66- contribution .addProfileGenerator (generator_crystal1 )
66+ contribution .add_profile_generator (generator_crystal1 )
6767 if RUN_PARALLEL :
6868 try :
6969 import multiprocessing
@@ -82,28 +82,28 @@ def run_ni_example():
8282 "\n You don't appear to have the necessary packages for "
8383 "parallelization"
8484 )
85- contribution .setProfile (profile , xname = "r" )
86- contribution .setEquation ("s0*G1" )
85+ contribution .set_profile (profile , xname = "r" )
86+ contribution .set_equation ("s0*G1" )
8787 recipe = FitRecipe ()
88- recipe .addContribution (contribution )
88+ recipe .add_contribution (contribution )
8989 recipe .crystal .G1 .qdamp .value = QDAMP_I
9090 recipe .crystal .G1 .qbroad .value = QBROAD_I
9191 recipe .crystal .G1 .setQmax (QMAX )
9292 recipe .crystal .G1 .setQmin (QMIN )
93- recipe .addVar (contribution .s0 , SCALE_I , name = "s0" )
94- spacegroupparams = constrainAsSpaceGroup (generator_crystal1 .phase , sg )
93+ recipe .add_variable (contribution .s0 , SCALE_I , name = "s0" )
94+ spacegroupparams = constrain_as_space_group (generator_crystal1 .phase , sg )
9595 for par in spacegroupparams .latpars :
96- recipe .addVar (par , value = CUBICLAT_I , fixed = False , name = "G1_a" )
96+ recipe .add_variable (par , value = CUBICLAT_I , fixed = False , name = "G1_a" )
9797 for par in spacegroupparams .adppars :
98- recipe .addVar (par , value = UISO_I , fixed = False , name = "G1_Uiso_0" )
99- recipe .addVar (generator_crystal1 .delta2 , name = "G1_delta2" )
100- recipe .addVar (
98+ recipe .add_variable (par , value = UISO_I , fixed = False , name = "G1_Uiso_0" )
99+ recipe .add_variable (generator_crystal1 .delta2 , name = "G1_delta2" )
100+ recipe .add_variable (
101101 generator_crystal1 .qdamp ,
102102 fixed = False ,
103103 name = "qdamp" ,
104104 value = QDAMP_I ,
105105 )
106- recipe .addVar (
106+ recipe .add_variable (
107107 generator_crystal1 .qbroad ,
108108 fixed = False ,
109109 name = "qbroad" ,
0 commit comments