File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -662,13 +662,16 @@ def __wrapSrFitOperators():
662662 """
663663 opmod = literals .operators
664664 excluded_types = set ((opmod .CustomOperator , opmod .UFuncOperator ))
665- # check if opmod member should be wrapped as OperatorBuilder
666- is_exported_type = lambda cls : (
667- inspect .isclass (cls )
668- and issubclass (cls , opmod .Operator )
669- and not inspect .isabstract (cls )
670- and cls not in excluded_types
671- )
665+
666+ def is_exported_type (cls ):
667+ """Check if the class should be wrapped as OperatorBuilder."""
668+ return (
669+ inspect .isclass (cls ) and
670+ issubclass (cls , opmod .Operator ) and
671+ not inspect .isabstract (cls ) and
672+ cls not in excluded_types
673+ )
674+
672675 # create OperatorBuilder objects
673676 for nm , opclass in inspect .getmembers (opmod , is_exported_type ):
674677 op = opclass ()
Original file line number Diff line number Diff line change @@ -92,9 +92,7 @@ def __call__(self, r):
9292 self ._invertor .y = iq
9393 self ._invertor .err = diq
9494 c , c_cov = self ._invertor .invert_optimize ()
95- calculate_pr = lambda x : self ._invertor .pr (c , x )
96- pr = map (calculate_pr , r )
97-
95+ pr = map (lambda x : self ._invertor .pr (c , x ), r )
9896 pr = numpy .array (pr )
9997 return self .scale .value * pr
10098
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ def test_releaseOldEquations(self):
270270 def test_registerFunction (self ):
271271 """Ensure registered function works after second setEquation call."""
272272 fc = self .fitcontribution
273- fsquare = lambda x : x ** 2
273+ fsquare = lambda x : x ** 2 # noqa: E731
274274 fc .registerFunction (fsquare , name = "fsquare" )
275275 fc .setEquation ("fsquare" )
276276 fc .x .setValue (5 )
You can’t perform that action at this time.
0 commit comments