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

Modified the global variable reference in the file istate_charge.cpp #3065

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

AsTonyshment
Copy link
Collaborator

  • Change all global variables to function parameter inputs.
  • Modified the file using the corresponding function.

@kirk0830
Copy link
Collaborator

Hello, could you please link this PR to one issue, in which considerations of this code change are introduced and explained? So that more maintainers can understand your PR quickly. Thanks!

@kirk0830
Copy link
Collaborator

I think I have understood your PR, it is, decouple as much as possible functions with GlobalV. While I have no idea about evaluating this change. Use of GlobalC is rather needed to eliminate all over codes, but for GlobalV I am not sure.
My concern would be the inflation of parameter list, instead a better choice is design an interface between that class with GlobalV, like Init() or configure() etc, so that you can fetch variables by this->.
One possible manual might be: https://ucoyxk075n.feishu.cn/docx/J0BCdXDnwo2OlGxi7KDcVDRWnCh#HfSMdtOO9omWHFxk3e5cNgT0ncb

@AsTonyshment
Copy link
Collaborator Author

I am rather new to this project and still have a lot to learn about. I will take a view into your consideration as far as possible.

Copy link
Collaborator

@dyzheng dyzheng left a comment

Choose a reason for hiding this comment

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

You have formatted the file esolver_ks_lcao_elec.cpp, it is hard to find which line changed actually.

@haozhihan
Copy link
Collaborator

You have formatted the file esolver_ks_lcao_elec.cpp, it is hard to find which line changed actually.

@dyzheng Do you suggest not formatting the original file?
Or is there any other way to solve this problem? For example, first submit a commit for formatting and then submit a commit for the modified content.

@dyzheng
Copy link
Collaborator

dyzheng commented Oct 24, 2023

You have formatted the file esolver_ks_lcao_elec.cpp, it is hard to find which line changed actually.

@dyzheng Do you suggest not formatting the original file? Or is there any other way to solve this problem? For example, first submit a commit for formatting and then submit a commit for the modified content.

I suggest to point out which line has been modified in this PR if the format of original file has been changed.

Copy link
Collaborator

@dyzheng dyzheng left a comment

Choose a reason for hiding this comment

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

Removing the directly using of global variable comply with ABACUS programming guidelines.
Thanks for your contribution!

@dyzheng
Copy link
Collaborator

dyzheng commented Oct 31, 2023

Please fix the conflicts.

@dyzheng dyzheng merged commit 8b98951 into deepmodeling:develop Nov 1, 2023
11 checks passed
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.

None yet

4 participants