From 647194beff324019c9e3f3fcccee022dc9a0b6b4 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Tue, 29 Oct 2024 09:05:48 +0100 Subject: [PATCH 1/2] Fix broken import of `aiida.manage.configuration.Config` A recent release of `aiida-core` removed the import of `Config` directly from the module `aiida.manage.configuration` causing the tests to fail. It should now be imported from `aiida.manage.configuration.config.Config`. --- tests/cli/test_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cli/test_install.py b/tests/cli/test_install.py index 69f659a..9361362 100644 --- a/tests/cli/test_install.py +++ b/tests/cli/test_install.py @@ -4,7 +4,7 @@ import pathlib import pytest -from aiida.manage.configuration import Config +from aiida.manage.configuration.config import Config from aiida.orm import QueryBuilder from aiida_pseudo.cli import cmd_install_family, cmd_install_pseudo_dojo, cmd_install_sssp, install from aiida_pseudo.data.pseudo.upf import UpfData From bcc0129cc0b1b6fa5ddfe7d91f09d805ceb40d15 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Tue, 29 Oct 2024 09:52:54 +0100 Subject: [PATCH 2/2] `PseudoPotentialData`: Adapt to caching changes in `aiida-core==2.6` In `aiida-core` v2.6.0, the caching API was changed. See this commit e330004024ad5121f9bc82cbe972cd283f25fec8 . The method `NodeCaching._get_objects_to_hash` was renamed to `get_objects_to_hash`. To compute the hash, `compute_hash` should now be called instead of the `get_hash`, which simply fetches the value stored in the extras. --- src/aiida_pseudo/data/pseudo/pseudo.py | 2 +- tests/data/pseudo/test_pseudo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aiida_pseudo/data/pseudo/pseudo.py b/src/aiida_pseudo/data/pseudo/pseudo.py index 4c37f0d..6712fb6 100644 --- a/src/aiida_pseudo/data/pseudo/pseudo.py +++ b/src/aiida_pseudo/data/pseudo/pseudo.py @@ -17,7 +17,7 @@ class PseudoPotentialDataCaching(NodeCaching): """Class to define caching behavior of ``PseudoPotentialData`` nodes.""" - def _get_objects_to_hash(self) -> list: + def get_objects_to_hash(self) -> list: """Return a list of objects which should be included in the node hash.""" return [self._node.element, self._node.md5] diff --git a/tests/data/pseudo/test_pseudo.py b/tests/data/pseudo/test_pseudo.py index e003769..8d82254 100644 --- a/tests/data/pseudo/test_pseudo.py +++ b/tests/data/pseudo/test_pseudo.py @@ -233,4 +233,4 @@ def test_hash(stream, filename, element, are_equal): right.element = element right.store() - assert (left.base.caching.get_hash() == right.base.caching.get_hash()) is are_equal + assert (left.base.caching.compute_hash() == right.base.caching.compute_hash()) is are_equal