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

Adopt PEP-8 for whitespace recommendations #1584

Merged
merged 3 commits into from
Aug 13, 2023
Merged

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Aug 11, 2023

Changes proposed in this pull request

The current style guide for whitespace (per CONTRIBUTING.md) recommends:

  • Use whitespaces to improve code readability (examples: after commas; before and
    after mathematical operators (+/-/*// except ^), binary operators
    (&&/||/...), and comparisons (</>/==/...); before and after equality

does not follow PEP-8 recommendations. This PR updates Cantera style guide recommendations to become consistent.

In addition:

  • Update Python documentation instructions
  • Fix typo in SConstruct

If applicable, fill in the issue number this pull request is fixing

Closes Cantera/enhancements#184

If applicable, provide an example illustrating new features this pull request is introducing

Per PEP-8:

# Correct:
i = i + 1
submitted += 1
x = x*2 - 1
hypot2 = x*x + y*y
c = (a+b) * (a-b)

and

# Wrong:
i=i+1
submitted +=1
x = x * 2 - 1  # <-- current Cantera style 
hypot2 = x * x + y * y  # <-- current Cantera style 
c = (a + b) * (a - b)  # <-- current Cantera style 

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@ischoegl ischoegl requested a review from a team August 11, 2023 14:44
@ischoegl ischoegl force-pushed the pep-8 branch 2 times, most recently from 150f303 to d2982b3 Compare August 11, 2023 15:29
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #1584 (590ac73) into main (4b30fa7) will decrease coverage by 0.01%.
Report is 4 commits behind head on main.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1584      +/-   ##
==========================================
- Coverage   70.51%   70.51%   -0.01%     
==========================================
  Files         379      379              
  Lines       59118    59117       -1     
  Branches    21237    21237              
==========================================
- Hits        41686    41685       -1     
  Misses      14359    14359              
  Partials     3073     3073              

see 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks, @ischoegl. Just a couple of comments for your consideration.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
@ischoegl
Copy link
Member Author

Thanks, @speth. I believe this is ready to merge.

@ischoegl ischoegl requested a review from speth August 13, 2023 11:32
@speth speth merged commit ef9121f into Cantera:main Aug 13, 2023
41 of 42 checks passed
@ischoegl ischoegl deleted the pep-8 branch August 13, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Adopt PEP-8 for whitespace recommendations
2 participants