-
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.
Update use of various deprecated APIs (#4719)
This replaces the use of various deprecated APIs pointed out by warnings thrown during runs of the test suite. It also introduces one new feature and a bug fix. Features: * Add non-zero exit code for failure to most `verdi daemon` commands, so tests will catch possible errors. Bug fixes: * A couple of files were opened but not closed Updates of deprecated APIs: * np.int is deprecated alias of int * np.float is deprecated alias of float * put_object_from_filelike: force is deprecated * archive import/export: `silent` keyword is deprecated in favor of logger * computer name => label * Fix tests writing to the repository of nodes after they had been stored by replacing all times we use `.open` with `'w'` or `'wb'` mode with a correct call to `put_object_from_filelike` *before* the node is stored. In one case, the data comes from a small archive file. In this case, I recreated the (zipped) .aiida file adding two additional (binary) files obtained by gzipping a short string. This was used to ensure that `inputcat` and `outputcat` work also when binary data was requested. Actually, this is better than before, where the actual input or output of the calculation were overwritten and then replaced back. * communicator: replace deprecated stop() by close() * silence some deprecation warnings in tests of APIs that will be removed in 2.0 Note that while unmuting the `ResourceWarning` was good to spot some issues (bug fix above), the warning is raised in a couple more places where it's less obvious to fix (typically related to the daemon starting some process in the background - or being started itself - and not being stopped before the test actually finished). I think this is an acceptable compromise - maybe we'll figure out how to selectively silence those, and keeping warnings visible will help us figure out possible leaks in the future. Co-authored-by: Giovanni Pizzi <giovanni.pizzi@epfl.ch>
- Loading branch information
1 parent
e99227b
commit 6b6481d
Showing
42 changed files
with
477 additions
and
363 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
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
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
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
Oops, something went wrong.