From 6ca6a4c1c830a26291f09d7a7132ceb34ddcb14c Mon Sep 17 00:00:00 2001 From: Levi Zhou <31941107+ZhouXY-PKU@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:25:49 +0800 Subject: [PATCH 1/2] Update GitHub Actions workflow for interface --- .github/workflows/interface.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/interface.yml b/.github/workflows/interface.yml index d45680dbd57..186765499df 100644 --- a/.github/workflows/interface.yml +++ b/.github/workflows/interface.yml @@ -24,6 +24,10 @@ jobs: prefix: Bi2Se3_advanced basis: lcao + defaults: + run: + working-directory: interfaces/Wannier90_interface/examples_python + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -36,7 +40,7 @@ jobs: - name: Install abacusw90 run: | python -m pip install --upgrade pip - pip install -e . + pip install -e .. - name: Confirm no wannier90.x in environment run: | @@ -46,12 +50,6 @@ jobs: fi echo "OK: no wannier90.x (dryrun mode)" - # ================================================================ - # Shared mock + patch - # NOTE: env: MUST be a sibling of run: (same indent level). - # run: uses block scalar literal (|) so the heredoc inside - # is passed to bash with YAML indentation stripped. - # ================================================================ - name: Create mock data & patch script env: SCRIPT: ${{ matrix.script }} @@ -161,7 +159,7 @@ jobs: print(f"[mock] {nnkp} ({len(lines)} lines)") # ── 5. Mock PP & ORB files ───────────────────────────── - orb_dir = "tests/PP_ORB/for_interface/Wannier90_interface" + orb_dir = os.path.abspath("../../../tests/PP_ORB/for_interface/Wannier90_interface") os.makedirs(orb_dir, exist_ok=True) for name in ["Bi.upf", "Se.upf", "Bi.orb", "Se.orb"]: p = os.path.join(orb_dir, name) @@ -172,15 +170,9 @@ jobs: print("\n[done] all mocks ready") PYEOF - # ================================================================ - # Run - # ================================================================ - name: Run ${{ matrix.script }} — dryrun run: python ${{ matrix.script }} 2>&1 | tee run.log - # ================================================================ - # Validate - # ================================================================ - name: Check dryrun completion banner run: | if grep -q "DRY RUN COMPLETE" run.log; then @@ -269,9 +261,6 @@ jobs: echo " ALL CHECKS PASSED (${{ matrix.name }})" echo "==========================================" - # ================================================================ - # Debug (always runs, even on failure) - # ================================================================ - name: Show full script output if: always() run: cat run.log From 803632604cab1f53525084c031fd8923fdbb92a5 Mon Sep 17 00:00:00 2001 From: Levi Zhou <31941107+ZhouXY-PKU@users.noreply.github.com> Date: Tue, 28 Apr 2026 11:21:56 +0800 Subject: [PATCH 2/2] Update atomic species and orbital file paths --- .github/workflows/interface.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/interface.yml b/.github/workflows/interface.yml index 186765499df..913a4614a79 100644 --- a/.github/workflows/interface.yml +++ b/.github/workflows/interface.yml @@ -88,11 +88,22 @@ jobs: os.makedirs(d, exist_ok=True) # ── 3. Mock STRU (scf/ + wannier/) ──────────────────── - stru = textwrap.dedent("""\ - ATOMIC_SPECIES - Bi 208.980 Bi.upf - Se 78.960 Se.upf - + if basis == "pw": + atom_species = ( + "ATOMIC_SPECIES\n" + "Bi 208.980 Bi_pbe_fr.upf\n" + "Se 78.960 Bi_pbe_fr.upf\n" + "\n" + ) + else: + atom_species = ( + "ATOMIC_SPECIES\n" + "Bi 208.980 Bi_pbe_fr.upf Bi_gga_10au_100Ry_2s2p2d.orb\n" + "Se 78.960 Bi_pbe_fr.upf Se_gga_10au_100Ry_2s2p2d.orb\n" + "\n" + ) + + lattice_block = textwrap.dedent("""\ LATTICE_CONSTANT 1.0 @@ -113,6 +124,8 @@ jobs: 0.206 0.206 0.118 1 1 1 0.794 0.794 0.882 1 1 1 """) + + stru = atom_species + lattice_block for d in [f"{prefix}/scf", f"{prefix}/wannier"]: p = os.path.join(d, "STRU") with open(p, "w") as f: @@ -159,9 +172,9 @@ jobs: print(f"[mock] {nnkp} ({len(lines)} lines)") # ── 5. Mock PP & ORB files ───────────────────────────── - orb_dir = os.path.abspath("../../../tests/PP_ORB/for_interface/Wannier90_interface") + orb_dir = os.path.abspath("../../../tests/PP_ORB/") os.makedirs(orb_dir, exist_ok=True) - for name in ["Bi.upf", "Se.upf", "Bi.orb", "Se.orb"]: + for name in ["Bi_pbe_fr.upf", "Se_pbe_fr.upf", "Bi_gga_10au_100Ry_2s2p2d.orb", "Se_gga_10au_100Ry_2s2p2d.orb"]: p = os.path.join(orb_dir, name) with open(p, "w") as f: f.write("# mock for CI dryrun\n")