Skip to content

Fix static PyABACUS base wrapper calls - #7891

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Critsium-xy:fix/pyabacus-static-super-7557
Sep 1, 2026
Merged

Fix static PyABACUS base wrapper calls#7891
mohanchen merged 1 commit into
deepmodeling:developfrom
Critsium-xy:fix/pyabacus-static-super-7557

Conversation

@Critsium-xy

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

Fix #7557

Unit Tests and/or Case Tests for my changes

  • Commands run:
    • python3 -m compileall -q python/pyabacus/src/pyabacus python/pyabacus/tests/test_base_math.py
    • isolated /tmp build: PYTHONPATH=/tmp/abacus-pydeps-7557 python3 -m pip install --no-build-isolation --target /tmp/abacus-pyinstall-7557 python/pyabacus
    • PYTHONPATH=/tmp/abacus-pyinstall-7557:/tmp/abacus-pydeps-7557 python3 -m pytest python/pyabacus/tests/test_base_math.py -v
    • git diff --check
    • python3 tools/03_code_analysis/agent_governance_check.py --staged
    • python3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format text
  • Result summary: PyABACUS built successfully; all 4 focused base-math tests passed; compileall, diff, and governance checks passed.
  • Checks not run, with reason: the full PyABACUS test suite collected 59 tests but stopped because the environment lacks the optional scipy dependency used by test_hsolver.py. The focused owning test file completed successfully.
  • Environment note: an initial attempt to create a venv failed because system Python lacks ensurepip; dependencies and the built package were instead isolated under /tmp with pip --target.

What changed?

  • Call the pybind11 base classes explicitly from static Python wrapper methods instead of using zero-argument super().
  • Add regression coverage for sphbes_zeros, Simpson_Integral_0toall, and Simpson_Integral_alltoinf.
  • Correct the corresponding wrapper example in the PyABACUS contributing guide.

Governance Notes

  • INPUT/docs changes: no ABACUS INPUT behavior changed; the relevant PyABACUS contributor example was synchronized.
  • Core module impact: none; only Python wrapper dispatch changes.
  • Exceptions requested: none.

@mohanchen mohanchen added pyabacus ABACUS used with Python Refactor Refactor ABACUS codes Bugs Bugs that only solvable with sufficient knowledge of DFT labels Sep 1, 2026

@mohanchen mohanchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mohanchen
mohanchen merged commit 6f5a45b into deepmodeling:develop Sep 1, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT pyabacus ABACUS used with Python Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code scan] Avoid zero-argument super() in static PyABACUS wrappers

2 participants