File tree 3 files changed +12
-11
lines changed
3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -662,13 +662,16 @@ def __wrapSrFitOperators():
662
662
"""
663
663
opmod = literals .operators
664
664
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
+
672
675
# create OperatorBuilder objects
673
676
for nm , opclass in inspect .getmembers (opmod , is_exported_type ):
674
677
op = opclass ()
Original file line number Diff line number Diff line change @@ -92,9 +92,7 @@ def __call__(self, r):
92
92
self ._invertor .y = iq
93
93
self ._invertor .err = diq
94
94
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 )
98
96
pr = numpy .array (pr )
99
97
return self .scale .value * pr
100
98
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ def test_releaseOldEquations(self):
270
270
def test_registerFunction (self ):
271
271
"""Ensure registered function works after second setEquation call."""
272
272
fc = self .fitcontribution
273
- fsquare = lambda x : x ** 2
273
+ fsquare = lambda x : x ** 2 # noqa: E731
274
274
fc .registerFunction (fsquare , name = "fsquare" )
275
275
fc .setEquation ("fsquare" )
276
276
fc .x .setValue (5 )
You can’t perform that action at this time.
0 commit comments