From 0a40d5a50429f9b34432259de788735385a3ce52 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Wed, 22 May 2024 15:46:21 +0200 Subject: [PATCH 1/9] Add parse_retrieved_files option for the PP plugin. The option enables switching on/off the parsing of the output files produced by the PP plugin. --- src/aiida_quantumespresso/calculations/pp.py | 7 ++- src/aiida_quantumespresso/parsers/pp.py | 58 ++++++++++---------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/aiida_quantumespresso/calculations/pp.py b/src/aiida_quantumespresso/calculations/pp.py index e0c1c0ca9..c7347aadc 100644 --- a/src/aiida_quantumespresso/calculations/pp.py +++ b/src/aiida_quantumespresso/calculations/pp.py @@ -83,6 +83,7 @@ def define(cls, spec): spec.input('metadata.options.parser_name', valid_type=str, 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.input('metadata.options.parse_retrieved_files', valid_type=bool, default=True) spec.output('output_parameters', valid_type=orm.Dict) spec.output('output_data', valid_type=orm.ArrayData) @@ -218,10 +219,10 @@ def prepare_for_submission(self, folder): # pylint: disable=too-many-branches,t # distinguish them from one another. The `fileout` filename will be the full data filename with the `fileout` # value as a suffix. retrieve_tuples = [self._FILEOUT, (f'{self._FILPLOT}_*{self._FILEOUT}', '.', 0)] - if self.inputs.metadata.options.keep_plot_file: calcinfo.retrieve_list.extend(retrieve_tuples) - else: + # If we do not want to parse the retrieved files, temporary retrieval is meaningless + elif self.inputs.metadata.options.parse_retrieved_files: calcinfo.retrieve_temporary_list.extend(retrieve_tuples) - return calcinfo + return calcinfo diff --git a/src/aiida_quantumespresso/parsers/pp.py b/src/aiida_quantumespresso/parsers/pp.py index 6132eee27..687b05035 100644 --- a/src/aiida_quantumespresso/parsers/pp.py +++ b/src/aiida_quantumespresso/parsers/pp.py @@ -117,35 +117,35 @@ def get_key_from_filename(filename): matches = re.search(pattern, filename) return matches.group(1) - for filename in filenames: - # Directly parse the retrieved files after reading them to memory (`data_raw`). The raw data - # of each file is released from memory after parsing, to improve memory usage. - if filename.endswith(filename_suffix): - # Read the file to memory - try: - with file_opener(filename) as handle: - data_raw = handle.read() - except OSError: - return self.exit_codes.ERROR_OUTPUT_DATAFILE_READ.format(filename=filename) - # Parse the file - try: - key = get_key_from_filename(filename) - data_parsed.append((key, parsers[iflag](data_raw, self.units_dict[parsed_data['plot_num']]))) - del data_raw - except Exception as exception: # pylint: disable=broad-except - return self.exit_codes.ERROR_OUTPUT_DATAFILE_PARSE.format(filename=filename, exception=exception) - - # If we don't have any parsed files, we exit. Note that this will not catch the case where there should be more - # than one file, but the engine did not retrieve all of them. Since often we anyway don't know how many files - # should be retrieved there really is no way to check this explicitly. - if not data_parsed: - return self.exit_codes.ERROR_OUTPUT_DATAFILE_MISSING.format(filename=filename_prefix) - - # Create output nodes - if len(data_parsed) == 1: - self.out('output_data', data_parsed[0][1]) - else: - self.out('output_data_multiple', dict(data_parsed)) + if self.node.inputs.metadata.options.parse_retrieved_files: + for filename in filenames: + # Directly parse the retrieved files after reading them to memory (`data_raw`). The raw data + # of each file is released from memory after parsing, to improve memory usage. + if filename.endswith(filename_suffix): + # Read the file to memory + try: + with file_opener(filename) as handle: + data_raw = handle.read() + except OSError: + return self.exit_codes.ERROR_OUTPUT_DATAFILE_READ.format(filename=filename) + # Parse the file + try: + key = get_key_from_filename(filename) + data_parsed.append((key, parsers[iflag](data_raw, self.units_dict[parsed_data['plot_num']]))) + del data_raw + except Exception as exception: # pylint: disable=broad-except + return self.exit_codes.ERROR_OUTPUT_DATAFILE_PARSE.format(filename=filename, exception=exception) + + # If we don't have any parsed files, we exit. Note that this will not catch the case where there should be more + # than one file, but the engine did not retrieve all of them. Since often we anyway don't know how many files + # should be retrieved there really is no way to check this explicitly. + if not data_parsed: + return self.exit_codes.ERROR_OUTPUT_DATAFILE_MISSING.format(filename=filename_prefix) + + if len(data_parsed) == 1: + self.out('output_data', data_parsed[0][1]) + else: + self.out('output_data_multiple', dict(data_parsed)) return self.exit(logs=logs) From e5c8200ee3e659f99974585b3b334776cd4f8938 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Mon, 26 Aug 2024 14:38:51 +0200 Subject: [PATCH 2/9] Fix wrong identation. --- src/aiida_quantumespresso/calculations/pp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/pp.py b/src/aiida_quantumespresso/calculations/pp.py index c7347aadc..3821b7036 100644 --- a/src/aiida_quantumespresso/calculations/pp.py +++ b/src/aiida_quantumespresso/calculations/pp.py @@ -225,4 +225,4 @@ def prepare_for_submission(self, folder): # pylint: disable=too-many-branches,t elif self.inputs.metadata.options.parse_retrieved_files: calcinfo.retrieve_temporary_list.extend(retrieve_tuples) - return calcinfo + return calcinfo From ef05535060fae49015e06cf963998a5e97a89ea0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Mon, 26 Aug 2024 14:44:59 +0200 Subject: [PATCH 3/9] Fix checking the value of the parse_retrieved_files attribure. --- src/aiida_quantumespresso/parsers/pp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/parsers/pp.py b/src/aiida_quantumespresso/parsers/pp.py index 687b05035..f847b583f 100644 --- a/src/aiida_quantumespresso/parsers/pp.py +++ b/src/aiida_quantumespresso/parsers/pp.py @@ -117,7 +117,7 @@ def get_key_from_filename(filename): matches = re.search(pattern, filename) return matches.group(1) - if self.node.inputs.metadata.options.parse_retrieved_files: + if self.node.base.attributes.get('parse_retrieved_files', True): for filename in filenames: # Directly parse the retrieved files after reading them to memory (`data_raw`). The raw data # of each file is released from memory after parsing, to improve memory usage. From 14c098df4f43b6ace26d6f9dd032280c8faea41d Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Thu, 10 Oct 2024 09:56:09 +0200 Subject: [PATCH 4/9] renamings --- src/aiida_quantumespresso/calculations/pp.py | 8 ++++---- src/aiida_quantumespresso/parsers/pp.py | 2 +- tests/calculations/test_pp.py | 4 ++-- tests/parsers/test_pp.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/aiida_quantumespresso/calculations/pp.py b/src/aiida_quantumespresso/calculations/pp.py index 3821b7036..633af8004 100644 --- a/src/aiida_quantumespresso/calculations/pp.py +++ b/src/aiida_quantumespresso/calculations/pp.py @@ -82,8 +82,8 @@ def define(cls, spec): spec.input('metadata.options.output_filename', valid_type=str, default=cls._DEFAULT_OUTPUT_FILE) spec.input('metadata.options.parser_name', valid_type=str, 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.input('metadata.options.parse_retrieved_files', valid_type=bool, default=True) + spec.input('metadata.options.keep_data_files', valid_type=bool, default=True) + spec.input('metadata.options.parse_data_files', valid_type=bool, default=True) spec.output('output_parameters', valid_type=orm.Dict) spec.output('output_data', valid_type=orm.ArrayData) @@ -219,10 +219,10 @@ def prepare_for_submission(self, folder): # pylint: disable=too-many-branches,t # distinguish them from one another. The `fileout` filename will be the full data filename with the `fileout` # value as a suffix. retrieve_tuples = [self._FILEOUT, (f'{self._FILPLOT}_*{self._FILEOUT}', '.', 0)] - if self.inputs.metadata.options.keep_plot_file: + if self.inputs.metadata.options.keep_data_files: calcinfo.retrieve_list.extend(retrieve_tuples) # If we do not want to parse the retrieved files, temporary retrieval is meaningless - elif self.inputs.metadata.options.parse_retrieved_files: + elif self.inputs.metadata.options.parse_data_files: calcinfo.retrieve_temporary_list.extend(retrieve_tuples) return calcinfo diff --git a/src/aiida_quantumespresso/parsers/pp.py b/src/aiida_quantumespresso/parsers/pp.py index f847b583f..6c41f9d45 100644 --- a/src/aiida_quantumespresso/parsers/pp.py +++ b/src/aiida_quantumespresso/parsers/pp.py @@ -117,7 +117,7 @@ def get_key_from_filename(filename): matches = re.search(pattern, filename) return matches.group(1) - if self.node.base.attributes.get('parse_retrieved_files', True): + if self.node.base.attributes.get('parse_data_files', True): for filename in filenames: # Directly parse the retrieved files after reading them to memory (`data_raw`). The raw data # of each file is released from memory after parsing, to improve memory usage. diff --git a/tests/calculations/test_pp.py b/tests/calculations/test_pp.py index a837127d3..1a70a36c5 100644 --- a/tests/calculations/test_pp.py +++ b/tests/calculations/test_pp.py @@ -60,11 +60,11 @@ def test_pp_default(fixture_sandbox, generate_calc_job, generate_inputs, file_re file_regression.check(input_written, encoding='utf-8', extension='.in') -def test_pp_keep_plot_file(fixture_sandbox, generate_calc_job, generate_inputs): +def test_pp_keep_data_files(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 + inputs.metadata.options.keep_data_files = True calc_info = generate_calc_job(fixture_sandbox, entry_point_name, inputs) retrieve_list = ['aiida.out', 'aiida.fileout', ('aiida.filplot_*aiida.fileout', '.', 0)] diff --git a/tests/parsers/test_pp.py b/tests/parsers/test_pp.py index 4211651fd..38a08eaff 100644 --- a/tests/parsers/test_pp.py +++ b/tests/parsers/test_pp.py @@ -297,12 +297,12 @@ def test_pp_default_3d( }) -def test_pp_default_3d_keep_plot_file(generate_calc_job_node, generate_parser, generate_inputs_3d, tmpdir): - """Test a `pp.x` calculation where `keep_plot_file=False` meaning files will be parsed from temporary directory.""" +def test_pp_default_3d_keep_data_files(generate_calc_job_node, generate_parser, generate_inputs_3d, tmpdir): + """Test a `pp.x` calculation where `keep_data_files=False` meaning files will be parsed from temporary directory.""" entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' - attributes = {'options': {'keep_plot_file': False}, 'retrieve_temporary_list': ['aiida.fileout']} + attributes = {'options': {'keep_data_files': False}, 'retrieve_temporary_list': ['aiida.fileout']} node = generate_calc_job_node( entry_point_calc_job, test_name='default_3d', From 103a8ec52d40ab46328c1166889cb600c5db79ac Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Tue, 19 Nov 2024 20:04:53 +0000 Subject: [PATCH 5/9] Keep `keep_plot_file` option for the backward compatibility. --- src/aiida_quantumespresso/calculations/pp.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/aiida_quantumespresso/calculations/pp.py b/src/aiida_quantumespresso/calculations/pp.py index 633af8004..44ffb47f6 100644 --- a/src/aiida_quantumespresso/calculations/pp.py +++ b/src/aiida_quantumespresso/calculations/pp.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- """`CalcJob` implementation for the pp.x code of Quantum ESPRESSO.""" import os +import warnings from aiida import orm from aiida.common import datastructures, exceptions +from aiida.common.warnings import AiidaDeprecationWarning from aiida_quantumespresso.calculations import _lowercase_dict, _uppercase_dict from aiida_quantumespresso.utils.convert import convert_input_to_namelist_entry @@ -82,6 +84,7 @@ def define(cls, spec): spec.input('metadata.options.output_filename', valid_type=str, default=cls._DEFAULT_OUTPUT_FILE) spec.input('metadata.options.parser_name', valid_type=str, default='quantumespresso.pp') spec.input('metadata.options.withmpi', valid_type=bool, default=True) + spec.input('metadata.options.keep_plot_file', valid_type=bool, required=False) spec.input('metadata.options.keep_data_files', valid_type=bool, default=True) spec.input('metadata.options.parse_data_files', valid_type=bool, default=True) @@ -219,6 +222,12 @@ def prepare_for_submission(self, folder): # pylint: disable=too-many-branches,t # distinguish them from one another. The `fileout` filename will be the full data filename with the `fileout` # value as a suffix. retrieve_tuples = [self._FILEOUT, (f'{self._FILPLOT}_*{self._FILEOUT}', '.', 0)] + if 'keep_plot_file' in self.inputs.metadata.options: + self.inputs.metadata.options.keep_data_files = self.inputs.metadata.options.keep_plot_file + warnings.warn( + "The input parameter 'keep_plot_file' is deprecated and will be removed in version 5.0.0. " + "Please use 'keep_data_files' instead.", AiidaDeprecationWarning + ) if self.inputs.metadata.options.keep_data_files: calcinfo.retrieve_list.extend(retrieve_tuples) # If we do not want to parse the retrieved files, temporary retrieval is meaningless From b0bfb2bcf31483f9d7d7a1a50067d502e970a7c4 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Tue, 19 Nov 2024 21:07:22 +0000 Subject: [PATCH 6/9] Fix tests --- src/aiida_quantumespresso/calculations/pp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/calculations/pp.py b/src/aiida_quantumespresso/calculations/pp.py index 44ffb47f6..31cf09955 100644 --- a/src/aiida_quantumespresso/calculations/pp.py +++ b/src/aiida_quantumespresso/calculations/pp.py @@ -85,7 +85,7 @@ def define(cls, spec): spec.input('metadata.options.parser_name', valid_type=str, default='quantumespresso.pp') spec.input('metadata.options.withmpi', valid_type=bool, default=True) spec.input('metadata.options.keep_plot_file', valid_type=bool, required=False) - spec.input('metadata.options.keep_data_files', valid_type=bool, default=True) + spec.input('metadata.options.keep_data_files', valid_type=bool, default=False) spec.input('metadata.options.parse_data_files', valid_type=bool, default=True) spec.output('output_parameters', valid_type=orm.Dict) From 4dee338047233a80fd2b8d371df9a7579af5cae5 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Tue, 19 Nov 2024 21:51:46 +0000 Subject: [PATCH 7/9] Test parse_data_files input. --- src/aiida_quantumespresso/parsers/pp.py | 2 +- tests/calculations/test_pp.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/aiida_quantumespresso/parsers/pp.py b/src/aiida_quantumespresso/parsers/pp.py index 6c41f9d45..d4e41881b 100644 --- a/src/aiida_quantumespresso/parsers/pp.py +++ b/src/aiida_quantumespresso/parsers/pp.py @@ -117,7 +117,7 @@ def get_key_from_filename(filename): matches = re.search(pattern, filename) return matches.group(1) - if self.node.base.attributes.get('parse_data_files', True): + if self.node.base.attributes.get('parse_data_files'): for filename in filenames: # Directly parse the retrieved files after reading them to memory (`data_raw`). The raw data # of each file is released from memory after parsing, to improve memory usage. diff --git a/tests/calculations/test_pp.py b/tests/calculations/test_pp.py index 1a70a36c5..2f86b206f 100644 --- a/tests/calculations/test_pp.py +++ b/tests/calculations/test_pp.py @@ -80,6 +80,26 @@ def test_pp_keep_data_files(fixture_sandbox, generate_calc_job, generate_inputs) assert element in calc_info.retrieve_list +def test_pp_parse_data_files(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.parse_data_files = False + + calc_info = generate_calc_job(fixture_sandbox, entry_point_name, inputs) + retrieve_list = ['aiida.out'] + retrieve_temporary_list = [] + local_copy_list = [] + + # When both `keep_data_files` (default) and `parse_data_files` are set to False, the data files won't be pulled. + assert isinstance(calc_info, datastructures.CalcInfo) + assert sorted(calc_info.local_copy_list) == sorted(local_copy_list) + assert sorted(calc_info.retrieve_temporary_list) == sorted(retrieve_temporary_list) + assert len(calc_info.retrieve_list) == 1 + for element in retrieve_list: + assert element in calc_info.retrieve_list + + def test_pp_cmdline_setting(fixture_sandbox, generate_calc_job, generate_inputs): """Test a `PpCalculation` with user-defined cmdline settings.""" entry_point_name = 'quantumespresso.pp' From e519337b395214b260870ba459b000147dbba3bd Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Wed, 20 Nov 2024 08:47:34 +0000 Subject: [PATCH 8/9] Add parser test. --- tests/parsers/test_pp.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/parsers/test_pp.py b/tests/parsers/test_pp.py index 38a08eaff..99742db03 100644 --- a/tests/parsers/test_pp.py +++ b/tests/parsers/test_pp.py @@ -320,6 +320,27 @@ def test_pp_default_3d_keep_data_files(generate_calc_job_node, generate_parser, assert len(results['output_data'].get_arraynames()) == 4 +def test_pp_default_3d_parse_data_files(generate_calc_job_node, generate_parser, generate_inputs_3d, tmpdir): + """Test a `pp.x` calculation where `parse_data_files=False`, so data files won't be parsed.""" + entry_point_calc_job = 'quantumespresso.pp' + entry_point_parser = 'quantumespresso.pp' + + attributes = {'parse_data_files': False} + node = generate_calc_job_node( + entry_point_calc_job, + test_name='default_3d', + inputs=generate_inputs_3d, + attributes=attributes, + ) + parser = generate_parser(entry_point_parser) + results, calcfunction = parser.parse_from_node(node, store_provenance=False, retrieved_temporary_folder=tmpdir) + + assert calcfunction.is_finished, calcfunction.exception + assert calcfunction.is_finished_ok, calcfunction.exit_message + assert 'output_parameters' in results + assert 'output_data' not in results + + def test_pp_default_3d_multiple(generate_calc_job_node, generate_parser, generate_inputs_3d): """Test a default `pp.x` calculation producing multiple files in 3D format.""" entry_point_calc_job = 'quantumespresso.pp' From a405a7c25ceb382a40908b744eeb96d5d9e998c0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Yakutovich Date: Wed, 20 Nov 2024 09:33:34 +0000 Subject: [PATCH 9/9] Fix more tests. --- tests/parsers/test_pp.py | 52 +++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/tests/parsers/test_pp.py b/tests/parsers/test_pp.py index 99742db03..44b5557c3 100644 --- a/tests/parsers/test_pp.py +++ b/tests/parsers/test_pp.py @@ -125,7 +125,11 @@ def test_pp_default_1d( 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) + attributes = {'keep_data_files': False, 'parse_data_files': True} + + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_1d', generate_inputs_1d, attributes=attributes + ) parser = generate_parser(entry_point_parser) results, calcfunction = parser.parse_from_node(node, store_provenance=False) @@ -157,9 +161,13 @@ def test_pp_default_1d_spherical( """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' - + attributes = {'keep_data_files': False, 'parse_data_files': True} node = generate_calc_job_node( - entry_point_calc_job, fixture_localhost, 'default_1d_spherical', generate_inputs_1d_spherical + entry_point_calc_job, + fixture_localhost, + 'default_1d_spherical', + generate_inputs_1d_spherical, + attributes=attributes ) parser = generate_parser(entry_point_parser) results, calcfunction = parser.parse_from_node(node, store_provenance=False) @@ -200,8 +208,11 @@ def test_pp_default_2d( """Test a default `pp.x` calculation producing a 2D data set.""" entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' + attributes = {'keep_data_files': False, 'parse_data_files': True} - node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_2d', generate_inputs_2d) + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_2d', generate_inputs_2d, attributes=attributes + ) parser = generate_parser(entry_point_parser) results, calcfunction = parser.parse_from_node(node, store_provenance=False) @@ -237,8 +248,11 @@ def test_pp_default_polar( """Test a default `pp.x` calculation producing a polar coordinates data set.""" entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' + attributes = {'keep_data_files': False, 'parse_data_files': True} - node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_polar', generate_inputs_polar) + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_polar', generate_inputs_polar, attributes=attributes + ) parser = generate_parser(entry_point_parser) results, calcfunction = parser.parse_from_node(node, store_provenance=False) @@ -267,8 +281,11 @@ def test_pp_default_3d( """Test a default `pp.x` calculation producing a 3D data set.""" entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' + attributes = {'keep_data_files': False, 'parse_data_files': True} - node = generate_calc_job_node(entry_point_calc_job, fixture_localhost, 'default_3d', generate_inputs_3d) + node = generate_calc_job_node( + entry_point_calc_job, fixture_localhost, 'default_3d', generate_inputs_3d, attributes=attributes + ) parser = generate_parser(entry_point_parser) results, calcfunction = parser.parse_from_node(node, store_provenance=False) @@ -302,7 +319,11 @@ def test_pp_default_3d_keep_data_files(generate_calc_job_node, generate_parser, entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' - attributes = {'options': {'keep_data_files': False}, 'retrieve_temporary_list': ['aiida.fileout']} + attributes = { + 'keep_data_files': False, + 'parse_data_files': True, + 'retrieve_temporary_list': ['aiida.fileout'], + } node = generate_calc_job_node( entry_point_calc_job, test_name='default_3d', @@ -325,7 +346,7 @@ def test_pp_default_3d_parse_data_files(generate_calc_job_node, generate_parser, entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' - attributes = {'parse_data_files': False} + attributes = {'keep_data_files': False, 'parse_data_files': False} node = generate_calc_job_node( entry_point_calc_job, test_name='default_3d', @@ -345,8 +366,11 @@ def test_pp_default_3d_multiple(generate_calc_job_node, generate_parser, generat """Test a default `pp.x` calculation producing multiple files in 3D format.""" entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' + attributes = {'keep_data_files': False, 'parse_data_files': True} - node = generate_calc_job_node(entry_point_calc_job, test_name='default_3d_multiple', inputs=generate_inputs_3d) + node = generate_calc_job_node( + entry_point_calc_job, test_name='default_3d_multiple', inputs=generate_inputs_3d, attributes=attributes + ) parser = generate_parser(entry_point_parser) results, calcfunction = parser.parse_from_node(node, store_provenance=False) @@ -385,9 +409,14 @@ def test_pp_default_3d_failed_missing_data( """Test a default `pp.x` calculation where the aiida.fileout file is missing.""" entry_point_calc_job = 'quantumespresso.pp' entry_point_parser = 'quantumespresso.pp' + attributes = {'keep_data_files': False, 'parse_data_files': True} node = generate_calc_job_node( - entry_point_calc_job, fixture_localhost, 'default_3d_failed_missing_data', generate_inputs_3d + entry_point_calc_job, + fixture_localhost, + 'default_3d_failed_missing_data', + generate_inputs_3d, + attributes=attributes ) parser = generate_parser(entry_point_parser) _, calcfunction = parser.parse_from_node(node, store_provenance=False) @@ -419,9 +448,10 @@ def test_pp_default_3d_failed_format(fixture_localhost, generate_calc_job_node, """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' + attributes = {'keep_data_files': False, 'parse_data_files': True} node = generate_calc_job_node( - entry_point_calc_job, fixture_localhost, 'default_3d_failed_format', generate_inputs_3d + entry_point_calc_job, fixture_localhost, 'default_3d_failed_format', generate_inputs_3d, attributes=attributes ) parser = generate_parser(entry_point_parser) _, calcfunction = parser.parse_from_node(node, store_provenance=False)