Skip to content

Reorganize the tools folder#7470

Open
mohanchen wants to merge 3 commits into
deepmodeling:developfrom
mohanchen:20260616
Open

Reorganize the tools folder#7470
mohanchen wants to merge 3 commits into
deepmodeling:developfrom
mohanchen:20260616

Conversation

@mohanchen

Copy link
Copy Markdown
Collaborator

…alysis script

This commit consolidates three previous commits (#1, #2, #3) into a single comprehensive refactor of the tools/ directory, addressing both organizational structure and a path-related bug in the code analysis script.

  1. tools/ directory reorganization

    • Group all numerical atomic orbital (NAO) generation tools under 01_NAO_generation/, including: * SIAB/ (Simulated Annealing method in C++) * pytorch/ and pytorch_dpsi/ (PyTorch gradient methods) * pytorch_gradient_source/ (original PyTorch implementation) * lcao_bash/ and abfs_bash/ (bash-based orbital generators) * qo/ (quasiatomic orbital generation) * Generate_Orbital_AllInOne.sh (main entry script) * examples/ (example input files)
    • Move all post-processing and visualization tools under 02_postprocessing/:
      • rt-tddft-tools/, stm/, average_pot/, selective_dynamics/, plot-tools/
    • Place source code analysis tools under 03_code_analysis/
    • Rename windows/ to 04_windows_installation/ for consistency
    • Use numerical prefixes (01_, 02_, 03_, 04_) to define a clear order
    • Use git mv to preserve file history throughout the refactor
  2. New tools/README.md

    • Add a comprehensive README with directory tree, quick start guide and tool descriptions
  3. Fix generate_include_analysis.py path bug

    • The script computed repo_root using os.path.dirname(script_dir), assuming the script lived in tools/. After moving to tools/03_code_analysis/, this resolved to tools/ instead of the repository root, causing os.walk to find no source files.
    • Update to os.path.dirname(os.path.dirname(script_dir)) to correctly resolve the repository root from the new script location.

Combined previous commits:
6e3b7954c add code analysis python file
546d7cd76 update tools
92094b81d update

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

…alysis script

This commit consolidates three previous commits (#1, #2, deepmodeling#3) into a single
comprehensive refactor of the tools/ directory, addressing both
organizational structure and a path-related bug in the code analysis script.

1. tools/ directory reorganization
   - Group all numerical atomic orbital (NAO) generation tools under
     01_NAO_generation/, including:
       * SIAB/ (Simulated Annealing method in C++)
       * pytorch/ and pytorch_dpsi/ (PyTorch gradient methods)
       * pytorch_gradient_source/ (original PyTorch implementation)
       * lcao_bash/ and abfs_bash/ (bash-based orbital generators)
       * qo/ (quasiatomic orbital generation)
       * Generate_Orbital_AllInOne.sh (main entry script)
       * examples/ (example input files)
   - Move all post-processing and visualization tools under
     02_postprocessing/:
       * rt-tddft-tools/, stm/, average_pot/, selective_dynamics/, plot-tools/
   - Place source code analysis tools under 03_code_analysis/
   - Rename windows/ to 04_windows_installation/ for consistency
   - Use numerical prefixes (01_, 02_, 03_, 04_) to define a clear order
   - Use git mv to preserve file history throughout the refactor

2. New tools/README.md
   - Add a comprehensive README with directory tree, quick start guide
     and tool descriptions

3. Fix generate_include_analysis.py path bug
   - The script computed repo_root using os.path.dirname(script_dir),
     assuming the script lived in tools/. After moving to
     tools/03_code_analysis/, this resolved to tools/ instead of the
     repository root, causing os.walk to find no source files.
   - Update to os.path.dirname(os.path.dirname(script_dir)) to correctly
     resolve the repository root from the new script location.

Combined previous commits:
  6e3b7954c add code analysis python file
  546d7cd76 update tools
  92094b81d update
@mohanchen mohanchen requested a review from Critsium-xy June 16, 2026 04:57
@mohanchen mohanchen added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Jun 16, 2026
@Critsium-xy

Copy link
Copy Markdown
Collaborator

This PR has one major problem: the pathes of file in some docs and files are not changed.

For example:

  1. docs/advanced/windows_installer.md
  2. source/source_io/module_qo/to_qo_kernel.cpp:417
  3. source/source_basis/module_nao/atomic_radials.cpp:117-118, 287-288 (Not important)

No other problems exist.

mohanchen and others added 2 commits June 16, 2026 13:27
…ctory restructuring

After the tools/ directory reorganization, several path references in documentation
and source code were still pointing to the old directory structure. This commit
updates all hardcoded paths to match the new organization:

1. docs/advanced/windows_installer.md
   - tools/windows/ → tools/04_windows_installation/ (3 occurrences)

2. docs/advanced/input_files/input-main.md
   - tools/average_pot/aveElecStatPot.py → tools/02_postprocessing/average_pot/aveElecStatPot.py

3. docs/parameters.yaml
   - tools/average_pot/aveElecStatPot.py → tools/02_postprocessing/average_pot/aveElecStatPot.py

4. source/source_io/module_qo/to_qo_kernel.cpp
   - /tools/qo/postprocess.py → /tools/01_NAO_generation/qo/postprocess.py

5. source/source_basis/module_nao/atomic_radials.cpp
   - Update SIAB/PyTorchGradient paths to 01_NAO_generation/pytorch and 01_NAO_generation/SIAB

6. source/source_io/module_parameter/read_input_item_output.cpp
   - tools/average_pot/aveElecStatPot.py → tools/02_postprocessing/average_pot/aveElecStatPot.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants