You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem workflow/DpFreeEnergy-aiida.py performs side effects at import/module execution time: it loads an AiiDA profile, reads ../examples/FreeEnergy.json, constructs an AiiDA Dict, and calls TI_workflow(). This makes parser scans or accidental imports capable of starting work or failing on a cwd-dependent path.
The script tries to read ../examples/FreeEnergy.json, which is outside this repository's examples/ directory; if that path existed, it would proceed to run the workflow immediately.
Expected result
Executable workflow code should be guarded by if __name__ == '__main__': and should resolve example paths relative to the script or repository root.
Source: Codex global repository scan of deepmodeling/dpti at commit b719828.
Project: DeepModeling Agent Code Scan
Problem
workflow/DpFreeEnergy-aiida.pyperforms side effects at import/module execution time: it loads an AiiDA profile, reads../examples/FreeEnergy.json, constructs an AiiDADict, and callsTI_workflow(). This makes parser scans or accidental imports capable of starting work or failing on a cwd-dependent path.Code references
dpti/workflow/DpFreeEnergy-aiida.py
Line 14 in b719828
dpti/workflow/DpFreeEnergy-aiida.py
Line 326 in b719828
dpti/workflow/DpFreeEnergy-aiida.py
Line 331 in b719828
Reproduction
Run from the repository root:
The script tries to read
../examples/FreeEnergy.json, which is outside this repository'sexamples/directory; if that path existed, it would proceed to run the workflow immediately.Expected result
Executable workflow code should be guarded by
if __name__ == '__main__':and should resolve example paths relative to the script or repository root.