SHA256
1
0
forked from pool/python-ase

2 Commits

Author SHA256 Message Date
ffb3dc3422 Accepting request 1301637 from devel:languages:python:numeric
- Update to 3.26.0:
  * Requirements
    + The minimum supported Python version has increased to 3.9
  * Breaking changes
    + Removed unused IOFormat.open() method.
    + The Optimizable interface now works in terms of arbitrary degrees of
      freedom rather than Cartesian (Nx3) ones.
    + ase.io.orca.read_orca_output now returns Atoms with attached
      properties. ase.io.read() will use this function.
    + The master parameter to each Optimizer is now passed via **kwargs and
      so becomes keyword-only.
    + Removed legacy read_cell and write_cell functions from ase.io.castep.
    + Removed deprecated force_consistent option from Optimizer.
    + ase.spectrum.band_structure.BandStructurePlot: the plot_with_colors()
      has been removed and its features merged into the plot() method.
  * Highlights
   + Changed ELK based on GenericFileIOCalculator.
   + The “heavy-weight” database backends in ase.db have been moved to a
     separate project.
   + Major improvements to find_optimal_cell_shape(): improve target metric;
     ensure rotationally invariant results; avoid negative determinants;
     improved performance via vectorisation.
   + Added new FiniteDifferenceCalculator, which wraps other calculator for
     finite-difference forces and strains.
   + Added two new MD thermostats: ase.md.bussi.Bussi and
     ase.md.nose_hoover_chain.NoseHooverChainNVT.
- Drop patch ase-mr3400-numpy2.patch, included upstream.

OBS-URL: https://build.opensuse.org/request/show/1301637
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ase?expand=0&rev=6
2025-08-28 15:18:49 +00:00
34db0b515a - Update to 3.26.0:
* Requirements
    + The minimum supported Python version has increased to 3.9
  * Breaking changes
    + Removed unused IOFormat.open() method.
    + The Optimizable interface now works in terms of arbitrary degrees of
      freedom rather than Cartesian (Nx3) ones.
    + ase.io.orca.read_orca_output now returns Atoms with attached
      properties. ase.io.read() will use this function.
    + The master parameter to each Optimizer is now passed via **kwargs and
      so becomes keyword-only.
    + Removed legacy read_cell and write_cell functions from ase.io.castep.
    + Removed deprecated force_consistent option from Optimizer.
    + ase.spectrum.band_structure.BandStructurePlot: the plot_with_colors()
      has been removed and its features merged into the plot() method.
  * Highlights
   + Changed ELK based on GenericFileIOCalculator.
   + The “heavy-weight” database backends in ase.db have been moved to a
     separate project.
   + Major improvements to find_optimal_cell_shape(): improve target metric;
     ensure rotationally invariant results; avoid negative determinants;
     improved performance via vectorisation.
   + Added new FiniteDifferenceCalculator, which wraps other calculator for
     finite-difference forces and strains.
   + Added two new MD thermostats: ase.md.bussi.Bussi and
     ase.md.nose_hoover_chain.NoseHooverChainNVT.
- Drop patch ase-mr3400-numpy2.patch, included upstream.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-ase?expand=0&rev=11
2025-08-28 04:33:55 +00:00
5 changed files with 45 additions and 238 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:91a2aa31d89bd90b0efdfe4a7e84264f32828b2abfc9f38e65e041ad76fec8ae
size 2336462

3
ase-3.26.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a071a355775b0a8062d23e9266e9d811b19d9f6d9ec5215e8032f7d93dc65075
size 2405567

View File

@@ -1,222 +0,0 @@
From 06c59143e7fdf15483491cf71800afba8b862bda Mon Sep 17 00:00:00 2001
From: yuzie007 <yuji.ikeda.ac.jp@gmail.com>
Date: Thu, 20 Jun 2024 17:44:31 +0200
Subject: [PATCH 1/7] Use `np.exceptions.ComplexWarning`
---
ase/test/vibrations/test_vib.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: ase-3.23.0/ase/test/vibrations/test_vib.py
===================================================================
--- ase-3.23.0.orig/ase/test/vibrations/test_vib.py
+++ ase-3.23.0/ase/test/vibrations/test_vib.py
@@ -6,6 +6,10 @@ import numpy as np
import pytest
from numpy.testing import (assert_array_almost_equal,
assert_array_equal)
+try:
+ from numpy.exceptions import ComplexWarning # NumPy 2.0.0
+except ImportError:
+ from numpy import ComplexWarning
import ase.io
from ase import Atoms, units
@@ -438,14 +442,14 @@ def test_constrained_atoms(n2_data):
def test_dos(n2_vibdata):
- with pytest.warns(np.ComplexWarning):
+ with pytest.warns(ComplexWarning):
dos = n2_vibdata.get_dos()
assert_array_almost_equal(dos.get_energies(),
n2_vibdata.get_energies())
def test_pdos(n2_vibdata):
- with pytest.warns(np.ComplexWarning):
+ with pytest.warns(ComplexWarning):
pdos = n2_vibdata.get_pdos()
assert_array_almost_equal(pdos[0].get_energies(),
n2_vibdata.get_energies())
Index: ase-3.23.0/ase/constraints.py
===================================================================
--- ase-3.23.0.orig/ase/constraints.py
+++ ase-3.23.0/ase/constraints.py
@@ -1161,19 +1161,19 @@ class FixInternals(FixConstraint):
# Projection
hh = []
for i, constraint in enumerate(self.constraints):
- hh.append(aa[:, i] * np.row_stack(aa[:, i]))
+ hh.append(aa[:, i] * np.vstack(aa[:, i]))
- txx = aa[:, self.n] * np.row_stack(aa[:, self.n])
- tyy = aa[:, self.n + 1] * np.row_stack(aa[:, self.n + 1])
- tzz = aa[:, self.n + 2] * np.row_stack(aa[:, self.n + 2])
- rxx = aa[:, self.n + 3] * np.row_stack(aa[:, self.n + 3])
- ryy = aa[:, self.n + 4] * np.row_stack(aa[:, self.n + 4])
- rzz = aa[:, self.n + 5] * np.row_stack(aa[:, self.n + 5])
+ txx = aa[:, self.n] * np.vstack(aa[:, self.n])
+ tyy = aa[:, self.n + 1] * np.vstack(aa[:, self.n + 1])
+ tzz = aa[:, self.n + 2] * np.vstack(aa[:, self.n + 2])
+ rxx = aa[:, self.n + 3] * np.vstack(aa[:, self.n + 3])
+ ryy = aa[:, self.n + 4] * np.vstack(aa[:, self.n + 4])
+ rzz = aa[:, self.n + 5] * np.vstack(aa[:, self.n + 5])
T = txx + tyy + tzz + rxx + ryy + rzz
for vec in hh:
T += vec
- ff = np.dot(T, np.row_stack(ff))
- forces[:, :] -= np.dot(T, np.row_stack(ff)).reshape(-1, 3)
+ ff = np.dot(T, np.vstack(ff))
+ forces[:, :] -= np.dot(T, np.vstack(ff)).reshape(-1, 3)
def __repr__(self):
constraints = [repr(constr) for constr in self.constraints]
Index: ase-3.23.0/ase/mep/autoneb.py
===================================================================
--- ase-3.23.0.orig/ase/mep/autoneb.py
+++ ase-3.23.0/ase/mep/autoneb.py
@@ -544,7 +544,7 @@ class AutoNEB:
try:
energies.append(a.get_potential_energy())
except RuntimeError:
- energies.append(np.NaN)
+ energies.append(np.nan)
return energies
def get_energies_one_image(self, image):
@@ -553,7 +553,7 @@ class AutoNEB:
try:
energy = image.get_potential_energy()
except RuntimeError:
- energy = np.NaN
+ energy = np.nan
return energy
def get_highest_energy_index(self):
Index: ase-3.23.0/ase/dft/__init__.py
===================================================================
--- ase-3.23.0.orig/ase/dft/__init__.py
+++ ase-3.23.0/ase/dft/__init__.py
@@ -1,4 +1,8 @@
import numpy as np
+try:
+ from numpy import trapezoid # NumPy 2.0.0
+except ImportError:
+ from numpy import trapz as trapezoid
from ase.dft.dos import DOS
from ase.dft.kpoints import monkhorst_pack
@@ -19,9 +23,9 @@ def get_distribution_moment(x, y, order=
y = np.asarray(y)
if order == 0:
- return np.trapz(y, x)
+ return trapezoid(y, x)
elif isinstance(order, int):
- return np.trapz(x**order * y, x) / np.trapz(y, x)
+ return trapezoid(x**order * y, x) / trapezoid(y, x)
elif hasattr(order, '__iter__'):
return [get_distribution_moment(x, y, n) for n in order]
else:
Index: ase-3.23.0/ase/md/switch_langevin.py
===================================================================
--- ase-3.23.0.orig/ase/md/switch_langevin.py
+++ ase-3.23.0/ase/md/switch_langevin.py
@@ -1,6 +1,10 @@
from typing import Any, List, Optional
import numpy as np
+try:
+ from numpy import trapezoid # NumPy 2.0.0
+except ImportError:
+ from numpy import trapz as trapezoid
from ase import Atoms
from ase.calculators.mixing import MixedCalculator
@@ -117,7 +121,7 @@ class SwitchLangevin(Langevin):
lambdas = self.path_data[:, 1]
U1 = self.path_data[:, 2]
U2 = self.path_data[:, 3]
- delta_F = np.trapz(U2 - U1, lambdas)
+ delta_F = trapezoid(U2 - U1, lambdas)
return delta_F
Index: ase-3.23.0/ase/test/calculator/test_harmonic.py
===================================================================
--- ase-3.23.0.orig/ase/test/calculator/test_harmonic.py
+++ ase-3.23.0/ase/test/calculator/test_harmonic.py
@@ -1,6 +1,10 @@
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal
+try:
+ from numpy import trapezoid # NumPy 2.0.0
+except ImportError:
+ from numpy import trapz as trapezoid
from ase import Atoms
from ase.calculators.calculator import CalculationFailed, CalculatorSetupError
@@ -266,7 +270,7 @@ def test_thermodynamic_integration():
e0, e1 = calc_linearCombi.get_energy_contributions(atoms)
ediffs[lamb].append(float(e1) - float(e0))
ediffs[lamb] = np.mean(ediffs[lamb])
- dA = np.trapz([ediffs[lamb] for lamb in lambs], x=lambs) # anharm. corr.
+ dA = trapezoid([ediffs[lamb] for lamb in lambs], x=lambs) # anharm. corr.
assert -0.005 < dA < 0.005 # the MD run is to short for convergence
if dA == 0.0:
raise ValueError('there is most likely something wrong, but it could '
Index: ase-3.23.0/ase/io/octopus/input.py
===================================================================
--- ase-3.23.0.orig/ase/io/octopus/input.py
+++ ase-3.23.0/ase/io/octopus/input.py
@@ -516,7 +516,7 @@ def atoms2kwargs(atoms, use_ase_cell):
if atoms.cell.orthorhombic:
Lsize = 0.5 * np.diag(cell)
- kwargs['lsize'] = [[repr(size) for size in Lsize]]
+ kwargs['lsize'] = [[str(size) for size in Lsize]]
# ASE uses (0...cell) while Octopus uses -L/2...L/2.
# Lsize is really cell / 2, and we have to adjust our
# positions by subtracting Lsize (see construction of the coords
@@ -533,7 +533,7 @@ def atoms2kwargs(atoms, use_ase_cell):
if sym is None:
raise ValueError('Cannot represent atom X without tags and '
'species info in atoms.info')
- coord_block.append([repr(sym)] + [repr(x) for x in pos])
+ coord_block.append([repr(sym)] + [str(x) for x in pos])
kwargs[coordtype] = coord_block
npbc = sum(atoms.pbc)
Index: ase-3.23.0/ase/dft/band_structure.py
===================================================================
--- ase-3.23.0.orig/ase/dft/band_structure.py
+++ ase-3.23.0/ase/dft/band_structure.py
@@ -1,6 +1,9 @@
import warnings
-from numpy import VisibleDeprecationWarning
+try:
+ from numpy.exceptions import VisibleDeprecationWarning # NumPy 2.0.0
+except ImportError:
+ from numpy import VisibleDeprecationWarning
from ase.spectrum.band_structure import * # noqa: F401,F403
Index: ase-3.23.0/ase/test/test_imports.py
===================================================================
--- ase-3.23.0.orig/ase/test/test_imports.py
+++ ase-3.23.0/ase/test/test_imports.py
@@ -3,7 +3,10 @@ from importlib import import_module
from pathlib import Path
import pytest
-from numpy import VisibleDeprecationWarning
+try:
+ from numpy.exceptions import VisibleDeprecationWarning # NumPy 2.0.0
+except ImportError:
+ from numpy import VisibleDeprecationWarning
import ase

View File

@@ -1,3 +1,34 @@
-------------------------------------------------------------------
Thu Aug 28 04:31:25 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 3.26.0:
* Requirements
+ The minimum supported Python version has increased to 3.9
* Breaking changes
+ Removed unused IOFormat.open() method.
+ The Optimizable interface now works in terms of arbitrary degrees of
freedom rather than Cartesian (Nx3) ones.
+ ase.io.orca.read_orca_output now returns Atoms with attached
properties. ase.io.read() will use this function.
+ The master parameter to each Optimizer is now passed via **kwargs and
so becomes keyword-only.
+ Removed legacy read_cell and write_cell functions from ase.io.castep.
+ Removed deprecated force_consistent option from Optimizer.
+ ase.spectrum.band_structure.BandStructurePlot: the plot_with_colors()
has been removed and its features merged into the plot() method.
* Highlights
+ Changed ELK based on GenericFileIOCalculator.
+ The “heavy-weight” database backends in ase.db have been moved to a
separate project.
+ Major improvements to find_optimal_cell_shape(): improve target metric;
ensure rotationally invariant results; avoid negative determinants;
improved performance via vectorisation.
+ Added new FiniteDifferenceCalculator, which wraps other calculator for
finite-difference forces and strains.
+ Added two new MD thermostats: ase.md.bussi.Bussi and
ase.md.nose_hoover_chain.NoseHooverChainNVT.
- Drop patch ase-mr3400-numpy2.patch, included upstream.
-------------------------------------------------------------------
Fri Aug 30 12:50:49 UTC 2024 - Ben Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-ase
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,31 +17,29 @@
Name: python-ase
Version: 3.23.0
Version: 3.26.0
Release: 0
Summary: Atomic Simulation Environment
License: LGPL-2.1-or-later
URL: https://wiki.fysik.dtu.dk/ase
Source: https://files.pythonhosted.org/packages/source/a/ase/ase-%{version}.tar.gz
# PATCH-FIX-UPSTREAM ase-mr3400-numpy2.patch https://gitlab.com/ase/ase/-/merge_requests/3400
Patch0: ase-mr3400-numpy2.patch
BuildRequires: %{python_module base >= 3.9}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module matplotlib >= 3.1.0}
BuildRequires: %{python_module numpy >= 1.15.0}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scipy >= 1.1.0}
BuildRequires: %{python_module matplotlib >= 3.3.4}
BuildRequires: %{python_module numpy >= 1.19.5}
BuildRequires: %{python_module pytest >= 7}
BuildRequires: %{python_module pytest-xdist >= 2.1}
BuildRequires: %{python_module scipy >= 1.6.0}
BuildRequires: %{python_module tk}
# /SECTION
BuildRequires: fdupes
Requires: python-matplotlib >= 3.1.0
Requires: python-numpy >= 1.15.0
Requires: python-scipy >= 1.1.0
Requires: python-matplotlib >= 3.3.4
Requires: python-numpy >= 1.19.5
Requires: python-scipy >= 1.6.0
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch