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

NewtonNet model settings do not always get correctly passed to _add_stdev_and_hess or _get_hessian #2209

Open
Andrew-S-Rosen opened this issue Jun 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Jun 5, 2024

Details about the quacc environment

  • quacc version: 0.9.1
  • Python version: 3.11

What is the issue?

In the NewtonNet recipes, the model path and settings paths for the NewtonNet model architecture are (by default) pulled from the global quacc settings. However, if the user passes model_path or settings_path as **calc_kwargs to the recipe, it will override the defaults.

calc_defaults = {
"model_path": SETTINGS.NEWTONNET_MODEL_PATH,
"settings_path": SETTINGS.NEWTONNET_CONFIG_PATH,
}
calc_flags = recursive_dict_merge(calc_defaults, calc_kwargs)

This is all perfectly fine, but if a user passes a custom model_path or settings_path, this is not used by _add_stdev_and_hess because that function is hard-coded to use only the global settings:

atoms.calc = NewtonNet(
model_path=SETTINGS.NEWTONNET_MODEL_PATH,
settings_path=SETTINGS.NEWTONNET_CONFIG_PATH,
)

This can cause a potential conflict. Note that the same is true for _get_hessian():

ml_calculator = NewtonNet(
model_path=SETTINGS.NEWTONNET_MODEL_PATH,
settings_path=SETTINGS.NEWTONNET_CONFIG_PATH,
)

Tagging @samblau and @kumaranu.

How can we easily reproduce the issue?

from quacc.recipes.newtonnet.core import relax_job
from ase.build import molecule

atoms = molecule("CH4")
model_path = "/my/custom/model/path" # not in settings
relax_job(atoms, model_path=model_path)
@Andrew-S-Rosen Andrew-S-Rosen added the bug Something isn't working label Jun 5, 2024
@Andrew-S-Rosen Andrew-S-Rosen changed the title NewtonNet model settings do not always get passed to _add_stdev_and_hess NewtonNet model settings do not always get correctly passed to _add_stdev_and_hess or _get_hessian Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant