-
Notifications
You must be signed in to change notification settings - Fork 53
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
Freeze arguments to pick_calculator #2695
base: main
Are you sure you want to change the base?
Freeze arguments to pick_calculator #2695
Conversation
…uacc into mlp_calculator_freeze_args
@zulissimeta: Interesting. Thank you for the PR here. A question: what is the benefit in using d = {"cow": "moo", "cat": "meow"}
d_frozen = frozenset(d.items()) # frozen now!
d_unfrozen = dict(d_frozen) # same as d again! You would still need a decorator, but I haven't quite figured out yet the value-add for |
Ah, While not particularly elegant, I am okay with the proposed approach if there's no other option since |
Thanks, think it should be good to go now. |
Summary of Changes
lru_cache
is used to make sure that each MLP calculator is only instantiated once (great!). However, if you want to pass dictionaries through to the underlying calculator (say, config overrides to the fairchem calculator), you will get errors because dictionaries are mutable and lru_cache is unhappy. We can patch this by converting any dictionary kwargs to a frozendict.Requirements
main
).Note: If you are an external contributor, you will see a comment from @buildbot-princeton. This is solely for the maintainers.