-
Notifications
You must be signed in to change notification settings - Fork 317
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
chore: reformat multi-line statements #2379
chore: reformat multi-line statements #2379
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2379 +/- ##
=========================================
+ Coverage 68.4% 75.9% +7.5%
=========================================
Files 294 294
Lines 59390 61639 +2249
=========================================
+ Hits 40652 46842 +6190
+ Misses 18738 14797 -3941
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triple-check of changes complete, with a few notes below. This PR highlighted a few places where a trailing ,
was originally used, sometimes to try and construct a tuple
type. I'll follow this up with a possible correction and amend .git-blame-ignore-revs
.
if i == 0 or nstrm > 0 and not reachinput or isfropt <= 1: | ||
if i == 0 or (nstrm > 0 and not reachinput) or isfropt <= 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this one was an autofix for RUF021
shape = tuple( | ||
nodes, | ||
) | ||
shape = tuple(nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be corrected to shape = (nodes,)
(it was probably originally shape = tuple(nodes,)
which is not correct)
delr=np.ones( | ||
self.ncol, | ||
), | ||
delr=np.ones(self.ncol), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the code was probably originally np.ones(self.ncol,)
in attempt to specify a tuple (which would be done with np.ones((self.ncol,))
). Fortunately, this is harmless, as numpy's shape can be an integer to mean the same as a tuple of one integer. No change is recommended here.
top = np.ones((nnodes)) | ||
botm = np.ones((nnodes)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should be corrected to np.ones((nnodes,))
(or simply np.ones(nnodes)
)
This PR refactors some multi-line statements. This was mostly automated by temporarily toggling this control in pyproject.toml:
then selecting some commits that condense multi-line statements to single, while rejecting other statements that are better represented over multiple lines. There was no exact rule-of-thumb for the process, except to try and maintain the same style in surrounding code blocks. Class constructors or instantiations of some classes with many parameters are kept as multi-line.
Note that while there are over 2300 fewer lines with this PR, there are no functional changes.