Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
582 stars 342 forks source link

Adopt PEP-8 for whitespace recommendations #1584

Closed ischoegl closed 10 months ago

ischoegl commented 10 months ago

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:

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

codecov[bot] commented 10 months ago

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

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

ischoegl commented 10 months ago

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