Skip to content

refactor: streamline ASE parser maintenance and distribution scope - #16

Merged
QuantumMisaka merged 15 commits into
mainfrom
fix/ase-result-handoff
Nov 16, 2026
Merged

QuantumMisaka merged 15 commits into
mainfrom
fix/ase-result-handoff

Conversation

@QuantumMisaka

@QuantumMisaka QuantumMisaka commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

This pairs with deepmodeling/abacus-develop#8319 to correct ASE result handling and make the standalone package easier to maintain.

Behavior

  • Accept signed noncollinear moments and signed MP occupations. Export ASE-compatible properties while retaining extra result metadata and vector moments in calc.results; remove the global ASE magnetic-schema workaround.
  • Parse STRU atom options in keyword-delimited groups with explicit cardinality checks. Preserve existing unlabelled mobility triplets after velocity/vector/spherical fields.
  • Accept string paths, Path objects and named text streams in both readers, leaving caller-owned streams open. Return periodic structures for SCF and MD; keep existing coordinate-unit conventions.
  • Simplify raw-frame validation, reuse trajectory information and ASE-validated properties, and remove unused wrappers/data and Fermi aliases. Writing input leaves existing abacus.json workflow markers untouched.

Repository and distribution scope

  • Consolidate three duplicate regressions and remove stale development-plan references from tests. Add 18 small cases for the newly corrected token/file/PBC behavior using existing fixtures.
  • Remove five unused or duplicate fixture files and point readers at the remaining shared data.
  • Archive 13 historical plans, audits and maintenance proposals outside the tracked tree. Keep current user/API/maintenance guides, source attribution and version history; repair their links and state that external-package adoption is still pending upstream.
  • Keep tests, logs, examples and development history out of wheel and sdist artifacts. CI validates direct and sdist-rebuilt installed wheels with tests from the same source revision, outside the checkout.

The bundled ABACUS PR carries implementation changes and uses its existing harness. It no longer imports this repository's offline tests and recorded outputs.

Verification

  • Numeric geometry regressions: baseline 8 failed, corrected readers 8 passed; a separate negative-alat regression also verified RED/GREEN.
  • python -m build --installer uv --sdist --wheel; python -m twine check --strict dist/*; python -m pip wheel --no-deps dist/*.tar.gz --wheel-dir rebuilt: passed.
  • Rebuilt-wheel installation, pip check, isolated import provenance, then python -I -m pytest -q outside the checkout: 219 passed, 19 skipped (engine/consumer cases opt-in).
  • Final wheel: 13 files, 48,581 bytes. Final sdist: 20 files, 48,634 bytes. Neither contains tests, recorded logs or historical documents; the two wheels' eight runtime source files match byte-for-byte.
  • CI helper tests: 46 passed; workflow YAML and 23 shell blocks validated. Markdown relative links and git diff --check passed.
  • Independent review found a bare-mobility compatibility regression; it was fixed and the 18-case reader follow-up passed independent re-review.

Validation used Python 3.12.3 / ASE 3.29.0. The paired bundled implementation passed 139 external regressions on ASE 3.23 and its existing SCF integration on installed ABACUS v3.10.1. No new engine build or PyPI publication is claimed.

Behavior-focused test follow-up

Remove incidental diagnostic wording assertions while preserving selection, tolerance, malformed-frame rejection and source-path context. Translate four synthetic fixture annotations and document the assertion boundary. Paired ATST consumer repair: QuantumMisaka/atst-tools#54; CI pins its immutable commit 057ec4e3fb91cc3b77b65456abaae44cada5abbd. Runtime package code is unchanged by this follow-up.

Final rebuilt-wheel offline suite: 219 passed, 19 skipped; CI helpers: 46 passed. Full installed ATST consumer suite: 1462 passed, 37 optional skips, with installed provenance verified. Distribution checks were run separately. Independent review approved the code, tests and paired ownership table. New hosted checks are pending; this PR remains Draft.

Scientific geometry review follow-up

Both latest and legacy public readers now return Cartesian Angstrom positions/cells for Direct and Cartesian running logs, including SCF/relax. The calculator matcher no longer compensates for file-native positions; raw trajectory dictionaries remain unchanged. Native MD_dump is not rescaled twice. Regression coverage includes nonunit alat, a triclinic cell, atom reordering, a vacuum supercell, read-only parsing and invalid scale rejection.

The public API explicitly states that pbc=True describes the logged simulation box, including molecules in vacuum and slabs. Nonperiodic analysis requires caller-selected flags on a copy; no physical isolation is inferred from vacuum thickness. Named streams are read at their current position and are not rewound or closed.

ATST PR54 adds a concise ownership table to its existing developer guide. The private socket-normalization dependency remains a separate versioned public-API follow-up. The bundled implementation in deepmodeling/abacus-develop#8319 receives the same runtime correction.

Regression organization

The test counts above are suite executions, not newly added tests. The geometry fix added one parameterized regression (eight input combinations) and one malformed-scale regression. Review-specific test_reader_review.py is now removed: token cases live in test_generalio.py; geometry and stream cases live in test_reader_contract.py. Duplicate PBC checks, repeated read-only assertions and an ASE set_pbc self-check were removed. Consolidated affected suites: 92 passed, independently reviewed. Runtime code is unchanged by this consolidation; historical full-suite counts above precede removal of two duplicate parameterized cases. Tests, fault-injection probes and execution logs remain excluded from wheel/sdist; temporary probes/logs are not committed.

@QuantumMisaka

Copy link
Copy Markdown
Owner Author

This is the companion package fix for the corresponding ABACUS bundled-plugin review in deepmodeling/abacus-develop#8319. Keep this PR draft until the upstream maintenance path is settled; it is not intended to bypass the ABACUS-first adoption order.

@QuantumMisaka

Copy link
Copy Markdown
Owner Author

Follow-up in bb519c6 aligns the package contract: UPSTREAM.md no longer claims the superseded 1e-5 tolerance, the SCF tolerance boundary is documented without a universal-rounding overclaim, CHANGELOG.md records the parser/export fixes, and the example-startup test comment reflects the removal of global ASE mutation.

@QuantumMisaka

Copy link
Copy Markdown
Owner Author

Follow-up bcd2fcd shares the ASE Properties projection between file-backed result assembly and export_properties(), avoiding divergent future filters. The full unit suite remains 195 passed, 2 skipped.

@QuantumMisaka QuantumMisaka changed the title fix: keep ASE parser and result handoff compatible refactor: streamline ASE parser maintenance and distribution scope Nov 15, 2026
@QuantumMisaka
QuantumMisaka marked this pull request as ready for review November 16, 2026 07:04
@QuantumMisaka
QuantumMisaka merged commit 8476cf2 into main Nov 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant