Skip to content

Commit

Permalink
Keep keep_plot_file option for the backward compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Nov 19, 2024
1 parent 5a80c57 commit 103a8ec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/aiida_quantumespresso/calculations/pp.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 103a8ec

Please sign in to comment.