Skip to content

Commit

Permalink
PseudoPotentialData: Adapt to caching changes in aiida-core==2.6
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sphuber committed Oct 29, 2024
1 parent c19ccd0 commit 41f6fc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/aiida_pseudo/data/pseudo/pseudo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion tests/data/pseudo/test_pseudo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 41f6fc9

Please sign in to comment.