Skip to content

style: set the line width limit to 79 #164

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

Merged
merged 4 commits into from
Feb 10, 2025
Merged

style: set the line width limit to 79 #164

merged 4 commits into from
Feb 10, 2025

Conversation

ycexiao
Copy link
Collaborator

@ycexiao ycexiao commented Feb 9, 2025

close #163

Copy link

codecov bot commented Feb 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.85%. Comparing base (fa1dd17) to head (116fe95).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #164   +/-   ##
=======================================
  Coverage   96.85%   96.85%           
=======================================
  Files          18       18           
  Lines         795      795           
=======================================
  Hits          770      770           
  Misses         25       25           
Files with missing lines Coverage Δ
tests/test_morphchain.py 96.96% <100.00%> (ø)
tests/test_morphpdftordf.py 96.00% <100.00%> (ø)
tests/test_morphrdftopdf.py 96.00% <100.00%> (ø)
tests/test_morphresolution.py 95.83% <100.00%> (ø)
tests/test_morphrgrid.py 98.33% <100.00%> (ø)
tests/test_morphscale.py 95.65% <100.00%> (ø)
tests/test_morphshape.py 95.83% <100.00%> (ø)
tests/test_morphshift.py 96.15% <100.00%> (ø)
tests/test_morphsmear.py 96.42% <100.00%> (ø)
tests/test_morphstretch.py 97.22% <100.00%> (ø)
... and 6 more

@ycexiao ycexiao marked this pull request as ready for review February 9, 2025 23:01
@ycexiao
Copy link
Collaborator Author

ycexiao commented Feb 9, 2025

@sbillinge @bobleesj It's ready for review. Please see if it is right.

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

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

looks good. Please see comments.

news/line79.rst Outdated

**Changed:**

* reduce the line width limit to 79
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be considered a fix, not a change. A change is reserved for a change in behavior that a user might need to know about.

@@ -165,15 +166,25 @@ def _spheroidalCF2(r, psize, axrat):
f1 = (
1
- 3 * r / (4 * d * v) * (1 - r2 / (4 * d2) * (1 + 2.0 / (3 * v2)))
- 3 * r / (4 * d) * (1 - r2 / (4 * d2)) * v / sqrt(1 - v2) * atanh(sqrt(1 - v2))
- 3
Copy link
Contributor

Choose a reason for hiding this comment

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

this line is probably more readable longer. I would return it back and # noqa it I htink it is 501 code.

)

r = rx[numpy.logical_and(rx > v * psize, rx <= psize)]
r2 = r * r
f2 = (
(
3 * d / (8 * r) * (1 + r2 / (2 * d2)) * sqrt(1 - r2 / d2)
- 3 * r / (4 * d) * (1 - r2 / (4 * d2)) * atanh(sqrt(1 - r2 / d2))
- 3
Copy link
Contributor

Choose a reason for hiding this comment

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

see above.

@@ -190,15 +201,26 @@ def _spheroidalCF2(r, psize, axrat):
f1 = (
1
- 3 * r / (4 * d * v) * (1 - r2 / (4 * d2) * (1 + 2.0 / (3 * v2)))
- 3 * r / (4 * d) * (1 - r2 / (4 * d2)) * v / sqrt(v2 - 1) * atan(sqrt(v2 - 1))
- 3
Copy link
Contributor

Choose a reason for hiding this comment

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

and same for all these

@ycexiao
Copy link
Collaborator Author

ycexiao commented Feb 10, 2025

@sbillinge news.rst has modified. Now I understand changed section is designed for users instead of maintainers to read.

About the equation formatting. I found it will be more readable if we use less space or new-line and only separate operations with the lowest priority. Please check if it is suitable.

@sbillinge sbillinge merged commit 6526430 into diffpy:main Feb 10, 2025
5 checks passed
@ycexiao ycexiao deleted the line_width branch March 14, 2025 16:23
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.

style: set the line width limit to 79
2 participants