Skip to content

Commit 33d34a8

Browse files
committed
Fix ComplexWarning when assigning complex structure coords to real array in minimization step
The Minimizer stores both dyn matrix and structure coords in a single complex128 state vector. When retrieved via get_dyn_struct(), the structure returned is complex128 dtype (even with zero imag parts). Assigning it to the real-valued coords array triggers numpy's ComplexWarning in numpy >= 2.0. Bump version to 1.6.1.
1 parent ae48d6e commit 33d34a8

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/SchaMinimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def minimization_step(self, custom_function_gradient = None, timer=None):
634634

635635
# Update the structure
636636
if self.minim_struct:
637-
self.dyn.structure.coords[:,:] = new_struct
637+
self.dyn.structure.coords[:,:] = np.real(new_struct)
638638

639639
# Check if we must enforce the symmetries and the sum rule:
640640
if self.enforce_sum_rule and (not self.neglect_symmetries):

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('python-sscha',
22
['c','fortran'],
3-
version : '1.6.0',
3+
version : '1.6.1',
44
license: 'GPL',
55
meson_version: '>= 1.1.0', # <- set min version of meson.
66
default_options : [

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "mesonpy"
44

55
[project]
66
name = "python-sscha"
7-
version = "1.6.0"
7+
version = "1.6.1"
88
description = "Python implementation of the sscha code"
99
authors = [{name = "Lorenzo Monacelli"}] # Put here email
1010
readme = "README.md"

0 commit comments

Comments
 (0)