Skip to content

Commit

Permalink
Apply reviewer suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Oct 6, 2021
1 parent c28d19c commit c50af41
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
12 changes: 5 additions & 7 deletions aiida_quantumespresso/calculations/projwfc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""`CalcJob` implementation for the projwfc.x code of Quantum ESPRESSO."""
import os
from pathlib import Path

from aiida.orm import RemoteData, FolderData, Dict, XyData
from aiida_quantumespresso.calculations.namelists import NamelistsCalculation
Expand Down Expand Up @@ -28,15 +28,13 @@ class ProjwfcCalculation(NamelistsCalculation):
]
_default_parser = 'quantumespresso.projwfc'

xml_filename = 'data-file-schema.xml'

xml_path = Path(NamelistsCalculation._default_parent_output_folder
).joinpath(f'{NamelistsCalculation._PREFIX}.save', 'data-file-schema.xml')
_internal_retrieve_list = [
NamelistsCalculation._PREFIX + '.pdos*',
]
_retrieve_temporary_list = [
os.path.join(
NamelistsCalculation._default_parent_output_folder, f'{NamelistsCalculation._PREFIX}.save', xml_filename
)
xml_path.as_posix(),
]

@classmethod
Expand All @@ -58,7 +56,7 @@ def define(cls, spec):
spec.output('bands', valid_type=BandsData, required=False)
spec.default_output_node = 'output_parameters'
spec.exit_code(303, 'ERROR_OUTPUT_XML_MISSING',
message='The retrieved folder did not contain the required required XML file.')
message='The retrieved folder did not contain the required XML file.')
spec.exit_code(310, 'ERROR_OUTPUT_STDOUT_READ',
message='The stdout output file could not be read.')
spec.exit_code(312, 'ERROR_OUTPUT_STDOUT_INCOMPLETE',
Expand Down
2 changes: 1 addition & 1 deletion aiida_quantumespresso/calculations/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def define(cls, spec):
spec.exit_code(302, 'ERROR_OUTPUT_STDOUT_MISSING',
message='The retrieved folder did not contain the required stdout output file.')
spec.exit_code(303, 'ERROR_OUTPUT_XML_MISSING',
message='The retrieved folder did not contain the required required XML file.')
message='The retrieved folder did not contain the required XML file.')
spec.exit_code(304, 'ERROR_OUTPUT_XML_MULTIPLE',
message='The retrieved folder contained multiple XML files.')
spec.exit_code(305, 'ERROR_OUTPUT_FILES',
Expand Down
5 changes: 2 additions & 3 deletions aiida_quantumespresso/parsers/projwfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import numpy as np

from aiida.common import LinkType
from aiida.orm import Dict, ProjectionData, BandsData, XyData, CalcJobNode
from aiida.orm import Dict, ProjectionData, BandsData, XyData
from aiida.plugins import OrbitalFactory

from aiida_quantumespresso.parsers import QEOutputParsingError
Expand Down Expand Up @@ -369,7 +368,7 @@ def _parse_xml(self, retrieved_temporary_folder):
from .parse_xml.exceptions import XMLParseError, XMLUnsupportedFormatError
from .parse_xml.pw.parse import parse_xml

xml_filepath = Path(retrieved_temporary_folder) / self.node.process_class.xml_filename
xml_filepath = Path(retrieved_temporary_folder) / self.node.process_class.xml_path.name

if not xml_filepath.exists():
self.exit(self.exit_codes.ERROR_OUTPUT_XML_MISSING)
Expand Down

0 comments on commit c50af41

Please sign in to comment.