Skip to content

Deprecate ADDITIONAL_RETRIEVE_LIST in settings #1066

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

Merged
merged 5 commits into from
Apr 1, 2025

Conversation

t-reents
Copy link
Collaborator

@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).
sphuber
sphuber previously approved these changes Feb 4, 2025
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
Collaborator 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
Collaborator 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.

@mbercx
Copy link
Member

mbercx commented Mar 26, 2025

@t-reents if you're ok with AiidaDeprecationWarning, I suppose we can adapt this and get the PR merged?

@t-reents
Copy link
Collaborator Author

Thanks for the ping @mbercx ! Yes, I am, just need to pick it up again. I'll do it later today and let you know once it's done.

@t-reents t-reents requested a review from mbercx March 26, 2025 10:21
@t-reents
Copy link
Collaborator Author

@mbercx Please have a final look

@mbercx mbercx merged commit 5d51932 into aiidateam:main Apr 1, 2025
7 checks passed
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
3 participants