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

Does KLIFF support KIM simulator model? #201

Open
yonatank93 opened this issue Feb 18, 2025 · 1 comment
Open

Does KLIFF support KIM simulator model? #201

yonatank93 opened this issue Feb 18, 2025 · 1 comment

Comments

@yonatank93
Copy link
Contributor

Hi @mjwen

I was trying to use KLIFF to load some simulator model, like Sim_LAMMPS_AIREBO_Morse_OConnorAndzelmRobbins_2015_CH__SM_460187474631_000.
With a small number of cases I tried (like 10), KLIFF always throws an error when I execute kliff.model.KIMModel(simulator_model):

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File ~/modules/kliff/kliff/models/kim.py:450, in KIMModel._create_kim_model(model_name)
    449 try:
--> 450     units_accepted, model = kimpy.model.create(
    451         kimpy.numbering.zeroBased,
    452         kimpy.length_unit.A,
    453         kimpy.energy_unit.eV,
    454         kimpy.charge_unit.e,
    455         kimpy.temperature_unit.K,
    456         kimpy.time_unit.ps,
    457         model_name,
    458     )
    459 except RuntimeError:

RuntimeError: Unable to create a new KIM-API Model object!

During handling of the above exception, another exception occurred:

KimPyError                                Traceback (most recent call last)
Cell In[15], line 1
----> 1 model = KIMModel(potential)

File ~/modules/kliff/kliff/models/kim.py:399, in KIMModel.__init__(self, model_name, params_transform)
    396 if not kimpy_avail:
    397     report_import_error("kimpy", self.__class__.__name__)
--> 399 self.kim_model = self._create_kim_model(model_name)
    401 super(KIMModel, self).__init__(model_name, params_transform)

File ~/modules/kliff/kliff/models/kim.py:460, in KIMModel._create_kim_model(model_name)
    450     units_accepted, model = kimpy.model.create(
    451         kimpy.numbering.zeroBased,
    452         kimpy.length_unit.A,
   (...)
    457         model_name,
    458     )
    459 except RuntimeError:
--> 460     raise kimpy.KimPyError("Calling `kimpy.model.create()` failed.")
    462 if not units_accepted:
    463     KIMModelError("requested units not accepted in kimpy.model.create")

KimPyError:
ERROR(@_create_kim_model): Calling `kimpy.model.create()` failed.

I was wondering if this error is caused by something on my end or if it just happened that I picked simulator models that are incompatible, or if KLIFF doesn't support simulator model yet. I did make sure that I installed the model into kim-api prior to calling KIMModel.
Btw, I am using KIM-API 2.2.1, kimpy 2.1.0, and KLIFF 0.4.3.

@mjwen
Copy link
Collaborator

mjwen commented Feb 19, 2025 via email

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