From 41f6fc98c83066f6f389ac40d05df8b4b4ed7230 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Tue, 29 Oct 2024 09:52:54 +0100 Subject: [PATCH] `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