This issue is a result of a Codex global repository scan.
The manual interface GitHub Actions workflow defines basis in the matrix, but the Python heredoc in the “Create mock data & patch script” step references basis without defining it or passing it through the environment. The workflow can therefore fail with NameError: name 'basis' is not defined before mock data is generated.
Matrix entries:
|
matrix: |
|
include: |
|
- name: basic (LCAO) |
|
script: example_basic.py |
|
prefix: Bi2Se3_basic |
|
basis: lcao |
|
- name: pw (Plane Wave) |
|
script: example_pw.py |
|
prefix: Bi2Se3_pw |
|
basis: pw |
|
- name: advance (LCAO) |
|
script: example_advance.py |
|
prefix: Bi2Se3_advanced |
|
basis: lcao |
Environment and Python heredoc:
|
- name: Create mock data & patch script |
|
env: |
|
SCRIPT: ${{ matrix.script }} |
|
PREFIX: ${{ matrix.prefix }} |
|
run: | |
|
python3 << 'PYEOF' |
|
import os, re, textwrap |
|
|
|
script = os.environ["SCRIPT"] |
|
prefix = os.environ["PREFIX"] |
|
|
Undefined reference:
|
# ── 3. Mock STRU (scf/ + wannier/) ──────────────────── |
|
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 = ( |
Relevant code:
env:
SCRIPT: ${{ matrix.script }}
PREFIX: ${{ matrix.prefix }}
run: |
python3 << 'PYEOF'
import os, re, textwrap
script = os.environ["SCRIPT"]
prefix = os.environ["PREFIX"]
...
if basis == "pw":
Suggested fix:
Add BASIS: ${{ matrix.basis }} to the step environment and read basis = os.environ["BASIS"] inside the heredoc.
This issue is a result of a Codex global repository scan.
The manual
interfaceGitHub Actions workflow definesbasisin the matrix, but the Python heredoc in the “Create mock data & patch script” step referencesbasiswithout defining it or passing it through the environment. The workflow can therefore fail withNameError: name 'basis' is not definedbefore mock data is generated.Matrix entries:
abacus-develop/.github/workflows/interface.yml
Lines 12 to 25 in 84ca04b
Environment and Python heredoc:
abacus-develop/.github/workflows/interface.yml
Lines 53 to 63 in 84ca04b
Undefined reference:
abacus-develop/.github/workflows/interface.yml
Lines 90 to 99 in 84ca04b
Relevant code:
Suggested fix:
Add
BASIS: ${{ matrix.basis }}to the step environment and readbasis = os.environ["BASIS"]inside the heredoc.