Repository navigation
Conversation
mohanchen
approved these changes
Oct 10, 2026
Critsium-xy
added a commit
to mohanchen/abacus-mc
that referenced
this pull request
Oct 10, 2026
Resolve the conflict with deepmodeling#8115, which split unitcell.cpp into unitcell_index.cpp, unitcell_stats.cpp and unitcell_setup.cpp: take the upstream unitcell.cpp and port this branch's std::vector resize() change for iat2it/iat2ia into unitcell_index.cpp. Update the stale ownership comments in test_unitcell_index.cpp accordingly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 pure code-motion refactor plus new unit tests, with no behavior change.
Unit Tests and/or Case Tests for my changes
cmake -B build -DBUILD_TESTING=ON -DENABLE_MPI=ON ... && cmake --build build -j30OMP_NUM_THREADS=1 ctest --test-dir build -V -R MODULE_CELL_unitcell_index_testOMP_NUM_THREADS=1 ctest --test-dir build -R MODULE_CELLpython3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format textpython3 tools/03_code_analysis/code_quality_score.py <changed cpp/h files>MODULE_CELL_unitcell_index_test4/4 passed; allMODULE_CELL*tests 47/47 passed; governance check reported only non-blocking warnings (see Governance Notes); quality score 5/5 files passing (average 91.6, minimum 67 >= 60 pass line).source/source_cell/test/test_unitcell_index.cpp(named per thetest_<module_name>.cpprule), 4 TEST_F cases coveringset_iat2itia(including thedelete[]+new[]re-entry path) andset_iat2iwtwith npol=1 and npol=2. The fixture uses a stackUnitCellwithset_atom_flag=true; it does not manually freeatoms(owned by~UnitCell()) oriat2it/iat2ia(owned by the internalStatisticsmember), per AGENTS.md.What's changed?
source/source_cell/unitcell.cpp(349 lines) by functionality, code motion only, no logic changes:unitcell.cppkeeps the constructor/destructor.unitcell_index.cppholds the indexing helpersset_iat2itia()andset_iat2iwt().unitcell_stats.cppholds the per-species counting helpersget_atom_Counts(),get_orbital_Counts(),get_lnchi_Counts().unitcell_setup.cppholds the setup routinessetup_cell()andsetup_from_input().cellOBJECT library and the six test CMakeLists that compileunitcell.cppdirectly (cell_simple_srcs,MODULE_CELL_read_atoms_helper_test,test_pw,source_md/test,module_deepks/test,module_pwdft/testx2) now register the three new files, so no target loses symbols.MODULE_CELL_unitcell_index_test(linkscell_info, plus../magnetism.cppfor theMagnetismctor/dtor symbols).Governance Notes
docs/parameters.yamlanddocs/advanced/input_files/input-main.mddo not require updates.source_cell; all public interfaces (declarations inunitcell.h) are unchanged, so callers and existing mocks (e.g.test/support/mock_unitcell.cpp) are unaffected.GlobalVwarnings onunitcell_setup.cppare migration-neutral (net_delta=0): the lines were moved verbatim fromunitcell.cpp.unitcell_setup.cpp(17-parametersetup_cell,GlobalVuses) are pre-existing debt carried by the moved code, not introduced by this PR.