Skip to content

Commit

Permalink
Bug fix on block file validation (#28)
Browse files Browse the repository at this point in the history
File handle might have been in wrong position.
  • Loading branch information
Pezhman Zarabadi-Poor authored and ltalirz committed Jul 18, 2019
1 parent 1ed83fa commit e5f748a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aiida_zeopp/parsers/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ def parse(self, **kwargs):

with self.retrieved.open(fname, 'rb') as handle:
if parser is None:

# just add file, if no parser implemented
parsed = SinglefileData(file=handle)
self.out(link, parsed)

# workaround: if block pocket file is empty, raise an error
# (it indicates the calculation did not finish)
if link == 'block':
content = handle.read()

if not content.strip():
if not parsed.get_content().strip():
self.logger.error(
"Empty block file. This indicates the calculation of blocked pockets did not finish."
)
empty_block = True



else:
# else parse and add keys to output_parameters
try:
Expand Down

0 comments on commit e5f748a

Please sign in to comment.