Skip to content

Commit

Permalink
Merge pull request #1300 from pyiron/dependabot/pip/spglib-2.3.0
Browse files Browse the repository at this point in the history
Bump spglib from 2.2.0 to 2.3.0
  • Loading branch information
jan-janssen authored Jan 30, 2024
2 parents 8078bb4 + c384ec0 commit 2b68707
Show file tree
Hide file tree
Showing 17 changed files with 151 additions and 161 deletions.
4 changes: 2 additions & 2 deletions .ci_support/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
dependencies:
- aimsgb =1.1.0
- ase =3.22.1
- atomistics =0.1.21
- atomistics =0.1.22
- coverage
- codacy-coverage
- defusedxml =0.7.1
Expand All @@ -21,5 +21,5 @@ dependencies:
- scikit-learn =1.4.0
- scipy =1.12.0
- seekpath =2.1.0
- spglib =2.2.0
- spglib =2.3.0
- structuretoolkit =0.0.18
12 changes: 6 additions & 6 deletions pyiron_atomistics/atomistics/job/atomistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ def calc_md(
self._generic_input["temperature"] = temperature
self._generic_input["n_ionic_steps"] = n_ionic_steps
self._generic_input["n_print"] = n_print
self._generic_input[
"temperature_damping_timescale"
] = temperature_damping_timescale
self._generic_input["temperature_damping_timescale"] = (
temperature_damping_timescale
)
if pressure is not None:
self._generic_input["pressure"] = pressure
if pressure_damping_timescale is not None:
self._generic_input[
"pressure_damping_timescale"
] = pressure_damping_timescale
self._generic_input["pressure_damping_timescale"] = (
pressure_damping_timescale
)
if time_step is not None:
self._generic_input["time_step"] = time_step
self._generic_input.remove_keys(["max_iter"])
Expand Down
6 changes: 3 additions & 3 deletions pyiron_atomistics/atomistics/master/phonopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ def collect_output(self):
hdf5_out["qpoints"] = mesh_dict["qpoints"]
hdf5_out["supercell_matrix"] = self._phonopy_supercell_matrix()
hdf5_out["displacement_dataset"] = self.phonopy.get_displacement_dataset()
hdf5_out[
"dynamical_matrix"
] = self.phonopy.dynamical_matrix.get_dynamical_matrix()
hdf5_out["dynamical_matrix"] = (
self.phonopy.dynamical_matrix.get_dynamical_matrix()
)
hdf5_out["force_constants"] = self.phonopy.force_constants

def write_phonopy_force_constants(self, file_name="FORCE_CONSTANTS", cwd=None):
Expand Down
27 changes: 14 additions & 13 deletions pyiron_atomistics/atomistics/structure/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2444,15 +2444,17 @@ def get_initial_magnetic_moments(self):
):
return np.array(
[
[
float(spin_dir)
for spin_dir in spin.replace("[", "")
.replace("]", "")
.replace(",", "")
.split()
]
if spin
else [0.0, 0.0, 0.0]
(
[
float(spin_dir)
for spin_dir in spin.replace("[", "")
.replace("]", "")
.replace(",", "")
.split()
]
if spin
else [0.0, 0.0, 0.0]
)
for spin in spin_lst
]
)
Expand Down Expand Up @@ -3131,9 +3133,9 @@ def ase_to_pyiron(ase_obj):
elif constraint_dict["name"] == "FixScaled":
if "selective_dynamics" not in pyiron_atoms.arrays.keys():
pyiron_atoms.add_tag(selective_dynamics=[True, True, True])
pyiron_atoms.selective_dynamics[
constraint_dict["kwargs"]["a"]
] = constraint_dict["kwargs"]["mask"]
pyiron_atoms.selective_dynamics[constraint_dict["kwargs"]["a"]] = (
constraint_dict["kwargs"]["mask"]
)
else:
warnings.warn("Unsupported ASE constraint: " + constraint_dict["name"])
return pyiron_atoms
Expand Down Expand Up @@ -3402,7 +3404,6 @@ def default(data, dflt):


class Symbols(ASESymbols):

"""
Derived from the ase symbols class which has the following docs:
Expand Down
1 change: 0 additions & 1 deletion pyiron_atomistics/dft/bader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class Bader:

"""
Module to apply the Bader charge partitioning scheme to finished DFT jobs. This module is interfaced with the
`Bader code`_ from the Greame Henkelmann group.
Expand Down
1 change: 0 additions & 1 deletion pyiron_atomistics/dft/waves/dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class Dos(object):

"""
The DOS class stores all information to store and retrieve the total and resolved density of states from an
electronic structure calculation.
Expand Down
13 changes: 6 additions & 7 deletions pyiron_atomistics/dft/waves/electronic.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ def grand_dos_matrix(self):
for spin in range(self.n_spins):
for i, kpt in enumerate(self.kpoints):
for j, band in enumerate(kpt.bands):
self._grand_dos_matrix[
spin, i, j, :, :
] = band.resolved_dos_matrix
self._grand_dos_matrix[spin, i, j, :, :] = (
band.resolved_dos_matrix
)
return self._grand_dos_matrix

@grand_dos_matrix.setter
Expand Down Expand Up @@ -624,9 +624,9 @@ def generate_from_matrices(self):
occ = self.occupancy_matrix[spin][i][j]
self.kpoints[-1].add_band(eigenvalue=val, occupancy=occ, spin=spin)
if self._grand_dos_matrix is not None:
self.kpoints[-1].bands[spin][
-1
].resolved_dos_matrix = self.grand_dos_matrix[spin, i, j, :, :]
self.kpoints[-1].bands[spin][-1].resolved_dos_matrix = (
self.grand_dos_matrix[spin, i, j, :, :]
)

def get_spin_resolved_dos(self, spin_indices=0):
"""
Expand Down Expand Up @@ -751,7 +751,6 @@ def __repr__(self):


class Kpoint(object):

"""
All data related to a single k-point is stored in this module
Expand Down
4 changes: 1 addition & 3 deletions pyiron_atomistics/interactive/quasi_newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ def inv_hessian(self):
return np.einsum(
"ik,k,jk->ij",
self.eigenvectors,
self.eigenvalues
/ (self.eigenvalues**2 + np.exp(self.regularization)),
self.eigenvalues / (self.eigenvalues**2 + np.exp(self.regularization)),
self.eigenvectors,
)
else:
Expand Down Expand Up @@ -277,7 +276,6 @@ def run_qn(


class QuasiNewton(InteractiveWrapper):

"""
Structure optimization scheme via Quasi-Newton algorithm.
Expand Down
90 changes: 45 additions & 45 deletions pyiron_atomistics/lammps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ def enable_h5md(self):
"""
del self.input.control["dump_modify___1"]
del self.input.control["dump___1"]
self.input.control[
"dump___1"
] = "all h5md ${dumptime} dump.h5 position force create_group yes"
self.input.control["dump___1"] = (
"all h5md ${dumptime} dump.h5 position force create_group yes"
)

def write_input(self):
"""
Expand Down Expand Up @@ -897,79 +897,79 @@ def _set_selective_dynamics(self):
self.input.control["group___constraintxyz"] = "id " + " ".join(
[str(ind) for ind in constraint_xyz]
)
self.input.control[
"fix___constraintxyz"
] = "constraintxyz setforce 0.0 0.0 0.0"
self.input.control["fix___constraintxyz"] = (
"constraintxyz setforce 0.0 0.0 0.0"
)
if self._generic_input["calc_mode"] == "md":
self.input.control[
"velocity___constraintxyz"
] = "set 0.0 0.0 0.0"
self.input.control["velocity___constraintxyz"] = (
"set 0.0 0.0 0.0"
)
if len(constraint_xy) > 0:
self.input.control["group___constraintxy"] = "id " + " ".join(
[str(ind) for ind in constraint_xy]
)
self.input.control[
"fix___constraintxy"
] = "constraintxy setforce 0.0 0.0 NULL"
self.input.control["fix___constraintxy"] = (
"constraintxy setforce 0.0 0.0 NULL"
)
if self._generic_input["calc_mode"] == "md":
self.input.control[
"velocity___constraintxy"
] = "set 0.0 0.0 NULL"
self.input.control["velocity___constraintxy"] = (
"set 0.0 0.0 NULL"
)
if len(constraint_yz) > 0:
self.input.control["group___constraintyz"] = "id " + " ".join(
[str(ind) for ind in constraint_yz]
)
self.input.control[
"fix___constraintyz"
] = "constraintyz setforce NULL 0.0 0.0"
self.input.control["fix___constraintyz"] = (
"constraintyz setforce NULL 0.0 0.0"
)
if self._generic_input["calc_mode"] == "md":
self.input.control[
"velocity___constraintyz"
] = "set NULL 0.0 0.0"
self.input.control["velocity___constraintyz"] = (
"set NULL 0.0 0.0"
)
if len(constraint_zx) > 0:
self.input.control["group___constraintxz"] = "id " + " ".join(
[str(ind) for ind in constraint_zx]
)
self.input.control[
"fix___constraintxz"
] = "constraintxz setforce 0.0 NULL 0.0"
self.input.control["fix___constraintxz"] = (
"constraintxz setforce 0.0 NULL 0.0"
)
if self._generic_input["calc_mode"] == "md":
self.input.control[
"velocity___constraintxz"
] = "set 0.0 NULL 0.0"
self.input.control["velocity___constraintxz"] = (
"set 0.0 NULL 0.0"
)
if len(constraint_x) > 0:
self.input.control["group___constraintx"] = "id " + " ".join(
[str(ind) for ind in constraint_x]
)
self.input.control[
"fix___constraintx"
] = "constraintx setforce 0.0 NULL NULL"
self.input.control["fix___constraintx"] = (
"constraintx setforce 0.0 NULL NULL"
)
if self._generic_input["calc_mode"] == "md":
self.input.control[
"velocity___constraintx"
] = "set 0.0 NULL NULL"
self.input.control["velocity___constraintx"] = (
"set 0.0 NULL NULL"
)
if len(constraint_y) > 0:
self.input.control["group___constrainty"] = "id " + " ".join(
[str(ind) for ind in constraint_y]
)
self.input.control[
"fix___constrainty"
] = "constrainty setforce NULL 0.0 NULL"
self.input.control["fix___constrainty"] = (
"constrainty setforce NULL 0.0 NULL"
)
if self._generic_input["calc_mode"] == "md":
self.input.control[
"velocity___constrainty"
] = "set NULL 0.0 NULL"
self.input.control["velocity___constrainty"] = (
"set NULL 0.0 NULL"
)
if len(constraint_z) > 0:
self.input.control["group___constraintz"] = "id " + " ".join(
[str(ind) for ind in constraint_z]
)
self.input.control[
"fix___constraintz"
] = "constraintz setforce NULL NULL 0.0"
self.input.control["fix___constraintz"] = (
"constraintz setforce NULL NULL 0.0"
)
if self._generic_input["calc_mode"] == "md":
self.input.control[
"velocity___constraintz"
] = "set NULL NULL 0.0"
self.input.control["velocity___constraintz"] = (
"set NULL NULL 0.0"
)

@staticmethod
def _modify_structure_to_allow_requested_deformation(
Expand Down
6 changes: 3 additions & 3 deletions pyiron_atomistics/lammps/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,9 @@ def _fix_with_three_vector(self, ids, vector, fix_string, conversion):
vector[i] = str(v * conversion)
name = str(hash(tuple(ids))).replace("-", "m") # A unique name for the group
self._set_group_by_id(name, ids)
self[
"fix___{}_{}".format(fix_string.replace(" ", "_"), name)
] = "{} {} {}".format(name, fix_string, " ".join(vector))
self["fix___{}_{}".format(fix_string.replace(" ", "_"), name)] = (
"{} {} {}".format(name, fix_string, " ".join(vector))
)

def fix_move_linear_by_id(self, ids, velocity):
"""
Expand Down
6 changes: 3 additions & 3 deletions pyiron_atomistics/lammps/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ def function(ptr, timestep, nlocal, ids, x, fexternal):
if not self.server.run_mode.interactive:
raise AssertionError("Callback works only in interactive mode")
self._user_fix_external = _FixExternal(function)
self.input.control[
"fix___fix_external"
] = "all external pf/callback {} {}".format(n_call, n_apply)
self.input.control["fix___fix_external"] = (
"all external pf/callback {} {}".format(n_call, n_apply)
)
if overload_internal_fix_external:
self._user_fix_external.fix_external = function

Expand Down
1 change: 0 additions & 1 deletion pyiron_atomistics/lammps/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


class LammpsPotential(GenericParameters):

"""
This module helps write commands which help in the control of parameters related to the potential used in LAMMPS
simulations
Expand Down
16 changes: 3 additions & 13 deletions pyiron_atomistics/testing/randomatomistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,7 @@ def _s_r(self):
return self.input["sigma"] / self.neigh.flattened.distances

def interactive_energy_pot_getter(self):
return self.input["epsilon"] * (
np.sum(self._s_r**12) - np.sum(self._s_r**6)
)
return self.input["epsilon"] * (np.sum(self._s_r**12) - np.sum(self._s_r**6))

def interactive_energy_tot_getter(self):
return (
Expand All @@ -479,13 +477,7 @@ def interactive_energy_tot_getter(self):
def interadtive_energy_kin_getter(self):
v = np.einsum("ni,n->", self._velocity**2, self.structure.get_masses()) / 2
return (
(
v
* self._unit.angstrom**2
/ self._unit.second**2
/ 1e-30
* self._unit.amu
)
(v * self._unit.angstrom**2 / self._unit.second**2 / 1e-30 * self._unit.amu)
.to("eV")
.magnitude
)
Expand Down Expand Up @@ -529,9 +521,7 @@ def interactive_pressures_getter(self):
* self._unit.amu
)
return (
(pot_part + kin_part)
/ self.structure.get_volume()
/ self._unit.angstrom**3
(pot_part + kin_part) / self.structure.get_volume() / self._unit.angstrom**3
).to(self._unit.pascal).magnitude / 1e9

def interactive_stress_getter(self):
Expand Down
Loading

0 comments on commit 2b68707

Please sign in to comment.