Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
nstarman
left a comment
There was a problem hiding this comment.
Thanks @draghuram! Right approach. Some comments.
| for level in logging_levels: | ||
| globals()[level] = getattr(logging, level) | ||
| __all__ += logging_levels | ||
| __all__ += logging_levels # noqa: PLE0605 |
There was a problem hiding this comment.
@nstarman, Do you mean as follows?
__all__ += (logging_levels := ...
I tried this and we still get ruff warning. Are you ok to keep the original change?
There was a problem hiding this comment.
Hm. I don't think we should be getting a ruff warning from that. As in, if we are there's a bug in ruff!
__all__ = ["a", "b"]
__all__ += (logging_levels := ["c", "d"])Should be identical to
__all__ = ["a", "b"]
__all__ += ["c", "d"]from the perspective of __all__.
There was a problem hiding this comment.
I opened astral-sh/ruff#7672.
But it's fine to add the noqa for now.
There was a problem hiding this comment.
Thanks. In that case, the PR can be merged assuming there are no other concerns? I did make the other change requested already.
astropy/modeling/projections.py
Outdated
|
|
||
|
|
||
| __all__ = [ | ||
| __all__ = [ # noqa: PLE0605 |
There was a problem hiding this comment.
Instead of this, please split the __all__ to
__all__ = [...]
__all__ += + list(map("_".join, product(["Pix2Sky", "Sky2Pix"], chain(*_PROJ_NAME_CODE)))) # noqa: PLE0605
There was a problem hiding this comment.
@WilliamJamieson, do you want to keep this dynamic or actually enumerate the list for static purposes?
Ruff is getting confused by dynamic computation of "__all__" so for now, the check is ignored using "noqa" comment. Signed-off-by: Raghuram Devarakonda <[email protected]>
f2c0d4a to
3e3f9c9
Compare
|
Thanks, all! |

Ruff is getting confused by dynamic computation of
__all__so for now, the check is ignored using "noqa" comment.Description
This pull request is to address the ruff error PLE0605.