Skip to content

Commit

Permalink
issue warning when there is no potential available
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Nov 23, 2023
1 parent 30eaaa3 commit 53f5ed6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pyiron_atomistics/lammps/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,19 @@ def view_potentials(structure: Atoms) -> pd.DataFrame:
Returns:
pandas.Dataframe: Dataframe including all potential parameters.
"""
lpf = LammpsPotentialFile()
if len(lpf.list()) == 0:
state.logger.warning(
"It looks like your potential database is empty. In order to"
" install the standard pyiron library, run:\n\n"
"conda install -c conda-forge pyiron-data\n\n"
"Depending on the circumstances, you might have to change the"
" RESOURCE_PATHS of your .pyiron file. It is typically located in"
" your home directory. More can be found on the installation page"
" of the pyiron website."
)
list_of_elements = set(structure.get_chemical_symbols())
return LammpsPotentialFile().find(list_of_elements)
return lpf.find(list_of_elements)


def list_potentials(structure: Atoms) -> List[str]:
Expand Down

0 comments on commit 53f5ed6

Please sign in to comment.