diff --git a/.gitignore b/.gitignore index 03385d3bd..e5efe3253 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,10 @@ wheels/ *.egg-info/ .installed.cfg *.egg + +# Dev .vscode +.history/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/aiida_quantumespresso/calculations/pp.py b/aiida_quantumespresso/calculations/pp.py index 2c668da42..bc7edfede 100644 --- a/aiida_quantumespresso/calculations/pp.py +++ b/aiida_quantumespresso/calculations/pp.py @@ -2,26 +2,220 @@ """`CalcJob` implementation for the pp.x code of Quantum ESPRESSO.""" from __future__ import absolute_import -from aiida.orm import RemoteData, FolderData -from aiida_quantumespresso.calculations.namelists import NamelistsCalculation +import os +import six +from six.moves import range +from aiida import orm +from aiida.common import datastructures, exceptions -class PpCalculation(NamelistsCalculation): +from aiida_quantumespresso.calculations import _lowercase_dict, _uppercase_dict +from aiida_quantumespresso.utils.convert import convert_input_to_namelist_entry +from .base import CalcJob + + +def validate_parameters(value, ctx=None): # pylint: disable=unused-argument + """Validate 'parameters' dict.""" + parameters = value.get_dict() + + try: + plot_num = parameters['INPUTPP']['plot_num'] + except KeyError: + return 'parameter `INPUTPP.plot_num` must be explicitly set' + + # Check that a valid plot type is requested + if plot_num in range(23) and plot_num not in [14, 15, 16]: # Must be integer in range 0-22, but not 14-16: + parameters['INPUTPP']['plot_num'] = int(plot_num) # If this test passes, we can safely cast to int + else: + return '`INTPUTPP.plot_num` must be an integer in the range 0-23 excluding [14, 15, 16]' + + try: + dimension = parameters['PLOT']['iflag'] + except KeyError: + return 'parameter `PLOT.iflag` must be explicitly set' + + # Check for valid plot dimension: + if dimension in range(5): # Must be in range 0-4: + parameters['PLOT']['iflag'] = int(dimension) + else: + return '`PLOT.iflag` must be an integer in the range 0-4' + + +class PpCalculation(CalcJob): """`CalcJob` implementation for the pp.x code of Quantum ESPRESSO.""" + # Default name of the subfolder inside 'parent_folder' from which you want to copy the files, in case the + # parent_folder is of type FolderData + _INPUT_SUBFOLDER = './out/' + + # In the PW Calculation plugin, these folder names and prefixes are fixed, so import them to reduce maintenance + # pylint: disable=protected-access + from aiida_quantumespresso.calculations import BasePwCpInputGenerator + _OUTPUT_SUBFOLDER = BasePwCpInputGenerator._OUTPUT_SUBFOLDER + _PREFIX = BasePwCpInputGenerator._PREFIX + _PSEUDO_SUBFOLDER = BasePwCpInputGenerator._PSEUDO_SUBFOLDER + _DEFAULT_INPUT_FILE = BasePwCpInputGenerator._DEFAULT_INPUT_FILE + _DEFAULT_OUTPUT_FILE = BasePwCpInputGenerator._DEFAULT_OUTPUT_FILE + # pylint: enable=protected-access + + # Grid data output file from first stage of pp calculation _FILPLOT = 'aiida.filplot' + # Grid data output in desired format + _FILEOUT = 'aiida.fileout' _default_namelists = ['INPUTPP', 'PLOT'] - _internal_retrieve_list = [_FILPLOT] - _blocked_keywords = [ - ('INPUTPP', 'outdir', NamelistsCalculation._OUTPUT_SUBFOLDER), - ('INPUTPP', 'prefix', NamelistsCalculation._PREFIX), - ('INPUTPP', 'filplot', _FILPLOT), - ] + + # Keywords that cannot be set by the user but will be set by the plugin + _blocked_keywords = [('INPUTPP', 'outdir', _OUTPUT_SUBFOLDER), ('INPUTPP', 'prefix', _PREFIX), + ('INPUTPP', 'filplot', _FILPLOT), ('PLOT', 'fileout', _FILEOUT), + ('PLOT', 'output_format', None)] @classmethod def define(cls, spec): # yapf: disable super(PpCalculation, cls).define(spec) - spec.input('parent_folder', valid_type=(RemoteData, FolderData), + spec.input('parent_folder', valid_type=(orm.RemoteData, orm.FolderData), required=True, help='Output folder of a completed `PwCalculation`') + spec.input('parameters', valid_type=orm.Dict, required=True, validator=validate_parameters, + help='Use a node that specifies the input parameters for the namelists') + spec.input('metadata.options.input_filename', valid_type=six.string_types, default=cls._DEFAULT_INPUT_FILE) + spec.input('metadata.options.output_filename', valid_type=six.string_types, default=cls._DEFAULT_OUTPUT_FILE) + spec.input('metadata.options.parser_name', valid_type=six.string_types, default='quantumespresso.pp') + spec.input('metadata.options.withmpi', valid_type=bool, default=True) + spec.input('metadata.options.keep_plot_file', valid_type=bool, default=False) + + spec.output('output_parameters', valid_type=orm.Dict) + spec.output('output_data', valid_type=orm.ArrayData) + spec.default_output_node = 'output_parameters' + + # Standard exceptions + spec.exit_code(300, 'ERROR_NO_RETRIEVED_FOLDER', + message='The retrieved folder data node could not be accessed.') + spec.exit_code(301, 'ERROR_NO_RETRIEVED_TEMPORARY_FOLDER', + message='The retrieved temporary folder could not be accessed.') + 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 parent folder did not contain the required XML output 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', + message='The stdout output file was incomplete.') + spec.exit_code(340, 'ERROR_OUT_OF_WALLTIME_INTERRUPTED', + message='The calculation stopped prematurely because it ran out of walltime but the job was killed by the ' + 'scheduler before the files were safely written to disk for a potential restart.') + spec.exit_code(350, 'ERROR_UNEXPECTED_PARSER_EXCEPTION', + message='The parser raised an unexpected exception.') + + # Output datafile related exceptions + spec.exit_code(330, 'ERROR_OUTPUT_DATAFILE_MISSING', + message='The retrieved folder did not contain the required formatted data output file.') + spec.exit_code(331, 'ERROR_OUTPUT_DATAFILE_READ', + message='The formatted data output file could not be read.') + spec.exit_code(332, 'ERROR_UNSUPPORTED_DATAFILE_FORMAT', + message='The data file format is not supported by the parser') + + def prepare_for_submission(self, folder): # pylint: disable=too-many-branches,too-many-statements + """Create the input files from the input nodes passed to this instance of the `CalcJob`. + + :param folder: an `aiida.common.folders.Folder` to temporarily write files on disk + :return: `aiida.common.datastructures.CalcInfo` instance + """ + + # Put the first-level keys as uppercase (i.e., namelist and card names) and the second-level keys as lowercase + parameters = _uppercase_dict(self.inputs.parameters.get_dict(), dict_name='parameters') + parameters = {k: _lowercase_dict(v, dict_name=k) for k, v in six.iteritems(parameters)} + + # Set default values. NOTE: this is different from PW/CP + for blocked in self._blocked_keywords: + namelist = blocked[0].upper() + key = blocked[1].lower() + value = blocked[2] + + if namelist in parameters: + if key in parameters[namelist]: + raise exceptions.InputValidationError( + "You cannot specify explicitly the '{}' key in the '{}' " + 'namelist.'.format(key, namelist)) + else: + parameters[namelist] = {} + parameters[namelist][key] = value + + # Restrict the plot output to the file types that we want to be able to parse + dimension_to_output_format = { + 0: 0, # Spherical integration -> Gnuplot, 1D + 1: 0, # 1D -> Gnuplot, 1D + 2: 7, # 2D -> Gnuplot, 2D + 3: 6, # 3D -> Gaussian cube + 4: 0, # Polar on a sphere -> # Gnuplot, 1D + } + parameters['PLOT']['output_format'] = dimension_to_output_format[parameters['PLOT']['iflag']] + + namelists_toprint = self._default_namelists + + input_filename = self.inputs.metadata.options.input_filename + with folder.open(input_filename, 'w') as infile: + for namelist_name in namelists_toprint: + infile.write(u'&{0}\n'.format(namelist_name)) + # namelist content; set to {} if not present, so that we leave an empty namelist + namelist = parameters.pop(namelist_name, {}) + for key, value in sorted(six.iteritems(namelist)): + infile.write(convert_input_to_namelist_entry(key, value)) + infile.write(u'/\n') + + # Check for specified namelists that are not expected + if parameters: + raise exceptions.InputValidationError( + 'The following namelists are specified in parameters, but are ' + 'not valid namelists for the current type of calculation: ' + '{}'.format(','.join(list(parameters.keys())))) + + remote_copy_list = [] + local_copy_list = [] + + # Copy remote output dir + parent_calc_folder = self.inputs.get('parent_folder', None) + if isinstance(parent_calc_folder, orm.RemoteData): + remote_copy_list.append(( + parent_calc_folder.computer.uuid, + os.path.join(parent_calc_folder.get_remote_path(), self._INPUT_SUBFOLDER), + self._OUTPUT_SUBFOLDER + )) + remote_copy_list.append(( + parent_calc_folder.computer.uuid, + os.path.join(parent_calc_folder.get_remote_path(), self._PSEUDO_SUBFOLDER), + self._PSEUDO_SUBFOLDER + )) + elif isinstance(parent_calc_folder, orm.FolderData): + for filename in parent_calc_folder.list_object_names(): + local_copy_list.append(( + parent_calc_folder.uuid, + filename, + os.path.join(self._OUTPUT_SUBFOLDER, filename) + )) + local_copy_list.append(( + parent_calc_folder.uuid, + filename, + os.path.join(self._PSEUDO_SUBFOLDER, filename) + )) + + codeinfo = datastructures.CodeInfo() + codeinfo.stdin_name = self.inputs.metadata.options.input_filename + codeinfo.stdout_name = self.inputs.metadata.options.output_filename + codeinfo.code_uuid = self.inputs.code.uuid + + calcinfo = datastructures.CalcInfo() + calcinfo.codes_info = [codeinfo] + calcinfo.local_copy_list = local_copy_list + calcinfo.remote_copy_list = remote_copy_list + + # Retrieve by default the output file and plot file + calcinfo.retrieve_list = [] + calcinfo.retrieve_temporary_list = [] + calcinfo.retrieve_list.append(self.inputs.metadata.options.output_filename) + if self.inputs.metadata.options.keep_plot_file: + calcinfo.retrieve_list.append(self._FILEOUT) + else: + calcinfo.retrieve_temporary_list.append(self._FILEOUT) + + return calcinfo diff --git a/aiida_quantumespresso/parsers/pp.py b/aiida_quantumespresso/parsers/pp.py new file mode 100644 index 000000000..ca6ffde3e --- /dev/null +++ b/aiida_quantumespresso/parsers/pp.py @@ -0,0 +1,361 @@ +# -*- coding: utf-8 -*- +"""`Parser` implementation for the `PpCalculation` calculation job class.""" +from __future__ import absolute_import + +import traceback +import os.path + +import numpy as np + +from aiida import orm +from aiida.common import exceptions + +from aiida_quantumespresso.calculations.pp import PpCalculation +from aiida_quantumespresso.utils.mapping import get_logging_container +from .base import Parser + +from six.moves import range +from six.moves import zip + + +class PpParser(Parser): + """`Parser` implementation for the `PpCalculation` calculation job class.""" + + # Lookup: plot_num --> units + units_dict = { + 0: 'e/bohr^3', # Electrons, electronic charge density + 1: 'Ry', # Total potential + 2: 'Ry', # Ionic potential + 3: 'states/bohr^3', # Density of states over an energy range + 4: 'Ry/K.bohr^3', # Local density of electronic entropy + 5: 'states/bohr^3', # Simulated STM images from LDOS + 6: 'e/bohr^3', # Spin density + 7: 'e/bohr^3', # WFN contribution to charge density, assuming collinear spins + 8: '1', # Electron localization function, dimensionless + 9: 'e/bohr^3', # Charge density minus superposition of atomic densities + 10: 'states/bohr^3', # Integrated local density of states (ILDOS) + 11: 'Ry', # Bare + Hartree potential + 12: 'Ry', # the sawtooth electric field potential + 13: 'mu_B', # Noncollinear magnetisation, Bohr magnetons + 17: 'e/bohr^3', # All electron charge density + 18: 'T', # The exchange and correlation magnetic field in the noncollinear case + 19: '1', # Reduced density gradient - see dx.doi.org/10.1021/ct100641a, Eq.1 - dimensionless + 20: 'e/bohr^5', # Product of the electron density and the second eigenvalue of the electron-density Hessian matrix, see: dx.doi.org/10.1021/ct100641a, with sign of second eigenvalue + 21: 'e/bohr^3', # All electron charge density, PAW case + 22: 'Ry/bohr^3', # Kinetic energy density + } + + def parse(self, **kwargs): + """ + Parse raw files retrieved from remote dir + """ + + temp_folder_path = None + + # A retrieved folded is required + try: + self.retrieved + except exceptions.NotExistent: + return self.exit_codes.ERROR_NO_RETRIEVED_FOLDER + + # If temporary files were specified, check that we have them + if self.node.get_attribute('retrieve_temporary_list', None): + try: + temp_folder_path = kwargs['retrieved_temporary_folder'] + except KeyError: + return self.exit(self.exit_codes.ERROR_NO_RETRIEVED_TEMPORARY_FOLDER) + + # The stdout is required for parsing + filename_stdout = self.node.get_attribute('output_filename') + if filename_stdout not in self.retrieved.list_object_names(): + return self.exit_codes.ERROR_OUTPUT_STDOUT_MISSING + + try: + stdout_raw = self.retrieved.get_object_content(filename_stdout) + except (IOError, OSError): + return self.exit_codes.ERROR_OUTPUT_STDOUT_READ + + # The post-processed data should have been written to file, either in the retrieved or temp list + filename_data = PpCalculation._FILEOUT + if filename_data in self.retrieved.list_object_names(): # Retrieved list case + try: + data_raw = self.retrieved.get_object_content(filename_data) + except (IOError, OSError): + return self.exit_codes.ERROR_DATAFILE_READ + elif temp_folder_path is not None: # Temp list case + data_file_path = os.path.join(temp_folder_path, filename_data) + if os.path.isfile(data_file_path): + try: + with open(data_file_path, 'r') as fhandle: + data_raw = fhandle.read() + except (IOError, OSError): + return self.exit_codes.ERROR_DATAFILE_READ + else: + return self.exit_codes.ERROR_OUTPUT_DATAFILE_MISSING + else: + return self.exit_codes.ERROR_OUTPUT_DATAFILE_MISSING + + # Parse stdout + try: + logs, self.output_parameters = self.parse_stdout(stdout_raw) + except Exception: + self.logger.error(traceback.format_exc()) + return self.exit_codes.ERROR_UNEXPECTED_PARSER_EXCEPTION + + # Print the logs + self.emit_logs(logs) + + # Scan logs for known errors + if 'ERROR_PARENT_XML_MISSING' in logs['error']: + return self.exit_codes.ERROR_PARENT_XML_MISSING + if 'ERROR_OUTPUT_STDOUT_INCOMPLETE' in logs['error']: + return self.exit_codes.ERROR_OUTPUT_STDOUT_INCOMPLETE + + # Parse the post-processed-data according to what kind of data file was produced + if self.output_parameters['output_format'] == 'gnuplot': + if self.output_parameters['plot_type'] == '2D polar on a sphere': + parsed_data = self.parse_gnuplot_polar(data_raw) + else: + parsed_data = self.parse_gnuplot1D(data_raw) + elif self.output_parameters['output_format'] == 'gnuplot x,y,f': + parsed_data = self.parse_gnuplot2D(data_raw) + elif self.output_parameters['output_format'] == 'Gaussian cube': + parsed_data = self.parse_gaussian(data_raw) + else: + return self.exit_codes.ERROR_UNSUPPORTED_DATAFILE_FORMAT + + # Create output nodes + self.out('output_data', parsed_data) + self.out('output_parameters', orm.Dict(dict=self.output_parameters)) + + def parse_stdout(self, stdout_str): + """ + Parses the output written to StdOut to retrieve basic information about the post processing + + :param stdout_str: the stdout file read in as a single string + """ + + def detect_important_message(logs, line): + """ + Detect know errors and warnings printed in the stdout + + :param logs: + :param line: a line from the stdout as a string + """ + message_map = { + 'error': { + 'xml data file not found': 'ERROR_PARENT_XML_MISSING' + }, + 'warning': { + 'Warning:': None, + 'DEPRECATED:': None, + } + } + + # Match any known error and warning messages + for marker, message in message_map['error'].items(): + if marker in line: + if message is None: + message = line + logs.error.append(message) + + for marker, message in message_map['warning'].items(): + if marker in line: + if message is None: + message = line + logs.warning.append(message) + + stdout_lines = stdout_str.splitlines() + logs = get_logging_container() + output_dict = {} + + # Check for job completion, indicating that pp.x exited without interruption, even if there was an error. + for line in stdout_lines: + if 'JOB DONE' in line: + break + else: + logs.error.append('ERROR_OUTPUT_STDOUT_INCOMPLETE') + + # Detect any issues and detect job completion + for line in stdout_lines: + detect_important_message(logs, line) + + # Parse useful data from stdout + for line in stdout_lines: + if 'Check:' in line: + split_line = line.split('=') + if 'negative/imaginary' in line: # QE6.1 + output_dict['negative_core_charge'] = float(split_line[-1].split()[0]) + output_dict['imaginary_core_charge'] = float(split_line.split()[-1]) + else: # QE6.4 + output_dict['negative_core_charge'] = float(split_line[1]) + if 'Min, Max, imaginary charge:' in line: + split_line = line.split() + output_dict['charge_min'] = float(split_line[-3]) + output_dict['charge_max'] = float(split_line[-2]) + output_dict['charge_img'] = float(split_line[-1]) + if 'plot_num = ' in line: + output_dict['plot_num'] = int(line.split('=')[1]) + if 'Plot Type:' in line: + output_dict['plot_type'] = line.split('Output format')[0].split(':')[-1].strip() + output_dict['output_format'] = line.split(':')[-1].strip() + + return logs, output_dict + + def parse_gnuplot1D(self, data_file_str): + """ + Parse 1D GNUPlot formatted output + + :param data_file_str: the data file read in as a single string + """ + data_lines = data_file_str.splitlines() + + n_col = len(data_lines[0].split()) + + # 1D case + if n_col == 2: + coords = [] + data = [] + data_integral = [] + for line in data_lines: + split_line = line.split() + coords.append(float(split_line[0])) + data.append(float(split_line[1])) + y_data = [data] + y_names = ['data'] + y_units = [self.units_dict[self.output_parameters['plot_num']]] + + # 1D case with spherical averaging + if n_col == 3: + coords = [] + data = [] + data_integral = [] + for line in data_lines: + split_line = line.split() + coords.append(float(split_line[0])) + data.append(float(split_line[1])) + data_integral.append(float(split_line[2])) + y_data = [data, data_integral] + y_names = ['data', 'integrated_data'] + unit = self.units_dict[self.output_parameters['plot_num']] + y_units = [unit, unit.replace('bohr^3', 'bohr')] + + x_units = 'bohr' + arraydata = orm.ArrayData() + arraydata.set_array('x_coordinates', np.array(coords)) + arraydata.set_array('x_coordinates_units', np.array(x_units)) + for name, data, units in zip(y_names, y_data, y_units): + arraydata.set_array(name, np.array(data)) + arraydata.set_array(name + '_units', np.array(units)) + + return arraydata + + def parse_gnuplot_polar(self, data_file_str): + """ + Parse 2D Polar GNUPlot formatted, single column output + + :param data_file_str: the data file read in as a single string + """ + data_lines = data_file_str.splitlines() + data_lines.pop(0) # First line is a header + + data = [] + for line in data_lines: + data.append(float(line)) + data_units = [self.units_dict[self.output_parameters['plot_num']]] + + arraydata = orm.ArrayData() + arraydata.set_array('data', np.array(data)) + arraydata.set_array('data_units', np.array(data_units)) + + return arraydata + + def parse_gnuplot2D(self, data_file_str): + """ + Parse 2D GNUPlot formatted output + + :param data_file_str: the data file read in as a single string + """ + data_lines = data_file_str.splitlines() + + coords = [] + data = [] + + for line in data_lines: + if line == '': + continue + else: + split_line = line.split() + coords.append([float(split_line[0]), float(split_line[1])]) + data.append(float(split_line[2])) + + coords_units = 'bohr' + data_units = self.units_dict[self.output_parameters['plot_num']] + arraydata = orm.ArrayData() + arraydata.set_array('xy_coordinates', np.array(coords)) + arraydata.set_array('data', np.array(data)) + arraydata.set_array('xy_coordinates_units', np.array(coords_units)) + arraydata.set_array('data_units', np.array(data_units)) + + return arraydata + + def parse_gaussian(self, data_file_str): + """ + Parse Gaussian Cube formatted output + + :param data_file_str: the data file read in as a single string + """ + + lines = data_file_str.splitlines() + + atoms_line = lines[2].split() + atoms = int(atoms_line[0]) # The number of atoms listed in the file + header = lines[:6 + atoms] # The header of the file: comments, the voxel, and the number of atoms and datapoints + data_lines = lines[6 + atoms:] # The actual data: atoms and volumetric data + + # Parse the declared dimensions of the volumetric data + x_line = header[3].split() + xdim = int(x_line[0]) + y_line = header[4].split() + ydim = int(y_line[0]) + z_line = header[5].split() + zdim = int(z_line[0]) + + # Get the vectors describing the basis voxel + voxel_array = np.array( + [[x_line[1], x_line[2], x_line[3]], + [y_line[1], y_line[2], y_line[3]], + [z_line[1], z_line[2], z_line[3]]], + dtype=np.float64 + ) + + # Get the volumetric data + data_array = np.zeros((xdim, ydim, zdim)) + + # The data is organised into columns with a fixed number of values + # Gather up all the data points into one list for easier unpacking + datalist = [] + for line in data_lines: + for i in range(0, len(line), 13): + data_point = line[i:i + 13].strip() + if data_point != '': + datalist.append(float(data_point)) + + # Unpack the list and repack as a 3D array + # Note the unusual indexing: cube files run over the z index first, then y and x. + # E.g. The first volumetric data point is x,y,z = (0,0,0) and the second is (0,0,1) + for i in range(0, xdim): + for j in range(0, ydim): + for k in range(0, zdim): + data_array[i, j, k] = (datalist[(i * ydim * zdim) + (j * zdim) + k]) + + coordinates_units = 'bohr' + data_units = self.units_dict[self.output_parameters['plot_num']] + + arraydata = orm.ArrayData() + arraydata.set_array('voxel', voxel_array) + arraydata.set_array('data', data_array) + arraydata.set_array('coordinates_units', np.array(coordinates_units)) + arraydata.set_array('data_units', np.array(data_units)) + + return arraydata diff --git a/setup.json b/setup.json index d279881f2..75a728ca7 100644 --- a/setup.json +++ b/setup.json @@ -37,6 +37,7 @@ "quantumespresso.matdyn = aiida_quantumespresso.parsers.matdyn:MatdynParser", "quantumespresso.neb = aiida_quantumespresso.parsers.neb:NebParser", "quantumespresso.ph = aiida_quantumespresso.parsers.ph:PhParser", + "quantumespresso.pp = aiida_quantumespresso.parsers.pp:PpParser", "quantumespresso.projwfc = aiida_quantumespresso.parsers.projwfc:ProjwfcParser", "quantumespresso.pw = aiida_quantumespresso.parsers.pw:PwParser", "quantumespresso.pw2gw = aiida_quantumespresso.parsers.pw2gw:Pw2gwParser", diff --git a/tests/calculations/test_pp.py b/tests/calculations/test_pp.py new file mode 100644 index 000000000..6fcfa99e9 --- /dev/null +++ b/tests/calculations/test_pp.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# pylint: disable=redefined-outer-name +"""Tests for the `PpCalculation` class.""" +from __future__ import absolute_import +import pytest + +from aiida import orm +from aiida.common import datastructures, AttributeDict + + +@pytest.fixture +def generate_inputs(fixture_localhost, fixture_sandbox, fixture_code, generate_remote_data): + """Return only those inputs that the parser will expect to be there.""" + + def _generate_inputs(parameters=None): + from aiida_quantumespresso.utils.resources import get_default_options + + if parameters is None: + parameters = {'INPUTPP': {'plot_num': 1}, 'PLOT': {'iflag': 3}} + + return AttributeDict({ + 'code': + fixture_code('quantumespresso.pp'), + 'parent_folder': + generate_remote_data(fixture_localhost, fixture_sandbox.abspath, 'quantumespresso.pw'), + 'parameters': + orm.Dict(dict=parameters), + 'metadata': { + 'options': get_default_options() + } + }) + + return _generate_inputs + + +def test_pp_default(aiida_profile, fixture_sandbox, generate_calc_job, generate_inputs, file_regression): + """Test a default `PpCalculation`.""" + entry_point_name = 'quantumespresso.pp' + inputs = generate_inputs() + + calc_info = generate_calc_job(fixture_sandbox, entry_point_name, inputs) + + retrieve_list = ['aiida.out'] + retrieve_temporary_list = ['aiida.fileout'] + local_copy_list = [] + + # Check the attributes of the returned `CalcInfo` + assert isinstance(calc_info, datastructures.CalcInfo) + assert sorted(calc_info.local_copy_list) == sorted(local_copy_list) + assert sorted(calc_info.retrieve_list) == sorted(retrieve_list) + assert sorted(calc_info.retrieve_temporary_list) == sorted(retrieve_temporary_list) + + with fixture_sandbox.open('aiida.in') as handle: + input_written = handle.read() + + # Checks on the files written to the sandbox folder as raw input + assert sorted(fixture_sandbox.get_content_list()) == sorted(['aiida.in']) + file_regression.check(input_written, encoding='utf-8', extension='.in') + + +def test_pp_keep_plot_file(aiida_profile, fixture_sandbox, generate_calc_job, generate_inputs): + """Test a `PpCalculation` where we want to retrieve the plot file.""" + entry_point_name = 'quantumespresso.pp' + inputs = generate_inputs() + inputs.metadata.options.keep_plot_file = True + + calc_info = generate_calc_job(fixture_sandbox, entry_point_name, inputs) + retrieve_list = ['aiida.out', 'aiida.fileout'] + retrieve_temporary_list = [] + local_copy_list = [] + + # Check the attributes of the returned `CalcInfo`, no need to check the input file as it is not affected + assert isinstance(calc_info, datastructures.CalcInfo) + assert sorted(calc_info.local_copy_list) == sorted(local_copy_list) + assert sorted(calc_info.retrieve_list) == sorted(retrieve_list) + assert sorted(calc_info.retrieve_temporary_list) == sorted(retrieve_temporary_list) + + +@pytest.mark.parametrize( + ('parameters', 'message'), + ( + ({}, 'parameter `INPUTPP.plot_num` must be explicitly set'), + ({'INPUTPP': {}}, 'parameter `INPUTPP.plot_num` must be explicitly set'), + ({'INPUTPP': {'plot_num': 'str'}}, '`INTPUTPP.plot_num` must be an integer in the range'), + ({'INPUTPP': {'plot_num': 14}}, '`INTPUTPP.plot_num` must be an integer in the range'), + ({'INPUTPP': {'plot_num': 1}}, 'parameter `PLOT.iflag` must be explicitly set'), + ({'INPUTPP': {'plot_num': 1}, 'PLOT': {}}, 'parameter `PLOT.iflag` must be explicitly set'), + ({'INPUTPP': {'plot_num': 1}, 'PLOT': {'iflag': 'str'}}, '`PLOT.iflag` must be an integer in the range 0-4'), + ({'INPUTPP': {'plot_num': 1}, 'PLOT': {'iflag': 5}}, '`PLOT.iflag` must be an integer in the range 0-4'), + ), +) # yapf: disable +def test_pp_invalid_parameters(aiida_profile, fixture_sandbox, generate_calc_job, generate_inputs, parameters, message): + """Test that launching `PpCalculation` fails for invalid parameters.""" + entry_point_name = 'quantumespresso.pp' + + with pytest.raises(ValueError) as exception: + inputs = generate_inputs(parameters=parameters) + generate_calc_job(fixture_sandbox, entry_point_name, inputs) + + assert message in str(exception.value) diff --git a/tests/calculations/test_pp/test_pp_default.in b/tests/calculations/test_pp/test_pp_default.in new file mode 100644 index 000000000..57be58c16 --- /dev/null +++ b/tests/calculations/test_pp/test_pp_default.in @@ -0,0 +1,11 @@ +&INPUTPP + filplot = 'aiida.filplot' + outdir = './out/' + plot_num = 1 + prefix = 'aiida' +/ +&PLOT + fileout = 'aiida.fileout' + iflag = 3 + output_format = 6 +/ diff --git a/tests/parsers/fixtures/pp/default_1d/aiida.fileout b/tests/parsers/fixtures/pp/default_1d/aiida.fileout new file mode 100644 index 000000000..cb873544d --- /dev/null +++ b/tests/parsers/fixtures/pp/default_1d/aiida.fileout @@ -0,0 +1,10 @@ + 0.0000000000 -11.3601206194 + 0.0101010101 -11.2478484712 + 0.0202020202 -10.9031326566 + 0.0303030303 -10.3221343782 + 0.0404040404 -9.5416598550 + 0.0505050505 -8.6478189645 + 0.0606060606 -7.7382726743 + 0.0707070707 -6.8674698320 + 0.0808080808 -6.0247906850 + 0.0909090909 -5.1668428440 diff --git a/tests/parsers/fixtures/pp/default_1d/aiida.out b/tests/parsers/fixtures/pp/default_1d/aiida.out new file mode 100644 index 000000000..a9a2564d9 --- /dev/null +++ b/tests/parsers/fixtures/pp/default_1d/aiida.out @@ -0,0 +1,49 @@ + + Program POST-PROC v.6.4 starts on 23Oct2019 at 8:53: 0 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 4 processors + + MPI processes distributed on 1 nodes + R & G space division: proc/nbgrp/npool/nimage = 4 + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 326 164 40 8876 3132 386 + Max 327 165 41 8881 3135 389 + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout + Min, Max, imaginary charge: -11.360121 1.003621 0.000000 + Plot Type: 1D along a line Output format: gnuplot + + POST-PROC : 0.51s CPU 0.57s WALL + + + This run was terminated on: 8:53: 0 23Oct2019 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= diff --git a/tests/parsers/fixtures/pp/default_1d_spherical/aiida.fileout b/tests/parsers/fixtures/pp/default_1d_spherical/aiida.fileout new file mode 100644 index 000000000..56bd1de7a --- /dev/null +++ b/tests/parsers/fixtures/pp/default_1d_spherical/aiida.fileout @@ -0,0 +1,10 @@ + 0.0000000000 -142.7558915079 0.0000000000 + 0.0101010101 -141.3448290631 -0.0446070568 + 0.0202020202 -137.0104526070 -0.2175637353 + 0.0303030303 -129.7020625755 -0.5859581491 + 0.0404040404 -119.8842372434 -1.1913069844 + 0.0505050505 -108.6448335343 -2.0484883705 + 0.0606060606 -97.2145379314 -3.1529671119 + 0.0707070707 -86.2754968622 -4.4871248923 + 0.0808080808 -75.6903444510 -6.0159017496 + 0.0909090909 -64.9129627388 -7.6752597536 \ No newline at end of file diff --git a/tests/parsers/fixtures/pp/default_1d_spherical/aiida.out b/tests/parsers/fixtures/pp/default_1d_spherical/aiida.out new file mode 100644 index 000000000..b8fc3a822 --- /dev/null +++ b/tests/parsers/fixtures/pp/default_1d_spherical/aiida.out @@ -0,0 +1,49 @@ + + Program POST-PROC v.6.4 starts on 23Oct2019 at 10:42:53 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 4 processors + + MPI processes distributed on 1 nodes + R & G space division: proc/nbgrp/npool/nimage = 4 + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 326 164 40 8876 3132 386 + Max 327 165 41 8881 3135 389 + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout + Min, Max, imaginary charge: -142.755892 7.580972 0.000000 + Plot Type: 1D spherical average Output format: gnuplot + + POST-PROC : 0.55s CPU 0.61s WALL + + + This run was terminated on: 10:42:53 23Oct2019 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= diff --git a/tests/parsers/fixtures/pp/default_2d/aiida.fileout b/tests/parsers/fixtures/pp/default_2d/aiida.fileout new file mode 100644 index 000000000..25cd35190 --- /dev/null +++ b/tests/parsers/fixtures/pp/default_2d/aiida.fileout @@ -0,0 +1,32 @@ + 0.00000000E+00 0.00000000E+00 -0.11360121E+02 + 0.00000000E+00 0.74891736E+00 -0.33869152E+01 + 0.00000000E+00 0.14978347E+01 0.51166997E+00 + 0.00000000E+00 0.22467521E+01 0.94913276E+00 + 0.00000000E+00 0.29956695E+01 0.99630051E+00 + 0.00000000E+00 0.37445868E+01 0.99630051E+00 + 0.00000000E+00 0.44935042E+01 0.94913276E+00 + 0.00000000E+00 0.52424215E+01 0.51166997E+00 + 0.00000000E+00 0.59913389E+01 -0.33869152E+01 + 0.00000000E+00 0.67402563E+01 -0.11360121E+02 + + 0.74891736E+00 0.00000000E+00 -0.33869152E+01 + 0.74891736E+00 0.74891736E+00 -0.77062412E+00 + 0.74891736E+00 0.14978347E+01 0.65713553E+00 + 0.74891736E+00 0.22467521E+01 0.89841042E+00 + 0.74891736E+00 0.29956695E+01 0.97192684E+00 + 0.74891736E+00 0.37445868E+01 0.97192684E+00 + 0.74891736E+00 0.44935042E+01 0.89841042E+00 + 0.74891736E+00 0.52424215E+01 0.65713553E+00 + 0.74891736E+00 0.59913389E+01 -0.77062412E+00 + 0.74891736E+00 0.67402563E+01 -0.33869152E+01 + + 0.14978347E+01 0.00000000E+00 0.51166997E+00 + 0.14978347E+01 0.74891736E+00 0.65713553E+00 + 0.14978347E+01 0.14978347E+01 0.71930384E+00 + 0.14978347E+01 0.22467521E+01 0.78150707E+00 + 0.14978347E+01 0.29956695E+01 0.84065802E+00 + 0.14978347E+01 0.37445868E+01 0.84065802E+00 + 0.14978347E+01 0.44935042E+01 0.78150707E+00 + 0.14978347E+01 0.52424215E+01 0.71930384E+00 + 0.14978347E+01 0.59913389E+01 0.65713553E+00 + 0.14978347E+01 0.67402563E+01 0.51166997E+00 diff --git a/tests/parsers/fixtures/pp/default_2d/aiida.out b/tests/parsers/fixtures/pp/default_2d/aiida.out new file mode 100644 index 000000000..ddf84420d --- /dev/null +++ b/tests/parsers/fixtures/pp/default_2d/aiida.out @@ -0,0 +1,49 @@ + + Program POST-PROC v.6.4 starts on 22Oct2019 at 22:57:48 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 4 processors + + MPI processes distributed on 1 nodes + R & G space division: proc/nbgrp/npool/nimage = 4 + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 326 164 40 8876 3132 386 + Max 327 165 41 8881 3135 389 + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout + Min, Max, imaginary charge: -11.360121 0.996301 0.000000 + Plot Type: 2D contour Output format: gnuplot x,y,f + + POST-PROC : 0.47s CPU 0.50s WALL + + + This run was terminated on: 22:57:48 22Oct2019 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= diff --git a/tests/parsers/fixtures/pp/default_3d/aiida.fileout b/tests/parsers/fixtures/pp/default_3d/aiida.fileout new file mode 100644 index 000000000..38a337961 --- /dev/null +++ b/tests/parsers/fixtures/pp/default_3d/aiida.fileout @@ -0,0 +1,142 @@ + Synthetic cubefile for testing the pp parser +Contains the selected quantity on a FFT grid + 8 0.000000 0.000000 0.000000 + 8 0.337013 0.000000 0.000000 + 8 0.000000 0.337013 0.000000 + 8 0.000000 0.000000 0.337013 + 6 6.000000 6.740256 6.740256 6.740256 + 6 6.000000 6.740256 3.370128 3.370128 + 6 6.000000 3.370128 6.740256 3.370128 + 6 6.000000 3.370128 3.370128 6.740256 + 6 6.000000 5.055192 5.055192 1.685064 + 6 6.000000 5.055192 1.685064 5.055192 + 6 6.000000 1.685064 5.055192 5.055192 + 6 6.000000 1.685064 1.685064 1.685064 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 \ No newline at end of file diff --git a/tests/parsers/fixtures/pp/default_3d/aiida.out b/tests/parsers/fixtures/pp/default_3d/aiida.out new file mode 100644 index 000000000..bcde5375d --- /dev/null +++ b/tests/parsers/fixtures/pp/default_3d/aiida.out @@ -0,0 +1,48 @@ + + Program POST-PROC v.6.4 starts on 22Oct2019 at 22:12:22 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 4 processors + + MPI processes distributed on 1 nodes + R & G space division: proc/nbgrp/npool/nimage = 4 + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 326 164 40 8876 3132 386 + Max 327 165 41 8881 3135 389 + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout + Plot Type: 3D Output format: Gaussian cube + + POST-PROC : 0.56s CPU 0.62s WALL + + + This run was terminated on: 22:12:22 22Oct2019 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= diff --git a/tests/parsers/fixtures/pp/default_3d_failed_format/aiida.fileout b/tests/parsers/fixtures/pp/default_3d_failed_format/aiida.fileout new file mode 100644 index 000000000..b21c16f4e --- /dev/null +++ b/tests/parsers/fixtures/pp/default_3d_failed_format/aiida.fileout @@ -0,0 +1,32 @@ + CRYSTAL + PRIMVEC + 3.566790000 0.000000000 0.000000000 + 0.000000000 3.566790000 0.000000000 + 0.000000000 0.000000000 3.566790000 + PRIMCOORD + 8 1 +C 0.000000000 0.000000000 0.000000000 +C 0.000000000 1.783395000 1.783395000 +C 1.783395000 0.000000000 1.783395000 +C 1.783395000 1.783395000 0.000000000 +C 2.675092500 2.675092500 0.891697500 +C 2.675092500 0.891697500 2.675092500 +C 0.891697500 2.675092500 2.675092500 +C 0.891697500 0.891697500 0.891697500 +BEGIN_BLOCK_DATAGRID_3D +3D_PWSCF +DATAGRID_3D_UNKNOWN + 46 46 46 + 0.000000 0.000000 0.000000 + 3.566790 0.000000 0.000000 + 0.000000 3.566790 0.000000 + 0.000000 0.000000 3.566790 + -0.113601E+02 -0.108054E+02 -0.919189E+01 -0.721051E+01 -0.534131E+01 -0.338692E+01 + -0.178434E+01 -0.816609E+00 -0.178545E+00 0.240029E+00 0.511670E+00 0.691046E+00 + 0.800982E+00 0.874753E+00 0.918740E+00 0.949133E+00 0.963852E+00 0.976567E+00 + 0.987008E+00 0.991961E+00 0.996301E+00 0.998413E+00 0.100280E+01 0.100280E+01 + 0.998413E+00 0.996301E+00 0.991961E+00 0.987008E+00 0.976567E+00 0.963852E+00 + 0.949133E+00 0.918740E+00 0.874753E+00 0.800982E+00 0.691046E+00 0.511670E+00 + 0.240029E+00 -0.178545E+00 -0.816609E+00 -0.178434E+01 -0.338692E+01 -0.534131E+01 + -0.721051E+01 -0.919189E+01 -0.108054E+02 -0.113601E+02 -0.108054E+02 -0.102427E+02 + -0.871926E+01 -0.690209E+01 -0.510408E+01 -0.320098E+01 -0.168177E+01 -0.762291E+00 \ No newline at end of file diff --git a/tests/parsers/fixtures/pp/default_3d_failed_format/aiida.out b/tests/parsers/fixtures/pp/default_3d_failed_format/aiida.out new file mode 100644 index 000000000..975897b3b --- /dev/null +++ b/tests/parsers/fixtures/pp/default_3d_failed_format/aiida.out @@ -0,0 +1,45 @@ + + Program POST-PROC v.6.4 starts on 23Oct2019 at 12: 7:22 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 1 processors + + MPI processes distributed on 1 nodes + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + G-vector sticks info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout + Plot Type: 3D Output format: XCrySDen + + POST-PROC : 0.47s CPU 0.49s WALL + + + This run was terminated on: 12: 7:23 23Oct2019 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= diff --git a/tests/parsers/fixtures/pp/default_3d_failed_interrupted/aiida.fileout b/tests/parsers/fixtures/pp/default_3d_failed_interrupted/aiida.fileout new file mode 100644 index 000000000..38a337961 --- /dev/null +++ b/tests/parsers/fixtures/pp/default_3d_failed_interrupted/aiida.fileout @@ -0,0 +1,142 @@ + Synthetic cubefile for testing the pp parser +Contains the selected quantity on a FFT grid + 8 0.000000 0.000000 0.000000 + 8 0.337013 0.000000 0.000000 + 8 0.000000 0.337013 0.000000 + 8 0.000000 0.000000 0.337013 + 6 6.000000 6.740256 6.740256 6.740256 + 6 6.000000 6.740256 3.370128 3.370128 + 6 6.000000 3.370128 6.740256 3.370128 + 6 6.000000 3.370128 3.370128 6.740256 + 6 6.000000 5.055192 5.055192 1.685064 + 6 6.000000 5.055192 1.685064 5.055192 + 6 6.000000 1.685064 5.055192 5.055192 + 6 6.000000 1.685064 1.685064 1.685064 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 + -0.11488E+02 -0.92624E+01 -0.45999E+01 -0.11592E+01 0.24463E+00 0.77250E+00 + 0.95788E+00 0.10154E+01 \ No newline at end of file diff --git a/tests/parsers/fixtures/pp/default_3d_failed_interrupted/aiida.out b/tests/parsers/fixtures/pp/default_3d_failed_interrupted/aiida.out new file mode 100644 index 000000000..3b416736b --- /dev/null +++ b/tests/parsers/fixtures/pp/default_3d_failed_interrupted/aiida.out @@ -0,0 +1,38 @@ + + Program POST-PROC v.6.4 starts on 22Oct2019 at 22:12:22 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 4 processors + + MPI processes distributed on 1 nodes + R & G space division: proc/nbgrp/npool/nimage = 4 + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 326 164 40 8876 3132 386 + Max 327 165 41 8881 3135 389 + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout \ No newline at end of file diff --git a/tests/parsers/fixtures/pp/default_3d_failed_missing/.gitignore b/tests/parsers/fixtures/pp/default_3d_failed_missing/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/tests/parsers/fixtures/pp/default_3d_failed_missing_data/aiida.out b/tests/parsers/fixtures/pp/default_3d_failed_missing_data/aiida.out new file mode 100644 index 000000000..bcde5375d --- /dev/null +++ b/tests/parsers/fixtures/pp/default_3d_failed_missing_data/aiida.out @@ -0,0 +1,48 @@ + + Program POST-PROC v.6.4 starts on 22Oct2019 at 22:12:22 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 4 processors + + MPI processes distributed on 1 nodes + R & G space division: proc/nbgrp/npool/nimage = 4 + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 326 164 40 8876 3132 386 + Max 327 165 41 8881 3135 389 + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout + Plot Type: 3D Output format: Gaussian cube + + POST-PROC : 0.56s CPU 0.62s WALL + + + This run was terminated on: 22:12:22 22Oct2019 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= diff --git a/tests/parsers/fixtures/pp/default_polar/aiida.fileout b/tests/parsers/fixtures/pp/default_polar/aiida.fileout new file mode 100644 index 000000000..92548aef9 --- /dev/null +++ b/tests/parsers/fixtures/pp/default_polar/aiida.fileout @@ -0,0 +1,17 @@ + 4 4 + -0.10789440424365E+01 + -0.10785284448664E+01 + -0.10819396627797E+01 + -0.10797277992434E+01 + -0.10772556878210E+01 + -0.10772556878211E+01 + -0.10797277992434E+01 + -0.10819396627797E+01 + -0.10785284448664E+01 + -0.10789440424365E+01 + -0.10789440424365E+01 + -0.10678232652825E+01 + -0.10576360179342E+01 + -0.10562428850720E+01 + -0.10676343074302E+01 + -0.10975948489090E+01 \ No newline at end of file diff --git a/tests/parsers/fixtures/pp/default_polar/aiida.out b/tests/parsers/fixtures/pp/default_polar/aiida.out new file mode 100644 index 000000000..cc7dbea80 --- /dev/null +++ b/tests/parsers/fixtures/pp/default_polar/aiida.out @@ -0,0 +1,49 @@ + + Program POST-PROC v.6.4 starts on 2Apr2020 at 8: 4: 8 + + This program is part of the open-source Quantum ESPRESSO suite + for quantum simulation of materials; please cite + "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); + "P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017); + URL http://www.quantum-espresso.org", + in publications or presentations arising from this work. More details at + http://www.quantum-espresso.org/quote + + Parallel version (MPI), running on 4 processors + + MPI processes distributed on 1 nodes + R & G space division: proc/nbgrp/npool/nimage = 4 + + IMPORTANT: XC functional enforced from input : + Exchange-correlation = PBE ( 1 4 3 4 0 0) + Any further DFT definition will be discarded + Please, verify this is what you really want + + file C.pbe-n-kjpaw_psl.1.0.0.UPF: wavefunction(s) 2S 2P renormalized + + Parallelization info + -------------------- + sticks: dense smooth PW G-vecs: dense smooth PW + Min 326 164 40 8876 3132 386 + Max 327 165 41 8881 3135 389 + Sum 1305 657 161 35513 12533 1551 + + + Check: negative core charge= -0.000013 + + Calling punch_plot, plot_num = 11 + Writing data to file aiida.filplot + Reading data from file aiida.filplot + + Writing data to be plotted to file aiida.fileout + Min, Max, imaginary charge: -1.122469 -1.056243 0.000000 + Plot Type: 2D polar on a sphere Output format: gnuplot + + POST-PROC : 0.57s CPU 0.63s WALL + + + This run was terminated on: 8: 4: 9 2Apr2020 + +=------------------------------------------------------------------------------= + JOB DONE. +=------------------------------------------------------------------------------= diff --git a/tests/parsers/test_pp.py b/tests/parsers/test_pp.py new file mode 100644 index 000000000..2cf8d841b --- /dev/null +++ b/tests/parsers/test_pp.py @@ -0,0 +1,363 @@ +# -*- coding: utf-8 -*- +# pylint: disable=invalid-name,redefined-outer-name +"""Tests for the `PpParser`.""" +from __future__ import absolute_import + +import pytest + +from aiida import orm +from aiida.common import AttributeDict + + +@pytest.fixture +def generate_inputs_1d(): + """Return inputs that parser will expect for the 1D case.""" + + inputs = { + 'parent_folder': + orm.FolderData().store(), + 'parameters': + orm.Dict( + dict={ + 'INPUTPP': { + 'plot_num': 11 + }, + 'PLOT': { + 'iflag': 1, + 'e1': [[1, 1.0], [2, 0.0], [3, 0.0]], + 'x0': [[1, 0.], [2, 0.], [3, 0.]], + 'nx': 100 + } + } + ) + } + return AttributeDict(inputs) + + +@pytest.fixture +def generate_inputs_1d_spherical(): + """Return inputs that parser will expect for the 1D case with spherical averaging.""" + + inputs = { + 'parent_folder': + orm.FolderData().store(), + 'parameters': + orm.Dict( + dict={ + 'INPUTPP': { + 'plot_num': 11 + }, + 'PLOT': { + 'iflag': 0, + 'e1': [[1, 1.0], [2, 0.0], [3, 0.0]], + 'x0': [[1, 0.], [2, 0.], [3, 0.]], + 'nx': 100 + } + } + ) + } + return AttributeDict(inputs) + + +@pytest.fixture +def generate_inputs_2d(): + """Return inputs that parser will expect for the 2D case.""" + + inputs = { + 'parent_folder': + orm.FolderData().store(), + 'parameters': + orm.Dict( + dict={ + 'INPUTPP': { + 'plot_num': 11 + }, + 'PLOT': { + 'iflag': 2, + 'e1': [[1, 1.0], [2, 0.0], [3, 0.0]], + 'e2': [[1, 0.0], [2, 1.0], [3, 0.0]], + 'x0': [[1, 0.], [2, 0.], [3, 0.]], + 'nx': 10, + 'ny': 10 + } + } + ) + } + return AttributeDict(inputs) + + +@pytest.fixture +def generate_inputs_polar(): + """Return inputs that parser will expect for the polar case.""" + + inputs = { + 'parent_folder': + orm.FolderData().store(), + 'parameters': + orm.Dict( + dict={ + 'INPUTPP': { + 'plot_num': 11 + }, + 'PLOT': { + 'iflag': 4, + 'e1': [[1, 1.0], [2, 0.0], [3, 0.0]], + 'x0': [[1, 0.], [2, 0.], [3, 0.]], + 'nx': 100 + } + } + ) + } + return AttributeDict(inputs) + + +@pytest.fixture +def generate_inputs_3d(): + """Return inputs that parser will expect for the 3D case.""" + + inputs = { + 'parent_folder': orm.FolderData().store(), + 'parameters': orm.Dict(dict={ + 'INPUTPP': { + 'plot_num': 11 + }, + 'PLOT': { + 'iflag': 3, + } + }) + } + return AttributeDict(inputs) + + +def test_pp_default_1d( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_1d, data_regression, + num_regression +): + """Test a default `pp.x` calculation producing a 1D data set.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_1d', generate_inputs_1d) + parser = generate_parser(entry_point_parser) + results, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_finished_ok, calcfunction.exit_message + assert 'output_parameters' in results + assert 'output_data' in results + assert len(results['output_data'].get_arraynames()) == 4 + data_array = results['output_data'].get_array('data') + coords_array = results['output_data'].get_array('x_coordinates') + units_array = results['output_data'].get_array('x_coordinates_units') + num_regression.check({ + 'data_array': data_array, + 'coords_array': coords_array + }, + default_tolerance=dict(atol=0, rtol=1e-18)) + data_regression.check({'parameters': results['output_parameters'].get_dict(), 'units_array': units_array.tolist()}) + + +def test_pp_default_1d_spherical( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_1d_spherical, + data_regression, num_regression +): + """Test a default `pp.x` calculation producing a 1D data set with spherical averaging.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_1d_spherical', generate_inputs_1d_spherical + ) + parser = generate_parser(entry_point_parser) + results, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_finished_ok, calcfunction.exit_message + assert 'output_parameters' in results + assert 'output_data' in results + assert len(results['output_data'].get_arraynames()) == 6 + data_array = results['output_data'].get_array('data') + data_array_int = results['output_data'].get_array('integrated_data') + coords_array = results['output_data'].get_array('x_coordinates') + data_units_array = results['output_data'].get_array('data_units') + data_int_units_array = results['output_data'].get_array('integrated_data_units') + coords_units_array = results['output_data'].get_array('x_coordinates_units') + num_regression.check({ + 'data_array': data_array, + 'data_array_int': data_array_int, + 'coords_array': coords_array + }, + default_tolerance=dict(atol=0, rtol=1e-18)) + data_regression.check({ + 'parameters': results['output_parameters'].get_dict(), + 'data_units_array': data_units_array.tolist(), + 'data_int_units_array': data_int_units_array.tolist(), + 'coords_units_array': coords_units_array.tolist(), + }) + + +def test_pp_default_2d( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_2d, data_regression, + num_regression +): + """Test a default `pp.x` calculation producing a 2D data set.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_2d', generate_inputs_2d) + parser = generate_parser(entry_point_parser) + results, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_finished_ok, calcfunction.exit_message + assert 'output_parameters' in results + assert 'output_data' in results + assert len(results['output_data'].get_arraynames()) == 4 + data_array = results['output_data'].get_array('data').flatten() + coords_array = results['output_data'].get_array('xy_coordinates').flatten() + data_units_array = results['output_data'].get_array('data_units') + coords_units_array = results['output_data'].get_array('xy_coordinates_units') + num_regression.check({ + 'data_array': data_array, + 'coords_array': coords_array + }, + default_tolerance=dict(atol=0, rtol=1e-18)) + data_regression.check({ + 'parameters': results['output_parameters'].get_dict(), + 'data_units': data_units_array.tolist(), + 'coords_units': coords_units_array.tolist() + }) + + +def test_pp_default_polar( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_polar, data_regression, + num_regression +): + """Test a default `pp.x` calculation producing a polar coordinates data set.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_polar', generate_inputs_polar) + parser = generate_parser(entry_point_parser) + results, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_finished_ok, calcfunction.exit_message + assert 'output_parameters' in results + assert 'output_data' in results + assert len(results['output_data'].get_arraynames()) == 2 + data_array = results['output_data'].get_array('data') + data_units_array = results['output_data'].get_array('data_units') + num_regression.check({ + 'data_array': data_array, + }, default_tolerance=dict(atol=0, rtol=1e-18)) + data_regression.check({ + 'parameters': results['output_parameters'].get_dict(), + 'data_units': data_units_array.tolist(), + }) + + +def test_pp_default_3d( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_3d, data_regression, + num_regression +): + """Test a default `pp.x` calculation producing a 3D data set.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_3d', generate_inputs_3d) + parser = generate_parser(entry_point_parser) + results, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_finished_ok, calcfunction.exit_message + assert 'output_parameters' in results + assert 'output_data' in results + assert len(results['output_data'].get_arraynames()) == 4 + data_array = results['output_data'].get_array('data').flatten() + voxel_array = results['output_data'].get_array('voxel').flatten() + data_units_array = results['output_data'].get_array('data_units') + coordinates_units_array = results['output_data'].get_array('coordinates_units') + num_regression.check({ + 'data_array': data_array, + 'voxel_array': voxel_array, + }, + default_tolerance=dict(atol=0, rtol=1e-18)) + data_regression.check({ + 'parameters': results['output_parameters'].get_dict(), + 'data_units': data_units_array.tolist(), + 'coordinates_units': coordinates_units_array.tolist() + }) + + +def test_pp_default_3d_failed_missing( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_3d +): + """Test a default `pp.x` calculation where no files are retrieved, or StdOut is missing.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_3d_failed_missing', generate_inputs_3d + ) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + # This exception always fires first, although specifically it is for a missing StdOut file + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_OUTPUT_STDOUT_MISSING.status + + +def test_pp_default_3d_failed_missing_data( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_3d +): + """Test a default `pp.x` calculation where the aiida.fileout file is missing.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_3d_failed_missing_data', generate_inputs_3d + ) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_OUTPUT_DATAFILE_MISSING.status + + +def test_pp_default_3d_failed_interrupted( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_3d +): + """Test a default `pp.x` calculation where the StdOut file is present but incomplete.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_3d_failed_interrupted', generate_inputs_3d + ) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_OUTPUT_STDOUT_INCOMPLETE.status + + +def test_pp_default_3d_failed_format( + aiida_profile, fixture_localhost, generate_calc_job_node, generate_parser, generate_inputs_3d +): + """Test a default `pp.x` calculation where an unsupported output file format is used.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_3d_failed_format', generate_inputs_3d + ) + parser = generate_parser(entry_point_parser) + _, calcfunction = parser.parse_from_node(node, store_provenance=False) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_failed, calcfunction.exit_status + assert calcfunction.exit_status == node.process_class.exit_codes.ERROR_UNSUPPORTED_DATAFILE_FORMAT.status diff --git a/tests/parsers/test_pp/test_pp_default_1d.csv b/tests/parsers/test_pp/test_pp_default_1d.csv new file mode 100644 index 000000000..0f27b8f0b --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_1d.csv @@ -0,0 +1,11 @@ +,data_array,coords_array +0,-11.3601206194,0 +1,-11.247848471199999,0.0101010101 +2,-10.9031326566,0.0202020202 +3,-10.322134378199999,0.030303030299999999 +4,-9.5416598550000007,0.040404040400000001 +5,-8.6478189645000008,0.050505050500000002 +6,-7.7382726743000001,0.060606060599999997 +7,-6.8674698320000003,0.070707070699999999 +8,-6.0247906850000001,0.080808080800000001 +9,-5.1668428439999996,0.090909090900000003 diff --git a/tests/parsers/test_pp/test_pp_default_1d.yml b/tests/parsers/test_pp/test_pp_default_1d.yml new file mode 100644 index 000000000..c8bba1027 --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_1d.yml @@ -0,0 +1,9 @@ +parameters: + charge_img: 0.0 + charge_max: 1.003621 + charge_min: -11.360121 + negative_core_charge: -1.3e-05 + output_format: gnuplot + plot_num: 11 + plot_type: 1D along a line +units_array: bohr diff --git a/tests/parsers/test_pp/test_pp_default_1d_spherical.csv b/tests/parsers/test_pp/test_pp_default_1d_spherical.csv new file mode 100644 index 000000000..64e627753 --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_1d_spherical.csv @@ -0,0 +1,11 @@ +,data_array,data_array_int,coords_array +0,-142.7558915079,0,0 +1,-141.34482906310001,-0.044607056800000003,0.0101010101 +2,-137.01045260699999,-0.21756373530000001,0.0202020202 +3,-129.70206257550001,-0.58595814909999999,0.030303030299999999 +4,-119.88423724339999,-1.1913069843999999,0.040404040400000001 +5,-108.64483353430001,-2.0484883704999999,0.050505050500000002 +6,-97.214537931400002,-3.1529671118999998,0.060606060599999997 +7,-86.275496862200001,-4.4871248922999998,0.070707070699999999 +8,-75.690344451000001,-6.0159017496000002,0.080808080800000001 +9,-64.912962738800005,-7.6752597535999998,0.090909090900000003 diff --git a/tests/parsers/test_pp/test_pp_default_1d_spherical.yml b/tests/parsers/test_pp/test_pp_default_1d_spherical.yml new file mode 100644 index 000000000..26a532b29 --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_1d_spherical.yml @@ -0,0 +1,11 @@ +coords_units_array: bohr +data_int_units_array: Ry +data_units_array: Ry +parameters: + charge_img: 0.0 + charge_max: 7.580972 + charge_min: -142.755892 + negative_core_charge: -1.3e-05 + output_format: gnuplot + plot_num: 11 + plot_type: 1D spherical average diff --git a/tests/parsers/test_pp/test_pp_default_2d.csv b/tests/parsers/test_pp/test_pp_default_2d.csv new file mode 100644 index 000000000..8d1e63586 --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_2d.csv @@ -0,0 +1,61 @@ +,data_array,coords_array +0,-11.360120999999999,0 +1,-3.3869151999999998,0 +2,0.51166997000000003,0 +3,0.94913276000000002,0.74891735999999998 +4,0.99630050999999997,0 +5,0.99630050999999997,1.4978347000000001 +6,0.94913276000000002,0 +7,0.51166997000000003,2.2467521000000001 +8,-3.3869151999999998,0 +9,-11.360120999999999,2.9956695 +10,-3.3869151999999998,0 +11,-0.77062412000000002,3.7445868 +12,0.65713553000000002,0 +13,0.89841042000000004,4.4935042000000003 +14,0.97192683999999996,0 +15,0.97192683999999996,5.2424214999999998 +16,0.89841042000000004,0 +17,0.65713553000000002,5.9913388999999997 +18,-0.77062412000000002,0 +19,-3.3869151999999998,6.7402563000000004 +20,0.51166997000000003,0.74891735999999998 +21,0.65713553000000002,0 +22,0.71930384000000003,0.74891735999999998 +23,0.78150706999999997,0.74891735999999998 +24,0.84065802000000001,0.74891735999999998 +25,0.84065802000000001,1.4978347000000001 +26,0.78150706999999997,0.74891735999999998 +27,0.71930384000000003,2.2467521000000001 +28,0.65713553000000002,0.74891735999999998 +29,0.51166997000000003,2.9956695 +30,,0.74891735999999998 +31,,3.7445868 +32,,0.74891735999999998 +33,,4.4935042000000003 +34,,0.74891735999999998 +35,,5.2424214999999998 +36,,0.74891735999999998 +37,,5.9913388999999997 +38,,0.74891735999999998 +39,,6.7402563000000004 +40,,1.4978347000000001 +41,,0 +42,,1.4978347000000001 +43,,0.74891735999999998 +44,,1.4978347000000001 +45,,1.4978347000000001 +46,,1.4978347000000001 +47,,2.2467521000000001 +48,,1.4978347000000001 +49,,2.9956695 +50,,1.4978347000000001 +51,,3.7445868 +52,,1.4978347000000001 +53,,4.4935042000000003 +54,,1.4978347000000001 +55,,5.2424214999999998 +56,,1.4978347000000001 +57,,5.9913388999999997 +58,,1.4978347000000001 +59,,6.7402563000000004 diff --git a/tests/parsers/test_pp/test_pp_default_2d.yml b/tests/parsers/test_pp/test_pp_default_2d.yml new file mode 100644 index 000000000..1524afa9c --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_2d.yml @@ -0,0 +1,10 @@ +coords_units: bohr +data_units: Ry +parameters: + charge_img: 0.0 + charge_max: 0.996301 + charge_min: -11.360121 + negative_core_charge: -1.3e-05 + output_format: gnuplot x,y,f + plot_num: 11 + plot_type: 2D contour diff --git a/tests/parsers/test_pp/test_pp_default_3d.csv b/tests/parsers/test_pp/test_pp_default_3d.csv new file mode 100644 index 000000000..12ceadfea --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_3d.csv @@ -0,0 +1,513 @@ +,data_array,voxel_array +0,-11.488,0.33701300000000001 +1,-9.2623999999999995,0 +2,-4.5998999999999999,0 +3,-1.1592,0 +4,0.24462999999999999,0.33701300000000001 +5,0.77249999999999996,0 +6,0.95787999999999995,0 +7,1.0154000000000001,0 +8,-11.488,0.33701300000000001 +9,-9.2623999999999995, +10,-4.5998999999999999, +11,-1.1592, +12,0.24462999999999999, +13,0.77249999999999996, +14,0.95787999999999995, +15,1.0154000000000001, +16,-11.488, +17,-9.2623999999999995, +18,-4.5998999999999999, +19,-1.1592, +20,0.24462999999999999, +21,0.77249999999999996, +22,0.95787999999999995, +23,1.0154000000000001, +24,-11.488, +25,-9.2623999999999995, +26,-4.5998999999999999, +27,-1.1592, +28,0.24462999999999999, +29,0.77249999999999996, +30,0.95787999999999995, +31,1.0154000000000001, +32,-11.488, +33,-9.2623999999999995, +34,-4.5998999999999999, +35,-1.1592, +36,0.24462999999999999, +37,0.77249999999999996, +38,0.95787999999999995, +39,1.0154000000000001, +40,-11.488, +41,-9.2623999999999995, +42,-4.5998999999999999, +43,-1.1592, +44,0.24462999999999999, +45,0.77249999999999996, +46,0.95787999999999995, +47,1.0154000000000001, +48,-11.488, +49,-9.2623999999999995, +50,-4.5998999999999999, +51,-1.1592, +52,0.24462999999999999, +53,0.77249999999999996, +54,0.95787999999999995, +55,1.0154000000000001, +56,-11.488, +57,-9.2623999999999995, +58,-4.5998999999999999, +59,-1.1592, +60,0.24462999999999999, +61,0.77249999999999996, +62,0.95787999999999995, +63,1.0154000000000001, +64,-11.488, +65,-9.2623999999999995, +66,-4.5998999999999999, +67,-1.1592, +68,0.24462999999999999, +69,0.77249999999999996, +70,0.95787999999999995, +71,1.0154000000000001, +72,-11.488, +73,-9.2623999999999995, +74,-4.5998999999999999, +75,-1.1592, +76,0.24462999999999999, +77,0.77249999999999996, +78,0.95787999999999995, +79,1.0154000000000001, +80,-11.488, +81,-9.2623999999999995, +82,-4.5998999999999999, +83,-1.1592, +84,0.24462999999999999, +85,0.77249999999999996, +86,0.95787999999999995, +87,1.0154000000000001, +88,-11.488, +89,-9.2623999999999995, +90,-4.5998999999999999, +91,-1.1592, +92,0.24462999999999999, +93,0.77249999999999996, +94,0.95787999999999995, +95,1.0154000000000001, +96,-11.488, +97,-9.2623999999999995, +98,-4.5998999999999999, +99,-1.1592, +100,0.24462999999999999, +101,0.77249999999999996, +102,0.95787999999999995, +103,1.0154000000000001, +104,-11.488, +105,-9.2623999999999995, +106,-4.5998999999999999, +107,-1.1592, +108,0.24462999999999999, +109,0.77249999999999996, +110,0.95787999999999995, +111,1.0154000000000001, +112,-11.488, +113,-9.2623999999999995, +114,-4.5998999999999999, +115,-1.1592, +116,0.24462999999999999, +117,0.77249999999999996, +118,0.95787999999999995, +119,1.0154000000000001, +120,-11.488, +121,-9.2623999999999995, +122,-4.5998999999999999, +123,-1.1592, +124,0.24462999999999999, +125,0.77249999999999996, +126,0.95787999999999995, +127,1.0154000000000001, +128,-11.488, +129,-9.2623999999999995, +130,-4.5998999999999999, +131,-1.1592, +132,0.24462999999999999, +133,0.77249999999999996, +134,0.95787999999999995, +135,1.0154000000000001, +136,-11.488, +137,-9.2623999999999995, +138,-4.5998999999999999, +139,-1.1592, +140,0.24462999999999999, +141,0.77249999999999996, +142,0.95787999999999995, +143,1.0154000000000001, +144,-11.488, +145,-9.2623999999999995, +146,-4.5998999999999999, +147,-1.1592, +148,0.24462999999999999, +149,0.77249999999999996, +150,0.95787999999999995, +151,1.0154000000000001, +152,-11.488, +153,-9.2623999999999995, +154,-4.5998999999999999, +155,-1.1592, +156,0.24462999999999999, +157,0.77249999999999996, +158,0.95787999999999995, +159,1.0154000000000001, +160,-11.488, +161,-9.2623999999999995, +162,-4.5998999999999999, +163,-1.1592, +164,0.24462999999999999, +165,0.77249999999999996, +166,0.95787999999999995, +167,1.0154000000000001, +168,-11.488, +169,-9.2623999999999995, +170,-4.5998999999999999, +171,-1.1592, +172,0.24462999999999999, +173,0.77249999999999996, +174,0.95787999999999995, +175,1.0154000000000001, +176,-11.488, +177,-9.2623999999999995, +178,-4.5998999999999999, +179,-1.1592, +180,0.24462999999999999, +181,0.77249999999999996, +182,0.95787999999999995, +183,1.0154000000000001, +184,-11.488, +185,-9.2623999999999995, +186,-4.5998999999999999, +187,-1.1592, +188,0.24462999999999999, +189,0.77249999999999996, +190,0.95787999999999995, +191,1.0154000000000001, +192,-11.488, +193,-9.2623999999999995, +194,-4.5998999999999999, +195,-1.1592, +196,0.24462999999999999, +197,0.77249999999999996, +198,0.95787999999999995, +199,1.0154000000000001, +200,-11.488, +201,-9.2623999999999995, +202,-4.5998999999999999, +203,-1.1592, +204,0.24462999999999999, +205,0.77249999999999996, +206,0.95787999999999995, +207,1.0154000000000001, +208,-11.488, +209,-9.2623999999999995, +210,-4.5998999999999999, +211,-1.1592, +212,0.24462999999999999, +213,0.77249999999999996, +214,0.95787999999999995, +215,1.0154000000000001, +216,-11.488, +217,-9.2623999999999995, +218,-4.5998999999999999, +219,-1.1592, +220,0.24462999999999999, +221,0.77249999999999996, +222,0.95787999999999995, +223,1.0154000000000001, +224,-11.488, +225,-9.2623999999999995, +226,-4.5998999999999999, +227,-1.1592, +228,0.24462999999999999, +229,0.77249999999999996, +230,0.95787999999999995, +231,1.0154000000000001, +232,-11.488, +233,-9.2623999999999995, +234,-4.5998999999999999, +235,-1.1592, +236,0.24462999999999999, +237,0.77249999999999996, +238,0.95787999999999995, +239,1.0154000000000001, +240,-11.488, +241,-9.2623999999999995, +242,-4.5998999999999999, +243,-1.1592, +244,0.24462999999999999, +245,0.77249999999999996, +246,0.95787999999999995, +247,1.0154000000000001, +248,-11.488, +249,-9.2623999999999995, +250,-4.5998999999999999, +251,-1.1592, +252,0.24462999999999999, +253,0.77249999999999996, +254,0.95787999999999995, +255,1.0154000000000001, +256,-11.488, +257,-9.2623999999999995, +258,-4.5998999999999999, +259,-1.1592, +260,0.24462999999999999, +261,0.77249999999999996, +262,0.95787999999999995, +263,1.0154000000000001, +264,-11.488, +265,-9.2623999999999995, +266,-4.5998999999999999, +267,-1.1592, +268,0.24462999999999999, +269,0.77249999999999996, +270,0.95787999999999995, +271,1.0154000000000001, +272,-11.488, +273,-9.2623999999999995, +274,-4.5998999999999999, +275,-1.1592, +276,0.24462999999999999, +277,0.77249999999999996, +278,0.95787999999999995, +279,1.0154000000000001, +280,-11.488, +281,-9.2623999999999995, +282,-4.5998999999999999, +283,-1.1592, +284,0.24462999999999999, +285,0.77249999999999996, +286,0.95787999999999995, +287,1.0154000000000001, +288,-11.488, +289,-9.2623999999999995, +290,-4.5998999999999999, +291,-1.1592, +292,0.24462999999999999, +293,0.77249999999999996, +294,0.95787999999999995, +295,1.0154000000000001, +296,-11.488, +297,-9.2623999999999995, +298,-4.5998999999999999, +299,-1.1592, +300,0.24462999999999999, +301,0.77249999999999996, +302,0.95787999999999995, +303,1.0154000000000001, +304,-11.488, +305,-9.2623999999999995, +306,-4.5998999999999999, +307,-1.1592, +308,0.24462999999999999, +309,0.77249999999999996, +310,0.95787999999999995, +311,1.0154000000000001, +312,-11.488, +313,-9.2623999999999995, +314,-4.5998999999999999, +315,-1.1592, +316,0.24462999999999999, +317,0.77249999999999996, +318,0.95787999999999995, +319,1.0154000000000001, +320,-11.488, +321,-9.2623999999999995, +322,-4.5998999999999999, +323,-1.1592, +324,0.24462999999999999, +325,0.77249999999999996, +326,0.95787999999999995, +327,1.0154000000000001, +328,-11.488, +329,-9.2623999999999995, +330,-4.5998999999999999, +331,-1.1592, +332,0.24462999999999999, +333,0.77249999999999996, +334,0.95787999999999995, +335,1.0154000000000001, +336,-11.488, +337,-9.2623999999999995, +338,-4.5998999999999999, +339,-1.1592, +340,0.24462999999999999, +341,0.77249999999999996, +342,0.95787999999999995, +343,1.0154000000000001, +344,-11.488, +345,-9.2623999999999995, +346,-4.5998999999999999, +347,-1.1592, +348,0.24462999999999999, +349,0.77249999999999996, +350,0.95787999999999995, +351,1.0154000000000001, +352,-11.488, +353,-9.2623999999999995, +354,-4.5998999999999999, +355,-1.1592, +356,0.24462999999999999, +357,0.77249999999999996, +358,0.95787999999999995, +359,1.0154000000000001, +360,-11.488, +361,-9.2623999999999995, +362,-4.5998999999999999, +363,-1.1592, +364,0.24462999999999999, +365,0.77249999999999996, +366,0.95787999999999995, +367,1.0154000000000001, +368,-11.488, +369,-9.2623999999999995, +370,-4.5998999999999999, +371,-1.1592, +372,0.24462999999999999, +373,0.77249999999999996, +374,0.95787999999999995, +375,1.0154000000000001, +376,-11.488, +377,-9.2623999999999995, +378,-4.5998999999999999, +379,-1.1592, +380,0.24462999999999999, +381,0.77249999999999996, +382,0.95787999999999995, +383,1.0154000000000001, +384,-11.488, +385,-9.2623999999999995, +386,-4.5998999999999999, +387,-1.1592, +388,0.24462999999999999, +389,0.77249999999999996, +390,0.95787999999999995, +391,1.0154000000000001, +392,-11.488, +393,-9.2623999999999995, +394,-4.5998999999999999, +395,-1.1592, +396,0.24462999999999999, +397,0.77249999999999996, +398,0.95787999999999995, +399,1.0154000000000001, +400,-11.488, +401,-9.2623999999999995, +402,-4.5998999999999999, +403,-1.1592, +404,0.24462999999999999, +405,0.77249999999999996, +406,0.95787999999999995, +407,1.0154000000000001, +408,-11.488, +409,-9.2623999999999995, +410,-4.5998999999999999, +411,-1.1592, +412,0.24462999999999999, +413,0.77249999999999996, +414,0.95787999999999995, +415,1.0154000000000001, +416,-11.488, +417,-9.2623999999999995, +418,-4.5998999999999999, +419,-1.1592, +420,0.24462999999999999, +421,0.77249999999999996, +422,0.95787999999999995, +423,1.0154000000000001, +424,-11.488, +425,-9.2623999999999995, +426,-4.5998999999999999, +427,-1.1592, +428,0.24462999999999999, +429,0.77249999999999996, +430,0.95787999999999995, +431,1.0154000000000001, +432,-11.488, +433,-9.2623999999999995, +434,-4.5998999999999999, +435,-1.1592, +436,0.24462999999999999, +437,0.77249999999999996, +438,0.95787999999999995, +439,1.0154000000000001, +440,-11.488, +441,-9.2623999999999995, +442,-4.5998999999999999, +443,-1.1592, +444,0.24462999999999999, +445,0.77249999999999996, +446,0.95787999999999995, +447,1.0154000000000001, +448,-11.488, +449,-9.2623999999999995, +450,-4.5998999999999999, +451,-1.1592, +452,0.24462999999999999, +453,0.77249999999999996, +454,0.95787999999999995, +455,1.0154000000000001, +456,-11.488, +457,-9.2623999999999995, +458,-4.5998999999999999, +459,-1.1592, +460,0.24462999999999999, +461,0.77249999999999996, +462,0.95787999999999995, +463,1.0154000000000001, +464,-11.488, +465,-9.2623999999999995, +466,-4.5998999999999999, +467,-1.1592, +468,0.24462999999999999, +469,0.77249999999999996, +470,0.95787999999999995, +471,1.0154000000000001, +472,-11.488, +473,-9.2623999999999995, +474,-4.5998999999999999, +475,-1.1592, +476,0.24462999999999999, +477,0.77249999999999996, +478,0.95787999999999995, +479,1.0154000000000001, +480,-11.488, +481,-9.2623999999999995, +482,-4.5998999999999999, +483,-1.1592, +484,0.24462999999999999, +485,0.77249999999999996, +486,0.95787999999999995, +487,1.0154000000000001, +488,-11.488, +489,-9.2623999999999995, +490,-4.5998999999999999, +491,-1.1592, +492,0.24462999999999999, +493,0.77249999999999996, +494,0.95787999999999995, +495,1.0154000000000001, +496,-11.488, +497,-9.2623999999999995, +498,-4.5998999999999999, +499,-1.1592, +500,0.24462999999999999, +501,0.77249999999999996, +502,0.95787999999999995, +503,1.0154000000000001, +504,-11.488, +505,-9.2623999999999995, +506,-4.5998999999999999, +507,-1.1592, +508,0.24462999999999999, +509,0.77249999999999996, +510,0.95787999999999995, +511,1.0154000000000001, diff --git a/tests/parsers/test_pp/test_pp_default_3d.yml b/tests/parsers/test_pp/test_pp_default_3d.yml new file mode 100644 index 000000000..304a04129 --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_3d.yml @@ -0,0 +1,7 @@ +coordinates_units: bohr +data_units: Ry +parameters: + negative_core_charge: -1.3e-05 + output_format: Gaussian cube + plot_num: 11 + plot_type: 3D diff --git a/tests/parsers/test_pp/test_pp_default_polar.csv b/tests/parsers/test_pp/test_pp_default_polar.csv new file mode 100644 index 000000000..2f68deadc --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_polar.csv @@ -0,0 +1,17 @@ +,data_array +0,-1.0789440424365 +1,-1.0785284448664001 +2,-1.0819396627797 +3,-1.0797277992434 +4,-1.077255687821 +5,-1.0772556878210999 +6,-1.0797277992434 +7,-1.0819396627797 +8,-1.0785284448664001 +9,-1.0789440424365 +10,-1.0789440424365 +11,-1.0678232652824999 +12,-1.0576360179341999 +13,-1.056242885072 +14,-1.0676343074301999 +15,-1.0975948489089999 diff --git a/tests/parsers/test_pp/test_pp_default_polar.yml b/tests/parsers/test_pp/test_pp_default_polar.yml new file mode 100644 index 000000000..af6328074 --- /dev/null +++ b/tests/parsers/test_pp/test_pp_default_polar.yml @@ -0,0 +1,10 @@ +data_units: +- Ry +parameters: + charge_img: 0.0 + charge_max: -1.056243 + charge_min: -1.122469 + negative_core_charge: -1.3e-05 + output_format: gnuplot + plot_num: 11 + plot_type: 2D polar on a sphere