1717)
1818
1919
20- class DiffractionObject :
20+ class Diffraction_object :
2121 def __init__ (self , name = "" , wavelength = None ):
2222 self .name = name
2323 self .wavelength = wavelength
@@ -29,7 +29,7 @@ def __init__(self, name="", wavelength=None):
2929 self .metadata = {}
3030
3131 def __eq__ (self , other ):
32- if not isinstance (other , DiffractionObject ):
32+ if not isinstance (other , Diffraction_object ):
3333 return NotImplemented
3434 self_attributes = [key for key in self .__dict__ if not key .startswith ("_" )]
3535 other_attributes = [key for key in other .__dict__ if not key .startswith ("_" )]
@@ -59,8 +59,8 @@ def __add__(self, other):
5959 if isinstance (other , int ) or isinstance (other , float ) or isinstance (other , np .ndarray ):
6060 summed .on_tth [1 ] = self .on_tth [1 ] + other
6161 summed .on_q [1 ] = self .on_q [1 ] + other
62- elif not isinstance (other , DiffractionObject ):
63- raise TypeError ("I only know how to sum two DiffractionObject objects" )
62+ elif not isinstance (other , Diffraction_object ):
63+ raise TypeError ("I only know how to sum two Diffraction_object objects" )
6464 elif self .on_tth [0 ].all () != other .on_tth [0 ].all ():
6565 raise RuntimeError (x_grid_emsg )
6666 else :
@@ -73,7 +73,7 @@ def __radd__(self, other):
7373 if isinstance (other , int ) or isinstance (other , float ) or isinstance (other , np .ndarray ):
7474 summed .on_tth [1 ] = self .on_tth [1 ] + other
7575 summed .on_q [1 ] = self .on_q [1 ] + other
76- elif not isinstance (other , DiffractionObject ):
76+ elif not isinstance (other , Diffraction_object ):
7777 raise TypeError ("I only know how to sum two Scattering_object objects" )
7878 elif self .on_tth [0 ].all () != other .on_tth [0 ].all ():
7979 raise RuntimeError (x_grid_emsg )
@@ -87,7 +87,7 @@ def __sub__(self, other):
8787 if isinstance (other , int ) or isinstance (other , float ) or isinstance (other , np .ndarray ):
8888 subtracted .on_tth [1 ] = self .on_tth [1 ] - other
8989 subtracted .on_q [1 ] = self .on_q [1 ] - other
90- elif not isinstance (other , DiffractionObject ):
90+ elif not isinstance (other , Diffraction_object ):
9191 raise TypeError ("I only know how to subtract two Scattering_object objects" )
9292 elif self .on_tth [0 ].all () != other .on_tth [0 ].all ():
9393 raise RuntimeError (x_grid_emsg )
@@ -101,7 +101,7 @@ def __rsub__(self, other):
101101 if isinstance (other , int ) or isinstance (other , float ) or isinstance (other , np .ndarray ):
102102 subtracted .on_tth [1 ] = other - self .on_tth [1 ]
103103 subtracted .on_q [1 ] = other - self .on_q [1 ]
104- elif not isinstance (other , DiffractionObject ):
104+ elif not isinstance (other , Diffraction_object ):
105105 raise TypeError ("I only know how to subtract two Scattering_object objects" )
106106 elif self .on_tth [0 ].all () != other .on_tth [0 ].all ():
107107 raise RuntimeError (x_grid_emsg )
@@ -115,7 +115,7 @@ def __mul__(self, other):
115115 if isinstance (other , int ) or isinstance (other , float ) or isinstance (other , np .ndarray ):
116116 multiplied .on_tth [1 ] = other * self .on_tth [1 ]
117117 multiplied .on_q [1 ] = other * self .on_q [1 ]
118- elif not isinstance (other , DiffractionObject ):
118+ elif not isinstance (other , Diffraction_object ):
119119 raise TypeError ("I only know how to multiply two Scattering_object objects" )
120120 elif self .on_tth [0 ].all () != other .on_tth [0 ].all ():
121121 raise RuntimeError (x_grid_emsg )
@@ -141,7 +141,7 @@ def __truediv__(self, other):
141141 if isinstance (other , int ) or isinstance (other , float ) or isinstance (other , np .ndarray ):
142142 divided .on_tth [1 ] = other / self .on_tth [1 ]
143143 divided .on_q [1 ] = other / self .on_q [1 ]
144- elif not isinstance (other , DiffractionObject ):
144+ elif not isinstance (other , Diffraction_object ):
145145 raise TypeError ("I only know how to multiply two Scattering_object objects" )
146146 elif self .on_tth [0 ].all () != other .on_tth [0 ].all ():
147147 raise RuntimeError (x_grid_emsg )
@@ -389,7 +389,7 @@ def scale_to(self, target_diff_object, xtype=None, xvalue=None):
389389
390390 Parameters
391391 ----------
392- target_diff_object: DiffractionObject
392+ target_diff_object: Diffraction_object
393393 the diffractoin object you want to scale the current one on to
394394 xtype: string, optional. Default is Q
395395 the xtype, from { XQUANTITIES } , that you will specify a point from to scale to
@@ -400,7 +400,7 @@ def scale_to(self, target_diff_object, xtype=None, xvalue=None):
400400
401401 Returns
402402 -------
403- the rescaled DiffractionObject as a new object
403+ the rescaled Diffraction_object as a new object
404404
405405 """
406406 scaled = deepcopy (self )
@@ -454,7 +454,7 @@ def dump(self, filepath, xtype=None):
454454
455455 with open (filepath , "w" ) as f :
456456 f .write (
457- f"[DiffractionObject ]\n name = { self .name } \n wavelength = { self .wavelength } \n "
457+ f"[Diffraction_object ]\n name = { self .name } \n wavelength = { self .wavelength } \n "
458458 f"scat_quantity = { self .scat_quantity } \n "
459459 )
460460 for key , value in self .metadata .items ():
0 commit comments