Skip to content

Commit

Permalink
change location of warning
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Nov 23, 2023
1 parent 53f5ed6 commit 5555757
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions pyiron_atomistics/lammps/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ def __init__(self, potential_df=None, default_df=None, selected_atoms=None):
default_df=default_df,
selected_atoms=selected_atoms,
)
if len(self.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."
)

def default(self):
if self._default_df is not None:
Expand Down Expand Up @@ -318,19 +328,8 @@ 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 lpf.find(list_of_elements)
return LammpsPotentialFile().find(list_of_elements)


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

0 comments on commit 5555757

Please sign in to comment.