-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hash_structure does not produce the same before & after ASE's write & read to XYZ #118
Comments
I think this is related to the error that appears in #120, which has changed the behaviour of The change I made for ruff was related to https://docs.astral.sh/ruff/rules/function-call-in-default-argument/, so currently we have the issue that something along the lines of from abcd.model import Hasher
hasher_1 = Hasher()
init_hash = hasher_1()
hasher_1.update(b"Test value")
assert hasher_1() != init_hash
hasher_2 = Hasher()
assert hasher_2() == init_hash fails, as This is fixed by the changes in #120, due to the change
The main other question is whether we actually want to separate hashers when we're saving data, or whether actually the current behaviour (the structure hash is updated with additional keys) is preferable, since otherwise the hash could be the same for two different structures. |
A few points to note, from talking to @alinelena, @oerc0122 and others:
|
One of the derived parameters is
hash_structure
, which collects structural information and hashes it for matching of structures. I've noticed that this does not product the same for a structure before and after passing through ASE's extxyz write & read.This seems to make this hash function somewhat useless, since we can reasonably expect use cases where structures are being read/written/calculated a lot of times.
As demonstration, see a failing test:
which fails with
The text was updated successfully, but these errors were encountered: