-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORM: Fix deprecation warning being shown for new code types (#6407)
The `InstalledCode` and `PortableCode` have been introduced already some time ago as the refactored version of the legacy `Code` class. The latter has been deprecated for that reason, but for backwards compatibility reasons, the new implementations still need to keep the legacy class as a base class. Unfortunately, this meant that the deprecation warning was also shown when users instantiated an instance of the new classes, which would be confusing. The deprecation warning had already been moved from module level to the constructor of the `Code` class to prevent it from showing merely upon import of the `aiida.orm` package. As a final work around, the new classes define the `_EMIT_CODE_DEPRECATION_WARNING` class attribute which is checked in the `Code` constructor such that when set, the deprecation warning is skipped.
- Loading branch information
Showing
3 changed files
with
13 additions
and
7 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
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