Skip to content

Conversation

@bobleesj
Copy link

@bobleesj bobleesj commented Aug 24, 2024

This is the last bit of all flake8 remaining in cookie.

Tests pass

imac@imacs-iMac diffpy.srfit % python -m diffpy.srfit.tests.run
WARNING:diffpy.srfit.tests:No module named 'sas', SaS tests skipped.
WARNING:diffpy.srfit.tests:Cannot import pyobjcryst, pyobjcryst tests skipped.
WARNING:diffpy.srfit.tests:Cannot import diffpy.srreal, PDF tests skipped.
......ssss................................sssssssssss....ssssss...........................sss..s..............
----------------------------------------------------------------------
Ran 110 tests in 0.197s

Copy link
Author

@bobleesj bobleesj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review @sbillinge

and cls not in excluded_types
)

def is_exported_type(cls):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__wrapSrFitOperators is a public function and I decided to make is_exported_type nested as well to encapsulate.

calculate_pr = lambda x: self._invertor.pr(c, x)
pr = map(calculate_pr, r)

pr = map(lambda x: self._invertor.pr(c, x), r)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Directly inserted the lambda inside the map.

"""Ensure registered function works after second setEquation call."""
fc = self.fitcontribution
fsquare = lambda x: x**2
fsquare = lambda x: x**2 # noqa: E731
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing, its usage seems ok, adding noqa.

@bobleesj bobleesj marked this pull request as ready for review August 24, 2024 20:20
@sbillinge sbillinge merged commit 7ea0fa9 into diffpy:cookie Aug 25, 2024
@bobleesj bobleesj deleted the flake8-lambda-3 branch August 25, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants