Fixes needed before merging the ported Gaussian basis-set exporters (#868)

未關閉
#1,327 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
c, perl, python
領域
backend, testing

研究方向

Start by reviewing the two port branches and the listed files: the Gaussian exporter scripts, rdStandardGBS.py, tests/basislegacy/run_tests.py, CMakeLists.txt, .github/workflows/test.yml, and TGBSConfig.C. Check the existing modern test entry point and the Perl behavior described for each finding. Done means resolving the merge conflicts, addressing the listed fixes and stale paths, adding the missing fixture and test wiring, and running the basis and verify tests.

由索引模型根據 Issue 內容生成。

描述

enhancement

Review findings for cx/868-gbs-gaussian-modern and cx/868-gbs-gaussian-legacy. The ports themselves are faithful: every pinned reference was regenerated from the parent commit's Perl and reproduces (244 cases modern, 42 legacy), and 138 further differential runs -- shipped fixtures plus constructed inputs, across three locales -- agree byte-for-byte on stdout, stderr and exit status. Neither branch mentions python3; both use the <ecceHome>/python/python.exe pattern with a fallback. No deleted .pm has a remaining Perl caller.

Items to fix before merging:

  1. Unguarded index, modern branch. scripts/parsers/wrGaussian16GBS.py:148 and the same line in wrGaussian09GBS.py and wrGaussian03GBS.py: shells[index - 1] + '-' + first. An ECP with 9 or more components raises IndexError, so the exporter dies with a traceback after a partial basis block; the Perl printed an empty shell name and completed. The legacy branch already guards this (wrGaussian94GBS.py:57). The status check at TGBSConfig.C:2380 catches it, so the user gets a warning rather than silent corruption, but the deck is lost. Unrealistic data, one-line fix.

  2. Non-UTF-8 input now fails, both branches. rdStandardGBS.py:readStandardBS reads sys.stdin as text, so a single byte that is not valid UTF-8 anywhere in the .gbs -- including inside a comment -- raises UnicodeDecodeError, surfaces as exit 255 with empty output, and the user sees "Cannot execute script". The Perl passed bytes through and produced a correct deck. Reproduced on a UTF-8 desktop; works under LC_ALL=C. Read stdin as bytes, or decode with errors='replace'.

  3. A test that never runs, legacy branch. tests/basislegacy/run_tests.py has no add_test in CMakeLists.txt, no entry in .github/workflows/test.yml, and no other reference in the tree. Its 42 pinned cases are dead weight. The modern branch's equivalent is reached via tests/basis/run_tests.py:567.

  4. The G03 element ordering is deliberately changed and entirely unpinned, modern branch. Perl's G03 writer iterated unsorted keys %gbs, so its element-block order was nondeterministic (up to 6 distinct outputs for one input over 40 runs); the Python sorts. That is an improvement, but none of the 64 pinned G03 cases has more than one element block and there is no G03 or G09 golden elsewhere, so a regression in that ordering would go unnoticed. Add one multi-element G03 fixture.

  5. Long-help banner, modern branch. rdStandardGBS.py:translator_main builds the usage line from the code alias, so std2Gaussian-16 --help prints Usage: std2gaus16 ... where Perl used the script's own name. The legacy branch already fixes this. Cosmetic and unpinned; no caller passes --help.

  6. The two branches conflict in src/dsm/chemistry/TGBSConfig.C and use different filesystem APIs. The modern branch includes util/Filesystem.H with namespace fs = ecce::fs; inside #ifdef _WIN32, matching the rest of the tree; the legacy branch adds a bare unconditional #include <filesystem>. Both edit the same ~10 lines of dump(). Whichever lands second needs a hand merge, and the resulting interpreter test must list all six scripts. The modern branch's form is the one to keep.

  7. Stale paths. scripts/parsers/README:92 still lists wrGaussian94GBS.pm, deleted by the legacy branch. docs/claude/codereg/a-gaussian-basis-keyword-needs-a-library-entry.md:6 still names scripts/parsers/wrGaussian16GBS.pm in its paths: frontmatter -- that one defeats the grep -rl lookup CLAUDE.md requires before touching a file.

  8. Unverified. The verify vocabularies lose 130 and 127 lines (Gaussian-16.words, Gaussian-09.words). What left is a dead element-name table and words harvested from long Perl comments, all legitimately gone, and build_vocabulary.py --check passes. But bare potential becomes potential\n at Gaussian-16.words:651 while ECP decks emit s potential, and tests/verify was not run. An unknown token is documented to degrade to UNSURE rather than BAD, so the worst case is amber on ECP decks.

Separate question, worth settling before spending more on it: the legacy branch ports exporters for codes whose EDML lives in data/client/cap/disabled/. If the aim is that the client ships no Perl, a retired code's exporter could be deleted rather than ported.

主要語言
C
星號
10
分支
8
平均合併
6 小時 32 分鐘
30 天內合併 PR
1

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

FriendsofECCE/ECCE 的其他 Issue

查看 FriendsofECCE/ECCE 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。