SMTG-Bham / sumo

Heavyweight plotting tools for ab initio calculations
https://smtg-bham.github.io/sumo/
MIT License
201 stars 80 forks source link

sumo-kgen and sumo-bandstats running errors #2

Closed obaica closed 6 years ago

obaica commented 6 years ago

Thanks for your hard work for providing such a perfect code. I think this code is very helpful for the photovoltaic community. I am also a Ph.D. student. My research is also focused on the simulation of organic-inorganic hybrid perovskite materials. And I followed you for a long time through your papers.

According to the tutorial you gave, running "sumo-kgen" and "sumo-bandstats" commands in the corresponding directory will report an error. But other commands (e.g., sumo-dosplot) all work well. Although I think that these errors may be caused by the pymatgen software on my computer. Do you have any suggestions?

1

tg@tg:~/useful-tools/sumo-1.0.4/tests/data/ZnO$ sumo-kgen
/home/tg/.local/lib/python3.6/site-packages/pymatgen/io/vasp/inputs.py:385: UserWarning: Elements in POSCAR cannot be determined. Defaulting to false names H H He He.
  " ".join(atomic_symbols))
Traceback (most recent call last):
  File "/home/tg/.local/bin/sumo-kgen", line 11, in <module>
    sys.exit(main())
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/kgen.py", line 232, in main
    cart_coords=args.cartesian, kpt_list=kpoints, labels=labels)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/kgen.py", line 108, in kgen
    labels=labels)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/kpoints.py", line 122, in get_path_data
    kpath = BradCrackKpath(structure, symprec=symprec, spg=spg)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/brad_crack_kpath.py", line 66, in __init__
    self._kpath = self._get_bradcrack_data(bravais)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/brad_crack_kpath.py", line 83, in _get_bradcrack_data
    with open(json_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/bradcrack.json'

2

2) tg@tg:~/useful-tools/sumo-1.0.4/tests/data/Cs2SnI6/bandstructure$ sumo-bandstats
Traceback (most recent call last):
  File "/home/tg/.local/bin/sumo-bandstats", line 11, in <module>
    sys.exit(main())
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/bandstats.py", line 320, in main
    parabolic=args.nonparabolic)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/bandstats.py", line 101, in bandstats
    _log_band_gap_information(bs)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/bandstats.py", line 174, in _log_band_gap_information
    direct_data = bs.get_direct_band_gap_dict()
AttributeError: 'BandStructureSymmLine' object has no attribute 'get_direct_band_gap_dict'
utf commented 6 years ago

Thanks for your comments. The first issue is a mistake on my part, I hadn't included that data in the Pypi release.

I think the second issue is due to you having an old version of Pymatgen.

I've updated the package, which hopefully should fix both issues. Please try reinstalling using:

pip3 install --user --upgrade sumo

Please let me know if that fixes it.

obaica commented 6 years ago

ok, i will try again. Thank you for your reply.

obaica commented 6 years ago

After reinstalling using "pip3 install --user --upgrade sumo", "sumo-bandstats" command can work well. But "sumo-kgen" command still shows an error. As follows,

1

tg@tg:~/useful-tools/sumo-1.0.4/tests/data/ZnO$ sumo-kgen
/home/tg/.local/lib/python3.6/site-packages/pymatgen/io/vasp/inputs.py:387: UserWarning: Elements in POSCAR cannot be determined. Defaulting to false names H H He He.
  " ".join(atomic_symbols))
Traceback (most recent call last):
  File "/home/tg/.local/bin/sumo-kgen", line 11, in <module>
    sys.exit(main())
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/kgen.py", line 232, in main
    cart_coords=args.cartesian, kpt_list=kpoints, labels=labels)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/kgen.py", line 108, in kgen
    labels=labels)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/kpoints.py", line 122, in get_path_data
    kpath = BradCrackKpath(structure, symprec=symprec, spg=spg)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/brad_crack_kpath.py", line 66, in __init__
    self._kpath = self._get_bradcrack_data(bravais)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/brad_crack_kpath.py", line 83, in _get_bradcrack_data
    with open(json_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/bradcrack.json'

After adding the names of element in the POSCAR, still the same previous error,

2

tg@tg:~/useful-tools/sumo-1.0.4/tests/data/ZnO$ sumo-kgen
Traceback (most recent call last):
  File "/home/tg/.local/bin/sumo-kgen", line 11, in <module>
    sys.exit(main())
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/kgen.py", line 232, in main
    cart_coords=args.cartesian, kpt_list=kpoints, labels=labels)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/cli/kgen.py", line 108, in kgen
    labels=labels)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/kpoints.py", line 122, in get_path_data
    kpath = BradCrackKpath(structure, symprec=symprec, spg=spg)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/brad_crack_kpath.py", line 66, in __init__
    self._kpath = self._get_bradcrack_data(bravais)
  File "/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/brad_crack_kpath.py", line 83, in _get_bradcrack_data
    with open(json_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/tg/.local/lib/python3.6/site-packages/sumo/symmetry/bradcrack.json'
ajjackson commented 6 years ago

This is related to a data file which is not being installed correctly. Probably we need to tweak the setup.py, I'll look into it.

ajjackson commented 6 years ago

Reproduced on a clean install from PyPI. It's strange because there is a unit test which uses this file.

utf commented 6 years ago

We believe this problem has now been resolved (fix by @ajjackson). I've pushed a new version to Pypi, so please try updating sumo again and let me know if that fixes it for you.

obaica commented 6 years ago

Very good. Now, "sumo-kgen" command also works well. Thank you for your reply and hard work. I don't know if you have plans to include the plotting function of defect formation energy vs fermi energy in sumo later. Because the defect properties are also very important for photovoltaic materials.

utf commented 6 years ago

Thanks for letting me know everything is working.

We are interested in codes to aide defect analysis, however, there are no current plans to implement this into sumo as yet.