Skip to content

Commit

Permalink
renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Oct 10, 2024
1 parent ef05535 commit 14c098d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/aiida_quantumespresso/calculations/pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/aiida_quantumespresso/parsers/pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tests/calculations/test_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 3 additions & 3 deletions tests/parsers/test_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 14c098d

Please sign in to comment.