-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORM: Move deprecation warnings from module level
The `aiida.orm.nodes.data.code.legacy` and `aiida.orm.nodes.data.upf` modules contained deprecation warnings on the module level. Since these were exposed directly on the `aiida.orm` level, these deprecations would always show. This would even be the case if `warnings.showdeprecations` would be disabled, because that acts on the profile by default, which is not yet loaded at import time. Disabling the warnings globally would work but this would not be intuitive for users. The original reason for putting the warning on the module level is that third-party code could rely on the module merely by importing the classes without actually constructing it. This would make it possible for some plugins to completely miss the deprecation warning. At this point we decide to accept this risk in favor of reducing the noise for the majority of users as these warnings are printed as soon as anything from AiiDA is imported.
- Loading branch information
Showing
2 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters