Skip to content

Commit

Permalink
added DOSCAR.LSO.lobster file attribute to Lobsterout, updated tests (#…
Browse files Browse the repository at this point in the history
…2795)

* added DOSCAR.LSO.lobster file attribute to Lobsterout, updated corresponding tests

* updated test

Co-authored-by: anaik <anaik@sv2218.zit.bam.de>
  • Loading branch information
naik-aakash and naik-aakash committed Jan 10, 2023
1 parent 14e0538 commit 6d8571f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pymatgen/io/lobster/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,9 @@ class Lobsterout:
.. attribute: has_doscar
Boolean, indicates that DOSCAR.lobster is present
.. attribute: has_doscar_lso
Boolean, indicates that DOSCAR.LSO.lobster is present
.. attribute: has_projection
Boolean, indicates that projectionData.lobster is present
Expand Down Expand Up @@ -802,6 +805,9 @@ def __init__(self, filename="lobsterout"):
self.info_lines = infos

self.has_doscar = "writing DOSCAR.lobster..." in data and "SKIPPING writing DOSCAR.lobster..." not in data
self.has_doscar_lso = (
"writing DOSCAR.LSO.lobster..." in data and "SKIPPING writing DOSCAR.LSO.lobster..." not in data
)
self.has_cohpcar = (
"writing COOPCAR.lobster and ICOOPLIST.lobster..." in data
and "SKIPPING writing COOPCAR.lobster and ICOOPLIST.lobster..." not in data
Expand Down Expand Up @@ -853,6 +859,7 @@ def get_doc(self):
LobsterDict["info_lines"] = self.info_lines

LobsterDict["has_doscar"] = self.has_doscar
LobsterDict["has_doscar_lso"] = self.has_doscar_lso
LobsterDict["has_cohpcar"] = self.has_cohpcar
LobsterDict["has_coopcar"] = self.has_coopcar
LobsterDict["has_cobicar"] = self.has_cobicar
Expand Down
7 changes: 7 additions & 0 deletions pymatgen/io/lobster/tests/test_lobster.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,9 @@ def setUp(self):
self.lobsterout_cobi_madelung = Lobsterout(
filename=os.path.join(PymatgenTest.TEST_FILES_DIR, "cohp", "lobsterout_cobi_madelung")
)
self.lobsterout_doscar_lso = Lobsterout(
filename=os.path.join(PymatgenTest.TEST_FILES_DIR, "cohp", "lobsterout_doscar_lso")
)

# TODO: implement skipping madelung/cobi
self.lobsterout_skipping_cobi_madelung = Lobsterout(
Expand Down Expand Up @@ -1404,6 +1407,9 @@ def testattributes(self):
self.assertEqual(self.lobsterout_cobi_madelung.has_cobicar, True)
self.assertEqual(self.lobsterout_cobi_madelung.has_cohpcar, True)
self.assertEqual(self.lobsterout_cobi_madelung.has_madelung, True)
self.assertFalse(self.lobsterout_cobi_madelung.has_doscar_lso)

self.assertTrue(self.lobsterout_doscar_lso.has_doscar_lso)

self.assertEqual(self.lobsterout_skipping_cobi_madelung.has_cobicar, False)
self.assertEqual(self.lobsterout_skipping_cobi_madelung.has_madelung, False)
Expand Down Expand Up @@ -1451,6 +1457,7 @@ def test_get_doc(self):
"the PAW bands from 21 and upwards will be ignored.",
],
"has_doscar": True,
"has_doscar_lso": False,
"has_cohpcar": True,
"has_coopcar": True,
"has_charge": True,
Expand Down
42 changes: 42 additions & 0 deletions test_files/cohp/lobsterout_doscar_lso
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
LOBSTER v4.1.0 (g++ 7.5.0)
Copyright (C) 2021 by Chair of Solid-State and Quantum Chemistry, RWTH Aachen.
All rights reserved. Contributions by S. Maintz, V. L. Deringer, M. Esser, R. Nelson, C. Ertural, P. C. Mueller, A. L. Tchougreeff and R. Dronskowski
starting on host i01r05c05s01 on 2022-12-31 at 20:16:21 CET using 48 threads
detecting used PAW program... VASP
initializing PW system...
initializing Augmentations...
recommended basis functions:
C 2p 2s
initializing LCAO system...
setting up local basis functions...
C (pbeVaspFit2015) 2s 2p_y 2p_z 2p_x
INFO: There are more PAW bands than local basis functions available.
INFO: To prevent trouble in orthonormalization and Hamiltonian reconstruction
INFO: the PAW bands from 9 and upwards will be ignored.
setting up CO interactions... found 472 interactions.
projecting...
calculating overlaps...
post-processing projection...
saving projection to projectionData.lobster...
spillings for spin channel 1
abs. total spilling: 8.93%
abs. charge spilling: 0.98%

spillings for spin channel 2
abs. total spilling: 8.93%
abs. charge spilling: 0.98%

calculating pDOS...
writing DOSCAR.lobster...
writing COOPCAR.lobster and ICOOPLIST.lobster...
calculating pCOHPs...
writing COHPCAR.lobster and ICOHPLIST.lobster...
calculating orthonormalized pDOS...
writing DOSCAR.LSO.lobster...
writing COBICAR.lobster and ICOBILIST.lobster...
writing CHARGE.lobster and GROSSPOP.lobster...
calculating Madelung energies...
writing SitePotentials.lobster and MadelungEnergies.lobster...
finished in 0 h 22 min 39 s 233 ms of wall time
9 h 35 min 32 s 590 ms of user time
0 h 0 min 9 s 260 ms of sys time

0 comments on commit 6d8571f

Please sign in to comment.