This issue is a result of a Codex global repository scan.
tools/02_postprocessing/rt-tddft-tools/projection.py currently cannot be parsed by Python because line 9 contains fdir suffix + s_dir instead of a valid expression. This makes the projection tool fail before any runtime logic is reached.
|
def __init__(self, stepref, klist, steps, fdir='./OUT.ABACUS', wfc_dir='', s_dir=''): |
|
self.stepref = stepref |
|
self.klist = klist |
|
self.steps = steps |
|
self.wfc_dir = fdir + wfc_dir |
|
self.s_dir = fdir suffix + s_dir |
|
wfc_ref, Ocp_ref = self.read_wfc(klist[0]+1, stepref+1, dir=self.wfc_dir) |
Relevant code:
self.wfc_dir = fdir + wfc_dir
self.s_dir = fdir suffix + s_dir
I verified this with AST parsing / py_compile-equivalent parsing; Python reports:
SyntaxError: invalid syntax (projection.py, line 9)
The example copy of this file uses the likely intended expression:
|
self.wfc_dir = fdir + wfc_dir |
|
self.s_dir = fdir + s_dir |
|
wfc_ref, Ocp_ref = self.read_wfc(klist[0]+1, stepref+1, dir=self.wfc_dir) |
Suggested fix:
Change line 9 to self.s_dir = fdir + s_dir. While touching this file, also consider replacing the later global steps references with self.steps so the class works when imported rather than only when run through its __main__ block.
This issue is a result of a Codex global repository scan.
tools/02_postprocessing/rt-tddft-tools/projection.pycurrently cannot be parsed by Python because line 9 containsfdir suffix + s_dirinstead of a valid expression. This makes the projection tool fail before any runtime logic is reached.abacus-develop/tools/02_postprocessing/rt-tddft-tools/projection.py
Lines 4 to 10 in 84ca04b
Relevant code:
I verified this with AST parsing /
py_compile-equivalent parsing; Python reports:The example copy of this file uses the likely intended expression:
abacus-develop/tools/02_postprocessing/rt-tddft-tools/examples/ground-state-projection-Si/projection.py
Lines 8 to 10 in 84ca04b
Suggested fix:
Change line 9 to
self.s_dir = fdir + s_dir. While touching this file, also consider replacing the later globalstepsreferences withself.stepsso the class works when imported rather than only when run through its__main__block.