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

Give installation warning when no library potential found #1218

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyiron_atomistics/lammps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _get_potential_citations(potential):
@property
def potential(self):
"""
Execute view_potential() or list_potential() in order to see the pre-defined potential files
Execute view_potentials() or list_potentials() in order to see the pre-defined potential files

Returns:

Expand All @@ -217,7 +217,7 @@ def potential(self):
@potential.setter
def potential(self, potential_filename):
"""
Execute view_potential() or list_potential() in order to see the pre-defined potential files
Execute view_potentials() or list_potentials() in order to see the pre-defined potential files

Args:
potential_filename:
Expand Down
10 changes: 10 additions & 0 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
Loading