aiida-vasp / parsevasp

A general parser for VASP
MIT License
13 stars 13 forks source link

Fix truncate detection #62

Closed zhubonan closed 3 years ago

zhubonan commented 3 years ago

The laset_line of the XML file returned is a byte object and previously it was compared to a string so the function always returns True and the XML is considered as truncated.

In practice, sometimes it is b'</modeling>\n' some times it is `b'', both cases are supported now. Not sure why! might be related to whether a file object or file path was used?

A test is added to make sure the truncation detection works as expected.

codecov[bot] commented 3 years ago

Codecov Report

Merging #62 (c1e434d) into develop (ac929f3) will increase coverage by 0.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #62      +/-   ##
===========================================
+ Coverage    78.40%   78.50%   +0.10%     
===========================================
  Files            9        9              
  Lines         3004     3004              
===========================================
+ Hits          2355     2358       +3     
+ Misses         649      646       -3     
Impacted Files Coverage Δ
parsevasp/vasprun.py 83.17% <100.00%> (+0.20%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ac929f3...c1e434d. Read the comment docs.

espenfl commented 3 years ago

Awesome, thanks a lot for the quick turn around.