-
Notifications
You must be signed in to change notification settings - Fork 182
[Documentation] Add comprehensive argument documentation for pwmat FP style with correct parameter validation #1793
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
base: devel
Are you sure you want to change the base?
Changes from 3 commits
3c0d836
481698d
ffa5f22
64e17f5
c9ace72
e4a3bbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -923,6 +923,58 @@ def fp_style_custom_args() -> list[Argument]: | |||
| ] | ||||
|
|
||||
|
|
||||
| # pwmat | ||||
| def fp_style_pwmat_args() -> list[Argument]: | ||||
| """Arguments for FP style pwmat. | ||||
|
|
||||
| Returns | ||||
| ------- | ||||
| list[dargs.Argument] | ||||
| list of pwmat fp style arguments | ||||
| """ | ||||
| doc_fp_pp_path = "Directory of psuedo-potential file to be used for 02.fp exists." | ||||
| doc_fp_pp_files = "Psuedo-potential file to be used for 02.fp. Note that the order of elements should correspond to the order in type_map." | ||||
| doc_fp_incar = "Path to the pwmat input file template (etot.input). If provided, this file will be used directly instead of generating from fp_params or user_fp_params." | ||||
| doc_user_fp_params = "Parameters for pwmat calculation. When user_fp_params is set, the settings in fp_params will be ignored. This allows direct specification of all pwmat input parameters." | ||||
| doc_fp_params = ( | ||||
| "Parameters for pwmat calculation. It has lower priority than user_fp_params." | ||||
| ) | ||||
| doc_node1 = "node1 in pwmat (number of MPI processes for the first direction)." | ||||
| doc_node2 = "node2 in pwmat (number of MPI processes for the second direction)." | ||||
| doc_in_atom = "Path to atom configuration file (in.atom) for pwmat." | ||||
| doc_ecut = "Energy cutoff (ecut) in pwmat." | ||||
| doc_e_error = "Energy convergence criterion (e_error) in pwmat." | ||||
| doc_rho_error = "Density convergence criterion (rho_error) in pwmat." | ||||
| doc_kspacing = "The spacing between kpoints. Helps to determine KPOINTS in pwmat." | ||||
| doc_icmix = "Mixing method parameter (icmix) in pwmat for SCF iteration." | ||||
| doc_smearing = "Smearing method for electronic states in pwmat." | ||||
| doc_sigma = "Smearing width parameter (sigma) in pwmat." | ||||
| doc_flag_symm = "Symmetry flag (flag_symm) in pwmat. Can be 0, 1, 2, or 3." | ||||
| doc_user_pwmat_params = "Additional user-defined pwmat parameters that will override the generated input." | ||||
|
|
||||
| args = [ | ||||
| Argument("node1", int, optional=False, doc=doc_node1), | ||||
| Argument("node2", int, optional=False, doc=doc_node2), | ||||
| Argument("in.atom", str, optional=False, doc=doc_in_atom), | ||||
| Argument("ecut", float, optional=False, doc=doc_ecut), | ||||
| Argument("e_error", float, optional=False, doc=doc_e_error), | ||||
| Argument("rho_error", float, optional=False, doc=doc_rho_error), | ||||
| Argument("kspacing", float, optional=False, doc=doc_kspacing), | ||||
| Argument("icmix", float, optional=True, doc=doc_icmix), | ||||
| Argument("smearing", int, optional=True, doc=doc_smearing), | ||||
| Argument("sigma", float, optional=True, doc=doc_sigma), | ||||
| Argument("flag_symm", [int, str], optional=True, doc=doc_flag_symm), | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! Made |
||||
| Argument("user_pwmat_params", dict, optional=True, doc=doc_user_pwmat_params), | ||||
| ] | ||||
| return [ | ||||
| Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path), | ||||
| Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files), | ||||
| Argument("fp_incar", str, optional=True, doc=doc_fp_incar), | ||||
| Argument("fp_params", dict, args, [], optional=True, doc=doc_fp_params), | ||||
| Argument("user_fp_params", dict, optional=True, doc=doc_user_fp_params), | ||||
|
||||
| user_dict = fp_params["user_pwmat_params"] |
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.
Added user_pwmat_params to the fp_params structure. It's used in pwmat.py:181 with conditional checking. Commit: e4a3bbc
Outdated
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.
@copilot I am wondering if user_fp_params is just an alias of fp_params or not. args should also be defined for user_fp_params.
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.
Added proper argument definitions for user_fp_params. It has the same core parameters as fp_params but excludes icmix/smearing/sigma (not used in that code path) and makes flag_symm required (accessed directly). The two paths have different behaviors which are now properly reflected in the argument structure. Commit: e4a3bbc
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,6 +163,8 @@ | |
| / "param_C4H16N4_deepmd-kit-2.0.1.json", | ||
| ), | ||
| (run_jdata, p_examples / "run" / "dprc" / "generator.json"), | ||
| # pwmat test file from tests/generator | ||
| (run_jdata, Path(__file__).parent / "generator" / "param-pyridine-pwmat.json"), | ||
|
||
| # machines | ||
| (run_mdata, p_examples / "machine" / "DeePMD-kit-2.x" / "lebesgue_v2_machine.json"), | ||
| (run_mdata, p_examples / "machine" / "DeePMD-kit-1.x" / "machine-local.json"), | ||
|
|
||
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.
@copilot I don't think these are used.
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.
You're correct! Removed
icmix,smearing, andsigmafromuser_fp_paramsstructure since they're hardcoded asNonein theuser_fp_paramscode path (lines 3057-3059). They remain infp_paramsstructure since they are used via_make_smearing(). Commit: e4a3bbc