New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-36472: Fix a bug in _validateGalsimInterpolant #17
Conversation
297f783
to
b9dd883
Compare
b9dd883
to
b12e2d9
Compare
Problems with GHA I guess. Linting check is not getting triggered. |
b12e2d9
to
000ad7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are a big improvement, but the method itself is in the wrong place. Also, thanks for updating the workflow!
@@ -33,8 +33,8 @@ | |||
|
|||
|
|||
class PiffPsfDeterminerConfig(BasePsfDeterminerTask.ConfigClass): | |||
def _validateGalsimInterpolant(name: str) -> bool: # noqa: N805 | |||
"""A helper function to validate the GalSim interpolant at config time. | |||
def validateGalsimInterpolant(name: str) -> bool: # noqa: N805 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think this should be a private method (leading underscore) even though it is used in the tests.
Also, I don't know how this works as a static method without the @staticmethod
decorator... or wait, it's because it's a local method, I guess, that just happens to work because it's at the class scope.
Recommendation: remove this from the class level, the check function should be outside the class (at line 33), and have a leading underscore. The noqa
can then be removed and the scope will make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Eli. Done. My rationale for making it a public method was so that the user could check for themselves whether a string is valid or not, without having to start a processing job. But one could also argue that that is conveyed in the docstring accurately.
class PiffPsfDeterminerConfig(BasePsfDeterminerTask.ConfigClass): | ||
def _validateGalsimInterpolant(name: str) -> bool: # noqa: N805 | ||
"""A helper function to validate the GalSim interpolant at config time. | ||
def validateGalsimInterpolant(name: str) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be a private method with a leading underscore. Thanks!
2dad655
to
245e7d9
Compare
245e7d9
to
c9f52b7
Compare
No description provided.