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

Hd codes/issue4655 #4702

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

HD-Codes
Copy link

@HD-Codes HD-Codes commented Sep 5, 2024

Fixes #4655

Changes made in this Pull Request:

  • Fixed the use of mutable default arguments in package\MDAnalysis\__init__.py to avoid potential bugs.
  • Moved the logger initialization to after all import statements in package\MDAnalysis\__init__.py to comply with PEP 8 guidelines.
  • Removed unused imports in package\MDAnalysis\__init__.py and added relevant ones to __all__ for better code organization and adherence to public API conventions.

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Developers certificate of origin

- Added necessary imports to `__all__` to ensure they are part of the public API and avoid F401 warnings.
- Removed unnecessary imports that were not being used in the code.
- Moved logger initialization to after imports, ensuring compliance with PEP 8 guidelines and resolving F821 (undefined logger) error.
- Ensured that all module-level imports remain at the top of the file as per PEP 8 to avoid E402 errors.

This commit cleans up the codebase to resolve Ruff linter warnings and ensures better readability and compliance with Python best practices.
@pep8speaks
Copy link

pep8speaks commented Sep 5, 2024

Hello @HD-Codes! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-09-05 21:37:13 UTC

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS as part of this PR.

Copy link

github-actions bot commented Sep 5, 2024

Linter Bot Results:

Hi @HD-Codes! Thanks for making this PR. We linted your code and found the following:

Some issues were found with the formatting of your code.

Code Location Outcome
main package ⚠️ Possible failure
testsuite ✅ Passed

Please have a look at the darker-main-code and darker-test-code steps here for more details: https://github.com/MDAnalysis/mdanalysis/actions/runs/10728574031/job/29753372959


Please note: The black linter is purely informational, you can safely ignore these outcomes if there are no flake8 failures!

- Reformatted long lines to comply with the 88-character limit (E501).
- Removed trailing whitespace from lines (W291).
- Updated the `__all__` list for better readability and code style compliance.
- Adjusted the logger and import formatting to improve code organization.

This commit resolves the issues raised by the Linter Bot and ensures that the code adheres to PEP 8 standards.
@orbeckst
Copy link
Member

orbeckst commented Sep 9, 2024

Hello @HD-Codes , thanks for your contribution. I don't see where you're addressing #4655 in your PR. Can you please point it out?

The current PR proposes code clean-up in __init__.py. I'd suggest you raise an issue first to see if this is considered a problem and then submit a PR that references the issue. Generally we prefer PRs to be focused on a single issue and not intermixed with code clean-up as this makes the diffs harder to read. In order to make best use of reviewers' time we want to review a single issue.

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.

MAINT: a few mutable default arguments are back
3 participants