Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate ADDITIONAL_RETRIEVE_LIST in settings #1066

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

t-reents
Copy link
Contributor

@t-reents t-reents commented Feb 4, 2025

Fixes #939.

Deprecate the ADDITIONAL_RETRIEVE_LIST key in the settings input. Instead, one should use the CalcJob.metadata.options.additional_retrieve_list option to specify files that should be retrieved in addition to the default ones.

The `ADDITIONAL_RETRIEVE_LIST` key in the `settings` is deprected and
will be removed in a fetaure release. A warning is introduced,
indicating that one should use the
`CalcJob.metadata.options.additional_retrieve_list` option of
`aiida-core` instead (introduced in
aiidateam/aiida-core@17b7718).
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me, but just suggest to look into changing the warning class to ensure users see it

warnings.warn(
'The key `ADDITIONAL_RETRIEVE_LIST` in the settings input is deprecated and will be removed in '
'the future. Use the `CalcJob.metadata.options.additional_retrieve_list` input instead.',
FutureWarning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think these warnings are not shown by default in Python. This is why we use a separate class aiida.common.warnings.AiidaDeprecationWarning (https://github.com/aiidateam/aiida-core/blob/f43a51010b3c84b1e9526d167401fc9ac07c556a/src/aiida/common/warnings.py#L15)

I am not sure if we were already using this approach in plugins, but may be a nice way to ensure users see the warning (and that it can be turned off through verdi config warnings.showdeprecations False).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sphuber for the review and reminder! You are right, those wouldn't be shown. I'll adapt it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for context: I actually remember now why I used FutureWarning instead of DeprecationWarning, because DeprecationWarnings are silenced per default but FutureWarnings shouldn't be. Nonetheless, I think it makes sense to use the AiiDA specific subclass for the other reason outlined above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🗑 Deprecate ADDITIONAL_RETRIEVE_LIST setting in favor of option
2 participants