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

Snake case consistency #242

Merged
merged 4 commits into from
May 9, 2024
Merged

Snake case consistency #242

merged 4 commits into from
May 9, 2024

Conversation

sebastiangrimberg
Copy link
Contributor

@sebastiangrimberg sebastiangrimberg commented May 2, 2024

We have slowly moved towards consistent use of snake case across all variable naming, especially in the higher level classes and functions where variable names are longer and more descriptive. Though not explicitly enforced in the developer documentation or in PR reviews, this PR goes through some old code and updates variable names to be match the guidance.

The same change is also made for some output variables, namely the field names in the ParaView visualization files.

One name left unchanged is iodata, which could/should be renamed to io_data. I didn't have particular feelings either way, but if changing it is preferable I can make that change here as well.

Note: Based on #240

@sebastiangrimberg sebastiangrimberg added the minor A minor issue or improvement label May 2, 2024
@sebastiangrimberg sebastiangrimberg requested a review from hughcars May 6, 2024 15:43
Copy link
Collaborator

@hughcars hughcars left a comment

Choose a reason for hiding this comment

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

Two tiny clarifications, but LGTM 🐍

idx, Timer::Duration(Timer::Now() - t0).count());

// Form and solve the linear system for a prescribed current on the specified source.
Mpi::Print("\n");
A[step].SetSize(RHS.Size());
A[step].UseDevice(true);
A[step] = 0.0;
curlcurlop.GetExcitationVector(idx, RHS);
curlcurl_op.GetExcitationVector(idx, RHS);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not curl_curl_op?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could go either way on this really but curlcurl seemed OK as a variable name. The big gain is separating op from the core subject.

Comment on lines +572 to +573
S_ij *= std::exp(1i * src_data.kn0 * src_data.d_offset);
S_ij *= std::exp(1i * data.kn0 * data.d_offset);
Copy link
Collaborator

Choose a reason for hiding this comment

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

So the convention (which I agree with), is not snake once within a subscript _. Namely, not S_i_j.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, double subscripts make more sense to me, S_i_j reads S-sub-i-sub-j which is different than S_ij. S_ij is closer to how you'd actually write it in tex.

Base automatically changed from sjg/bdr-postpro-dev to main May 9, 2024 19:37
@sebastiangrimberg sebastiangrimberg merged commit 878fd1e into main May 9, 2024
17 checks passed
@sebastiangrimberg sebastiangrimberg deleted the sjg/snake-case-dev branch May 9, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor A minor issue or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants