Skip to content
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

Remove __all__ use in PICMI and PyPIConGPU #5014

Open
BrianMarre opened this issue Jul 31, 2024 · 2 comments
Open

Remove __all__ use in PICMI and PyPIConGPU #5014

BrianMarre opened this issue Jul 31, 2024 · 2 comments
Assignees
Labels
good first issue signal new contributors where they can start PICMI pypicongpu and picmi related refactoring code change to improve performance or to unify a concept but does not change public API

Comments

@BrianMarre
Copy link
Member

PICMI and PyPIConGPU __init__.py files specify an __all__ variable that is supposed to overwrite the default behavior of from picongpu.picmi import *, but do not actually diverge from the default behavior.

We should therefore not specify them at all.

@BrianMarre
Copy link
Member Author

@chillenzer pre-commit removes all import statements from __init__.py if we do not include an __all__ is this intended behaviour?

@chillenzer
Copy link
Contributor

chillenzer commented Aug 8, 2024

Of course, it's not pre-commit immediately but ruff. These are the pertinent pages: https://docs.astral.sh/ruff/rules/unused-import/ and https://docs.astral.sh/ruff/settings/#lint_ignore-init-module-imports

As the latter is already deprecated, you can decide for yourself if adding a redundant import ... as ..., a redundant __all__ or #noqa unused-import (on the file level, of course) is the least bitter pill. I would personally say the former is still slightly easier to maintain but not by as large of a margin as before.

@steindev steindev added refactoring code change to improve performance or to unify a concept but does not change public API good first issue signal new contributors where they can start PICMI pypicongpu and picmi related labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue signal new contributors where they can start PICMI pypicongpu and picmi related refactoring code change to improve performance or to unify a concept but does not change public API
Projects
None yet
Development

No branches or pull requests

3 participants