Skip to content

Commit

Permalink
Only print retrieve_singlefile_list deprecation when necessary (#3081)
Browse files Browse the repository at this point in the history
While the functionality still exists, the engine will keep calling the `get_retrieve_singlefile_list` method and try to set them from the calculation info object, so the warnings were printed even when the user was not actually using it.
This makes sure that the relevant methods are only called, when the user explicitly sets the `retrieve_singlefile_list`.
  • Loading branch information
sphuber authored and CasperWA committed Jun 25, 2019
1 parent 7263d5a commit 5e59da4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion aiida/engine/processes/calcjobs/calcjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ def presubmit(self, folder):
raise PluginInternalError(
"[presubmission of calc {}] retrieve_singlefile_list subclass problem: {} is "
"not subclass of SinglefileData".format(self.node.pk, file_sub_class.__name__))
self.node.set_retrieve_singlefile_list(retrieve_singlefile_list)
if retrieve_singlefile_list:
self.node.set_retrieve_singlefile_list(retrieve_singlefile_list)

# Handle the retrieve_temporary_list
retrieve_temporary_list = (calcinfo.retrieve_temporary_list
Expand Down
1 change: 0 additions & 1 deletion aiida/orm/nodes/process/calculation/calcjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ def get_retrieve_singlefile_list(self):
Will be removed in `v2.0.0`, use
:meth:`aiida.orm.nodes.process.calculation.calcjob.CalcJobNode.get_retrieve_temporary_list` instead.
"""
warnings.warn('method is deprecated, use `get_retrieve_temporary_list` instead', AiidaDeprecationWarning) # pylint: disable=no-member
return self.get_attribute(self.RETRIEVE_SINGLE_FILE_LIST_KEY, None)

def set_job_id(self, job_id):
Expand Down

0 comments on commit 5e59da4

Please sign in to comment.