materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.52k stars 867 forks source link

get_band_structure_from_vasp_multiple_branches #4060

Open Nokimann opened 2 months ago

Nokimann commented 2 months ago

Python version

PYthon 3.12.5

Pymatgen version

2024.8.9

Operating system version

CentOS 7.6

Current behavior

in pymatgen/io/vasp/output.py

get_band_structure_from_vasp_multiple_branches

if os.path.isfile(f"{dir_name}/branch_0"):

Expected Behavior

get_band_structure_from_vasp_multiple_branches

the line if os.path.isfile(f"{dir_name}/branch_0"):

check the filename for the dirname

So, it return None always.

I don't know why the newest version changed.

Minimal example

from pymatgen.io.vasp.outputs import get_band_structure_from_vasp_multiple_branches

bs = get_band_structure_from_vasp_multiple_branches('./bs')

print(bs == None)

Relevant files to reproduce this bug

No response

DanielYang59 commented 2 months ago

Hi @Nokimann thanks for reporting this. I could confirm this issue introduced by #3690, would fix ASAP.

Meanwhile is it possible to share your files such that we could enhance unit test (this function is not covered by unit test)? Thanks a lot!