Skip to content
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

The hashcache function decorator is deprecated. Please use the class decorator instead. #37

Open
zion0210 opened this issue Jan 28, 2025 · 1 comment

Comments

@zion0210
Copy link

Hello, jkitchin!

I used pycse-2.3.3 to cache the result of the calculation.
I used this information as an example:
https://kitchingroup.cheme.cmu.edu/blog/2023/09/24/Adding-new-backends-to-hashcache/
but it did not work for me
Python gave the following error:

The hashcache function decorator is deprecated. Please use the class decorator instead.

Where can I get recent examples of using pycse.hashcache?

Best regards,
zion0210

@jkitchin
Copy link
Owner

I think you just use it like this.

from pycse.hashcache import HashCache

@HashCache
def f(x):
    return x

There is documentation at https://kitchingroup.cheme.cmu.edu/pycse/docs/pycse.html#module-pycse.hashcache, although I am not sure it is exactly what you are looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants