Repository navigation
Conversation
mohanchen
self-requested a review
October 17, 2026 13:11
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
No linked issue. This is a focused follow-up to closed PR #8155, addressing the maintainer request to reduce the size of
dftu_base_io.cppand resubmit the reader refactor when ready.Unit Tests and/or Case Tests for my changes
cmake --build build --target MODULE_PW_dftu_base_test -j4cmake --build build --target module_pwdft MODULE_DFTU_base_io MODULE_DFTU_op -j4cmake --build build --target io_input MODULE_IO_input_test_para -j4OMP_NUM_THREADS=1 ctest --test-dir build --output-on-failure -R '^(MODULE_PW_dftu_base_test|MODULE_DFTU_base_io|MODULE_DFTU_op|MODULE_IO_input_test_para)$'git diff --check upstream/develop...HEADpython3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format textpython3 tools/03_code_analysis/code_quality_score.py --format json source/source_pw/module_pwdft/dftu_base_io.cpp source/source_pw/module_pwdft/dftu_base_io_read.cppgit diff --checkpassed.dftu_base_io.cppscored 0 (raw score -52), was 1345 lines, andread_occup_mhad cyclomatic complexity 40. After extraction,dftu_base_io.cppis 996 lines and scores 6;dftu_base_read.cppis below 500 lines and scores 93; their average is 49.5.init_occ_matINPUT help metadata; generated documentation is not edited directly.What's changed?
read_occup_mand its parser helpers intodftu_base_read.cpp, following the repository's<module>_read.cppnaming pattern, with explicit PW and LCAO test linkage.occ_mat.txt; legacyAtom=/L=/spin=input is rejected with a filename-and-line diagnostic.char word[20]token buffer andignore(150, '\n')calls with line-basedstd::stringparsing.OccupationMatrix.init_occ_matandinit_chgreader arguments; file selection remains the caller's responsibility.dm_onsite.txtfallback and update theinit_occ_mathelp text to document the compact-only input contract.Known Limitation and Follow-up
init_chg = filerequirement for a DFT+U occupation-matrix file. Ifocc_mat.txtis absent, ABACUS still terminates beforeread_occup_m()is called.init_chg = fileto continue without an occupation-matrix file requires a separate implementation that can initialize or reconstruct the DFT+U occupation matrix safely from the available calculation state.Governance Notes
init_occ_mathelp metadata now documents the compact-only file format and current filename search order. Generated YAML/Markdown documentation is intentionally not committed.GlobalV::MY_RANKandGlobalV::ofs_runningwere moved withread_occup_m; PR-level added=2, removed=2, net=0.