Skip to content

Commit

Permalink
Merge pull request #30 from pyiron/master
Browse files Browse the repository at this point in the history
Update from master
  • Loading branch information
jan-janssen committed Jan 19, 2021
2 parents c71e865 + 33de9e5 commit aed0dbe
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .ci_support/environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
channels:
- conda-forge
dependencies:
- ase >=3.20.1
- ase >=3.21.0
- coveralls
- coverage
- codacy-coverage
Expand Down
17 changes: 0 additions & 17 deletions .github/CODEOWNERS

This file was deleted.

26 changes: 22 additions & 4 deletions pyiron_atomistics/atomistics/master/phonopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,28 @@ def modify_job(self, job, parameter):

class PhonopyJob(AtomisticParallelMaster):
"""
Phonopy wrapper for the calculation of free energy in the framework of quasi harmonic approximation.
Args:
project:
job_name:
Example:
>>> from pyiron_atomistics import Project
>>> pr = Project('my_project')
>>> lmp = pr.create_job('Lammps', 'lammps')
>>> lmp.structure = pr.create_structure('Fe', 'bcc', 2.832)
>>> phono = lmp.create_job('PhonopyJob', 'phonopy')
>>> phono.run()
Get output via `get_thermal_properties()`.
Note:
- This class does not consider the thermal expansion. For this, use `QuasiHarmonicJob` (find more in its
docstring)
- Depending on the value given in `job.input['interaction_range']`, this class automatically changes the number of
atoms. The input parameters of the reference job might have to be set appropriately (e.g. use `k_mesh_density`
for DFT instead of setting k-points directly).
- The structure used in the reference job should be a relaxed structure.
- Theory behind it: https://en.wikipedia.org/wiki/Quasi-harmonic_approximation
"""

def __init__(self, project, job_name):
Expand Down Expand Up @@ -318,7 +336,7 @@ def get_thermal_properties(self, t_min=1, t_max=1500, t_step=50, temperatures=No
Args:
t_min (float): minimum sample temperature
t_max (float): minimum sample temperature
t_max (float): maximum sample temperature
t_step (int): tempeature sample interval
temperatures (array_like, float): custom array of temperature samples, if given t_min, t_max, t_step are
ignored.
Expand Down
8 changes: 5 additions & 3 deletions pyiron_atomistics/lammps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ def potential(self, potential_filename):
self.input.potential.df = potential
if "Citations" in potential.columns.values:
pot_pub_dict = {}
for p in ast.literal_eval(potential["Citations"].values[0]):
for k in p.keys():
pot_pub_dict[k] = p[k]
pub_lst = potential["Citations"].values[0]
if isinstance(pub_lst, str):
for p in ast.literal_eval(pub_lst):
for k in p.keys():
pot_pub_dict[k] = p[k]
s.publication_add({"lammps_potential": pot_pub_dict})
for val in ["units", "atom_style", "dimension"]:
v = self.input.potential[val]
Expand Down
14 changes: 1 addition & 13 deletions pyiron_atomistics/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,6 @@ def create_object(object_type):
obj = ObjectType(object_type, project=None, job_name=None)
return obj

def copy(self):
"""
Copy the project object - copying just the Python object but maintaining the same pyiron path
Returns:
Project: copy of the project object
"""
new = Project(path=self.path, user=self.user, sql_query=self.sql_query)
new._filter = self._filter
new._inspect_mode = self._inspect_mode
return new

def load_from_jobpath(self, job_id=None, db_entry=None, convert_to_object=True):
"""
Internal function to load an existing job either based on the job ID or based on the database entry dictionary.
Expand All @@ -221,7 +209,7 @@ def load_from_jobpath(self, job_id=None, db_entry=None, convert_to_object=True):
job = super(Project, self).load_from_jobpath(
job_id=job_id, db_entry=db_entry, convert_to_object=convert_to_object
)
job.project_hdf5._project = Project(path=job.project_hdf5.file_path)
job.project_hdf5._project = self.__class__(path=job.project_hdf5.file_path)
return job

def load_from_jobpath_string(self, job_path, convert_to_object=True):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
keywords='pyiron',
packages=find_packages(exclude=["*tests*", "*docs*", "*binder*", "*conda*", "*notebooks*", "*.ci_support*"]),
install_requires=[
'ase>=3.20.1',
'ase>=3.21.0',
'defusedxml>=0.6.0',
'future>=0.18.2',
'h5py>=3.1.0',
Expand Down
8 changes: 4 additions & 4 deletions tests/atomistics/structure/test_atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,19 @@ def test_rotate_euler(self):
elements="AlFe", positions=[3 * [0], 3 * [1]], cell=2 * np.eye(3)
)
basis = unitcell.copy()
basis.rotate_euler(phi=0.1 * np.pi)
basis.euler_rotate(phi=0.1 * 180)
self.assertAlmostEqual(np.arccos(basis.positions[1, :2].sum() / 2) / np.pi, 0.1)
basis = unitcell.copy()
center_of_mass = basis.get_center_of_mass()
basis.rotate_euler(phi=0.1 * np.pi, center="com")
basis.euler_rotate(phi=0.1 * 180, center="com")
self.assertTrue(np.allclose(basis.get_center_of_mass(), center_of_mass))
basis = unitcell.copy()
center_of_positions = basis.positions.mean(axis=0)
basis.rotate_euler(phi=0.1 * np.pi, center="cop")
basis.euler_rotate(phi=0.1 * 180, center="cop")
self.assertTrue(np.allclose(center_of_positions, basis.positions.mean(axis=0)))
basis = unitcell.copy()
position = basis.positions[1]
basis.rotate_euler(phi=0.1 * np.pi, center="cou")
basis.euler_rotate(phi=0.1 * 180, center="cou")
self.assertTrue(np.allclose(position, basis.positions[1]))

def test_set_initial_magnetic_moments(self):
Expand Down

0 comments on commit aed0dbe

Please sign in to comment.