From 30eaaa348ed56d6f689ac069e1e6110e55892511 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Thu, 23 Nov 2023 09:55:46 +0000 Subject: [PATCH 1/3] fix typo --- pyiron_atomistics/lammps/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyiron_atomistics/lammps/base.py b/pyiron_atomistics/lammps/base.py index 9b3738eaa..1e5a23282 100644 --- a/pyiron_atomistics/lammps/base.py +++ b/pyiron_atomistics/lammps/base.py @@ -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: @@ -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: From 53f5ed6ad49cd25b7f5a2c8efec6d5abb255411f Mon Sep 17 00:00:00 2001 From: samwaseda Date: Thu, 23 Nov 2023 10:06:56 +0000 Subject: [PATCH 2/3] issue warning when there is no potential available --- pyiron_atomistics/lammps/potential.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pyiron_atomistics/lammps/potential.py b/pyiron_atomistics/lammps/potential.py index 01b55856b..a2608a9bc 100644 --- a/pyiron_atomistics/lammps/potential.py +++ b/pyiron_atomistics/lammps/potential.py @@ -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]: From 55557571b72efdcb995bcb653b34989caa3c926d Mon Sep 17 00:00:00 2001 From: samwaseda Date: Thu, 23 Nov 2023 10:11:14 +0000 Subject: [PATCH 3/3] change location of warning --- pyiron_atomistics/lammps/potential.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pyiron_atomistics/lammps/potential.py b/pyiron_atomistics/lammps/potential.py index a2608a9bc..73f956e82 100644 --- a/pyiron_atomistics/lammps/potential.py +++ b/pyiron_atomistics/lammps/potential.py @@ -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: @@ -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]: