diff --git a/atomistics/calculators/lammps/potential.py b/atomistics/calculators/lammps/potential.py index 464b2d06..7eade312 100644 --- a/atomistics/calculators/lammps/potential.py +++ b/atomistics/calculators/lammps/potential.py @@ -5,6 +5,34 @@ import pandas from ase.atoms import Atoms +potential_installation = """ +Potential installation guide: + +1. Check whether iprpy-data is installed. If not, install it using: + +`conda install -c conda-forge iprpy-data` + +2. Check whether the resource path is set via: + +```python +import os +print(os.environ["CONDA_PREFIX"]) +``` + +3. If the resource path is set, you can call the potential using: + +```python +from atomistics.calculators import get_potential_by_name + + +get_potential_by_name( + potential_name=my_potential, + resource_path=os.path.join(os.environ["CONDA_PREFIX"], "share", "iprpy"), +) +``` + +""" + class PotentialAbstract(object): """ @@ -124,7 +152,9 @@ def _get_potential_df(file_name_lst, resource_path): ), }, ) - raise ValueError("Was not able to locate the potential files.") + raise ValueError( + "Was not able to locate the potential files." + potential_installation + ) class LammpsPotentialFile(PotentialAbstract): @@ -310,7 +340,7 @@ def get_resource_path_from_conda( resource_path = os.path.join(env[conda_var], "share", "iprpy") if os.path.exists(resource_path): return resource_path - raise ValueError("No resource_path found") + raise ValueError("No resource_path found" + potential_installation) def get_potential_dataframe(structure: Atoms, resource_path=None):