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

Use PEP8 names #84

Merged
merged 24 commits into from
Jan 6, 2023
Merged

Use PEP8 names #84

merged 24 commits into from
Jan 6, 2023

Conversation

sajith
Copy link
Member

@sajith sajith commented Jan 5, 2023

Issue is #61, and here's PEP8 for reference: https://peps.python.org/pep-0008/

These are the changes:

  • A workflow step has been added to run flake8 with pep8-naming plugin.
  • sdx.pce.LoadBalancing.TE_Solver.py have been renamed to sdx.pce.load_balancing.te_solver.py, following the convention that module names should be in lowercase.
  • TE_Solver class is now TESolver, following the PEP8 recommendation that class names should follow CapWords convention.
  • Similarly, Test_TE_Solver class is TESolverTests.
  • sdx.pce.Utility and the files inside of it have been similarly renamed.
  • sdx.pce.Utilities.global_names.py has been renamed to sdx.pce.utils.constants.py, because the latter name is a little more accurate.
  • Constants have been up-cased following PEP8 recommendation, and they're now wrapped in a Constants class.

sajith added 24 commits January 5, 2023 09:44
Per https://peps.python.org/pep-0008/#package-and-module-names

> Modules should have short, all-lowercase names. Underscores can be
> used in the module name if it improves readability. Python packages
> should also have short, all-lowercase names, although the use of
> underscores is discouraged.
PEP8 says: Modules should have short, all-lowercase names. Underscores
can be used in the module name if it improves readability.

https://peps.python.org/pep-0008/#package-and-module-names
See https://peps.python.org/pep-0008/#constants:

> Constants are usually defined on a module level and written in all
> capital letters with underscores separating words. Examples include
> MAX_OVERFLOW and TOTAL.
@sajith sajith linked an issue Jan 5, 2023 that may be closed by this pull request
@sajith sajith added enhancement New feature or request epic_pce labels Jan 5, 2023
@sajith sajith self-assigned this Jan 5, 2023
@sajith sajith requested review from YufengXin and congwang09 January 5, 2023 21:43
@sajith sajith marked this pull request as ready for review January 5, 2023 21:43
@sajith sajith merged commit 85d3a27 into main Jan 6, 2023
@sajith sajith deleted the 61.pep8-module-names branch January 6, 2023 15:03
@sajith sajith mentioned this pull request Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request epic_pce
Projects
Development

Successfully merging this pull request may close these issues.

Use PEP-8 names
2 participants