Skip to content

Refactor the structure of source code in pyabacus #5336

Description

@a1henu

Describe the Code Quality Issue

Current code structure:

.src
├── py_abacus.cpp
├── py_base_math.cpp
├── py_diago_dav_subspace.hpp
├── py_diago_david.hpp
├── py_hsolver.cpp
├── py_m_nao.cpp
├── py_numerical_radial.cpp
└── pyabacus
    ├── ModuleBase
    │   ├── __init__.py
    │   └── _module_base.py
    ├── ModuleNAO
    │   ├── __init__.py
    │   └── _module_nao.py
    ├── __init__.py
    └── hsolver
        ├── __init__.py
        └── _hsolver.py

The current file structure of the pyabacus project has several issues that affect maintainability and increase coupling between modules. This issue proposes a refactoring of the file structure to address these problems.

  • High Coupling Between Modules:
    Currently, almost independent modules are coupled together. If one module fails to compile or has issues, it affects the entire pyabacus package, making it difficult to use and debug.

  • Cluttered src Directory:
    All module-related C++ files are placed directly in the src directory. As more modules are added, this directory will become increasingly cluttered, reducing code maintainability.

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Identify the specific code file or section with the code quality issue.
  • Investigate the issue and determine the root cause.
  • Research best practices and potential solutions for the identified issue.
  • Refactor the code to improve code quality, following the suggested solution.
  • Ensure the refactored code adheres to the project's coding standards.
  • Test the refactored code to ensure it functions as expected.
  • Update any relevant documentation, if necessary.
  • Submit a pull request with the refactored code and a description of the changes made.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pyabacusABACUS used with Python

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions