Repository navigation
Conversation
| self._invertor.y = iq | ||
| self._invertor.err = diq | ||
| c, c_cov = self._invertor.invert_optimize() | ||
| calculate_pr = lambda x: self._invertor.pr(c, x) |
There was a problem hiding this comment.
I think using lambda functions that are short and concise actually increase readability... Hence adding # noqa: E731 as well.
|
This is the last PR for flake8. We shall implement CI/pre-commit very soon. |
There was a problem hiding this comment.
Please see comments. I am not a fan of lots of lambdas. I like them for sort keys and things like that where they are much more readable having the logic in place (not assigned) but elsewhere I think they rarely make things clearer than clearly written code with explicit functions and well chosen function names
| excluded_types = set((opmod.CustomOperator, opmod.UFuncOperator)) | ||
| # check if opmod member should be wrapped as OperatorBuilder | ||
| is_exported_type = lambda cls: ( | ||
| is_exported_type = lambda cls: ( # noqa: E731 |
There was a problem hiding this comment.
I don't find this very readable. We can't do better here?
| self._invertor.err = diq | ||
| c, c_cov = self._invertor.invert_optimize() | ||
| calculate_pr = lambda x: self._invertor.pr(c, x) | ||
| calculate_pr = lambda x: self._invertor.pr(c, x) # noqa: E731 |
There was a problem hiding this comment.
This one also better to put it in the map directly? Or maybe as an explicit function
| eq.x.setValue(x) | ||
| eq.sigma.setValue(sigma) | ||
| f = lambda x, sigma: sqrt(e ** (-0.5 * (x / sigma) ** 2)) | ||
| f = lambda x, sigma: sqrt(e ** (-0.5 * (x / sigma) ** 2)) # noqa: E731 |
There was a problem hiding this comment.
Here in the tests they are quite readable and not doing much harm so I suggest leaving with noqa
Noted. I will address these later in the afternoon. |
|
@sbillinge I will close this PR and make separate PRs address each file or so. I will refer back to your in-line comments. |
Tests pass: