deepmodeling / deepmodeling/fpop

[Code scan] Resolve example input files relative to each script directory

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3
Forks
13
PR merge metrics
No merged PRs in 30d

Description

This issue is a result of a Codex global code scan of `deepmodeling/fpop` at commit `b05b337590c31a5237b2dcbd9c0833b841c08cd4`.

Relevant code:
https://github.com/deepmodeling/fpop/blob/b05b337590c31a5237b2dcbd9c0833b841c08cd4/examples/vasp/preprunvasp.py#L67-L83
https://github.com/deepmodeling/fpop/blob/b05b337590c31a5237b2dcbd9c0833b841c08cd4/examples/cp2k/prepruncp2k.py#L67-L85
https://github.com/deepmodeling/fpop/blob/b05b337590c31a5237b2dcbd9c0833b841c08cd4/examples/abacus/preprunvasp.py#L67-L83

Problem:
The example scripts refer to bundled input files with current-working-directory-relative paths such as `POSCAR-1`, `test_incar`, `test_potcar`, `input.inp`, `INPUT`, and `Na_ONCV_PBE-1.0.upf`.

Running an example from the repository root with a normal command such as:

```bash
python examples/vasp/preprunvasp.py
```

makes the script look for `test_incar` and `POSCAR-1` in the repository root, even though those files live under `examples/vasp/`. The same pattern exists in the CP2K and ABACUS examples.

Expected behavior:
Each example should resolve local inputs from `Path(__file__).resolve().parent`, so the examples work regardless of the caller's current working directory.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with examples/vasp/preprunvasp.py, examples/cp2k/prepruncp2k.py, and examples/abacus/preprunvasp.py at the referenced input-handling sections. Run python examples/vasp/preprunvasp.py from the repository root, then repeat from another working directory, and check the corresponding CP2K and ABACUS examples. Done means every bundled input is found relative to its script directory rather than the caller's current directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.