@@ -165,7 +165,7 @@ def makeEquation(
165165
166166 Returns a callable Literal representing the equation string.
167167 """
168- self ._prepareBuilders (eqstr , buildargs , argclass , argkw )
168+ self ._prepare_builders (eqstr , buildargs , argclass , argkw )
169169 beq = eval (eqstr , {}, self .builders )
170170 # handle scalar numbers or numpy arrays
171171 if isinstance (beq , (numbers .Number , numpy .ndarray )):
@@ -301,7 +301,7 @@ def wipeout(self, eq):
301301 eq .setRoot (nan )
302302 return
303303
304- def _prepareBuilders (self , eqstr , buildargs , argclass , argkw ):
304+ def _prepare_builders (self , eqstr , buildargs , argclass , argkw ):
305305 """Prepare builders so that equation string can be evaluated.
306306
307307 This method checks the equation string for errors and missing
@@ -332,7 +332,7 @@ def _prepareBuilders(self, eqstr, buildargs, argclass, argkw):
332332 Returns a dictionary of the name, BaseBuilder pairs.
333333 """
334334
335- eqargs = self ._getUndefinedArgs (eqstr )
335+ eqargs = self ._get_undefined_args (eqstr )
336336
337337 # Raise an error if there are arguments that need to be created, but
338338 # this is disallowed.
@@ -353,7 +353,7 @@ def _prepareBuilders(self, eqstr, buildargs, argclass, argkw):
353353
354354 return
355355
356- def _getUndefinedArgs (self , eqstr ):
356+ def _get_undefined_args (self , eqstr ):
357357 """Get the undefined arguments from eqstr.
358358
359359 This tokenizes eqstr and extracts undefined arguments. An
@@ -441,7 +441,7 @@ def getEquation(self):
441441 eq = Equation (name , self .literal )
442442 return eq
443443
444- def __evalBinary (self , other , OperatorClass , onleft = True ):
444+ def __eval_binary (self , other , OperatorClass , onleft = True ):
445445 """Evaluate a binary function.
446446
447447 Other can be an BaseBuilder or a constant.
@@ -479,7 +479,7 @@ def __evalBinary(self, other, OperatorClass, onleft=True):
479479 opbuilder .literal = op
480480 return opbuilder
481481
482- def __evalUnary (self , OperatorClass ):
482+ def __eval_unary (self , OperatorClass ):
483483 """Evaluate a unary function."""
484484 op = OperatorClass ()
485485 op .addLiteral (self .literal )
@@ -488,28 +488,30 @@ def __evalUnary(self, OperatorClass):
488488 return opbuilder
489489
490490 def __add__ (self , other ):
491- return self .__evalBinary (other , literals .AdditionOperator )
491+ return self .__eval_binary (other , literals .AdditionOperator )
492492
493493 def __radd__ (self , other ):
494- return self .__evalBinary (other , literals .AdditionOperator , False )
494+ return self .__eval_binary (other , literals .AdditionOperator , False )
495495
496496 def __sub__ (self , other ):
497- return self .__evalBinary (other , literals .SubtractionOperator )
497+ return self .__eval_binary (other , literals .SubtractionOperator )
498498
499499 def __rsub__ (self , other ):
500- return self .__evalBinary (other , literals .SubtractionOperator , False )
500+ return self .__eval_binary (other , literals .SubtractionOperator , False )
501501
502502 def __mul__ (self , other ):
503- return self .__evalBinary (other , literals .MultiplicationOperator )
503+ return self .__eval_binary (other , literals .MultiplicationOperator )
504504
505505 def __rmul__ (self , other ):
506- return self .__evalBinary (other , literals .MultiplicationOperator , False )
506+ return self .__eval_binary (
507+ other , literals .MultiplicationOperator , False
508+ )
507509
508510 def __truediv__ (self , other ):
509- return self .__evalBinary (other , literals .DivisionOperator )
511+ return self .__eval_binary (other , literals .DivisionOperator )
510512
511513 def __rtruediv__ (self , other ):
512- return self .__evalBinary (other , literals .DivisionOperator , False )
514+ return self .__eval_binary (other , literals .DivisionOperator , False )
513515
514516 # Python 2 Compatibility -------------------------------------------------
515517
@@ -520,19 +522,21 @@ def __rtruediv__(self, other):
520522 # ------------------------------------------------------------------------
521523
522524 def __pow__ (self , other ):
523- return self .__evalBinary (other , literals .ExponentiationOperator )
525+ return self .__eval_binary (other , literals .ExponentiationOperator )
524526
525527 def __rpow__ (self , other ):
526- return self .__evalBinary (other , literals .ExponentiationOperator , False )
528+ return self .__eval_binary (
529+ other , literals .ExponentiationOperator , False
530+ )
527531
528532 def __mod__ (self , other ):
529- return self .__evalBinary (other , literals .RemainderOperator )
533+ return self .__eval_binary (other , literals .RemainderOperator )
530534
531535 def __rmod__ (self , other ):
532- return self .__evalBinary (other , literals .RemainderOperator , False )
536+ return self .__eval_binary (other , literals .RemainderOperator , False )
533537
534538 def __neg__ (self ):
535- return self .__evalUnary (literals .NegationOperator )
539+ return self .__eval_unary (literals .NegationOperator )
536540
537541
538542# These are used by the class.
@@ -706,7 +710,7 @@ def getBuilder(name):
706710 return _builders [name ]
707711
708712
709- def __wrapNumpyOperators ():
713+ def __wrap_numpy_operators ():
710714 """Export all numpy operators as OperatorBuilder instances in the module
711715 namespace."""
712716 for name in dir (numpy ):
@@ -716,11 +720,11 @@ def __wrapNumpyOperators():
716720 return
717721
718722
719- __wrapNumpyOperators ()
723+ __wrap_numpy_operators ()
720724
721725
722726# Register other functions as well
723- def __wrapSrFitOperators ():
727+ def __wrap_srfit_operators ():
724728 """Export all non-base operators from the
725729 diffpy.srfit.equation.literals.operators module as OperatorBuilder
726730 instances in the module namespace."""
@@ -744,6 +748,6 @@ def _is_exported_type(cls):
744748 return
745749
746750
747- __wrapSrFitOperators ()
751+ __wrap_srfit_operators ()
748752
749753# End of file
0 commit comments