From 24e428bc886f7922464b0978345fc2d9f4fa758309d9e1222bfbb68e664f73b5 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 18 Jul 2024 03:51:42 +0000 Subject: [PATCH] - Update to 3.23.0: * Add FixSubsetCom to fix the center of mass of the specified subset of atoms. * Add the indices option to ase.Atoms.get_center_of_mass() to compute the center of mass of the specified subset of atoms. * All saddle-point search and minimum-energy path methods have been moved into a new ase.mep module. You should start importing from this location; e.g., from ase.mep import NEB, DyNEB. * Fix ase.constraints.FixCom.adjust_momenta() to have no center-of-mass momentum * ase.build.surface.graphene() now takes a thickness argument * ase.build.bulk() now assigns initial magnetic moments to BCC Fe, Co, and Ni. * ase.build.make_supercell() can now control how to order the atoms in the supercell via the option order * mask() returns the mask of nonzero cell vectors, an array of three booleans. * reciprocal() now guarantees that cell vectors which are zero correspond to reciprocal cell vectors that are also zero. Previously the reciprocal cell vectors could have small nonzero values due to floating point tolerance. * The Cell object now has normal() and normals() which calculate normal vectors to one or all pairs of cell vectors. Also added area() and areas(), which return the area spanned by one or all pairs of cell vectors. * New a2b and periodic formats for Formula objects. The abc format has been renamed to ab2. * IO formats can now be implemented in separate packages and registered in ase with the entry point ase.ioformats in the external package configuration. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-ase?expand=0&rev=7 --- 2582.patch | 26 ---------- ase-3.22.1.tar.gz | 3 -- ase-3.23.0.tar.gz | 3 ++ deprecated-importlib-find_loader.patch | 32 ------------ python-ase.changes | 67 ++++++++++++++++++++++++++ python-ase.spec | 39 ++++++--------- support-matplotlib-36.patch | 37 -------------- 7 files changed, 85 insertions(+), 122 deletions(-) delete mode 100644 2582.patch delete mode 100644 ase-3.22.1.tar.gz create mode 100644 ase-3.23.0.tar.gz delete mode 100644 deprecated-importlib-find_loader.patch delete mode 100644 support-matplotlib-36.patch diff --git a/2582.patch b/2582.patch deleted file mode 100644 index 26f8aaf..0000000 --- a/2582.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5e733253d9e791ed1568076ede93a983f27979f6 Mon Sep 17 00:00:00 2001 -From: "Adam J. Jackson" -Date: Tue, 30 Nov 2021 09:51:47 +0000 -Subject: [PATCH] TST: Vibration slab test should check for movement in ANY - direction - -It is possible for a perfectly good eigenvector to be zero in some -Cartesian direction; this was encountered in #976 and appears to be -architecture-dependent. ---- - ase/test/vibrations/test_vib.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ase/test/vibrations/test_vib.py b/ase/test/vibrations/test_vib.py -index fe28ff13e5..7786a47aec 100644 ---- a/ase/test/vibrations/test_vib.py -+++ b/ase/test/vibrations/test_vib.py -@@ -524,4 +524,4 @@ class TestSlab: - assert_array_almost_equal(vibs.get_mode(i)[0], [0., 0., 0.]) - - # The N atoms should have finite displacement -- assert np.all(vibs.get_mode(i)[-2:, :]) -+ assert np.all(np.any(vibs.get_mode(i)[-2:, :], axis=1)) --- -GitLab - diff --git a/ase-3.22.1.tar.gz b/ase-3.22.1.tar.gz deleted file mode 100644 index e7ee22d..0000000 --- a/ase-3.22.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:004df6b0ea04b1114c790fadfe45d4125eb0e53125c66a93425af853d82ab432 -size 2807134 diff --git a/ase-3.23.0.tar.gz b/ase-3.23.0.tar.gz new file mode 100644 index 0000000..49f4b35 --- /dev/null +++ b/ase-3.23.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91a2aa31d89bd90b0efdfe4a7e84264f32828b2abfc9f38e65e041ad76fec8ae +size 2336462 diff --git a/deprecated-importlib-find_loader.patch b/deprecated-importlib-find_loader.patch deleted file mode 100644 index 052aa05..0000000 --- a/deprecated-importlib-find_loader.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: ase-3.22.1/ase/calculators/autodetect.py -=================================================================== ---- ase-3.22.1.orig/ase/calculators/autodetect.py -+++ ase-3.22.1/ase/calculators/autodetect.py -@@ -45,11 +45,11 @@ def detect(name): - return d - - if name in python_modules: -- loader = importlib.find_loader(python_modules[name]) -- if loader is not None: -+ spec = importlib.util.find_spec(python_modules[name]) -+ if spec is not None: - d['type'] = 'python' - d['module'] = python_modules[name] -- d['path'] = loader.get_filename() -+ d['path'] = spec.loader.get_filename() - return d - - envvar = get_executable_env_var(name) -Index: ase-3.22.1/ase/test/testsuite.py -=================================================================== ---- ase-3.22.1.orig/ase/test/testsuite.py -+++ ase-3.22.1/ase/test/testsuite.py -@@ -53,7 +53,7 @@ def test(calculators=tuple(), jobs=0, ve - - - def have_module(module): -- return importlib.find_loader(module) is not None -+ return importlib.util.find_spec(module) is not None - - - MULTIPROCESSING_MAX_WORKERS = 32 diff --git a/python-ase.changes b/python-ase.changes index 8f4e016..a425a41 100644 --- a/python-ase.changes +++ b/python-ase.changes @@ -1,3 +1,70 @@ +------------------------------------------------------------------- +Thu Jul 18 03:49:28 UTC 2024 - Steve Kowalik + +- Update to 3.23.0: + * Add FixSubsetCom to fix the center of mass of the specified subset + of atoms. + * Add the indices option to ase.Atoms.get_center_of_mass() to compute + the center of mass of the specified subset of atoms. + * All saddle-point search and minimum-energy path methods have been + moved into a new ase.mep module. You should start importing from this + location; e.g., from ase.mep import NEB, DyNEB. + * Fix ase.constraints.FixCom.adjust_momenta() to have no center-of-mass + momentum + * ase.build.surface.graphene() now takes a thickness argument + * ase.build.bulk() now assigns initial magnetic moments to BCC Fe, Co, + and Ni. + * ase.build.make_supercell() can now control how to order the atoms in + the supercell via the option order + * mask() returns the mask of nonzero cell vectors, an array of three + booleans. + * reciprocal() now guarantees that cell vectors which are zero correspond + to reciprocal cell vectors that are also zero. Previously the + reciprocal cell vectors could have small nonzero values due to floating + point tolerance. + * The Cell object now has normal() and normals() which calculate normal + vectors to one or all pairs of cell vectors. Also added area() and + areas(), which return the area spanned by one or all pairs of cell + vectors. + * New a2b and periodic formats for Formula objects. The abc format has + been renamed to ab2. + * IO formats can now be implemented in separate packages and registered + in ase with the entry point ase.ioformats in the external package + configuration. + * ase.phonons.Displacement now has a comm keyword argument to better + support parallelization. + * Fix ase.build.rotate.minimize_rotation_and_translation() for systems + with periodic boundary conditions. + * Fix ase.io.db.row.AtomsRow.charge(), which was looking for + inital_charges instead of initial_charges. + * Fixed definition of the Lennard-Jones potential in ase.utils.ff + * The x3d viewer has improved aesthetics + * Added a function, ase.dft.kpoints.mindistance2monkhorstpack(), to + construct a Monkhorst-Pack grid + * Fixed turbomole calculator parsing issues when = are present in data + groups + * Fixed round-trip dict (de)serialization with FixedMode constraint + * Show total number of rows in ASE database + * Fix units of magnetic moments in ASE database + * General improvements to POVRay colors + * Remove deprecated CLI functions, such as the old ase-gui command + * Fix calculation of stresses in ase.stress.full_3x3_to_voigt_6_stress() + * Add polarization parser for FHI-AIMS calculator + * Fix bug in ase.atoms.Atoms.get_center_of_mass() + * Fix multiprocessing bug with ase.neb.NEB + * NEB calculations now call get_forces() instead of get_potential_energy() + followed by get_forces() to prevent duplicate work + * Improve performance of ase.build.supercells.make_supercell() for large + supercells + * Fix conservation of momentum in ase.md.langevin.Langevin + * Fix bug in ase.vibrations.Vibrations causing property calculations to + always use the default method +- Switch to pyproject macros. +- Remove patches, included upstream: + * support-matplotlib-36.patch + * 2582.patch + * deprecated-importlib-find_loader.patch + ------------------------------------------------------------------- Tue Feb 6 18:08:22 UTC 2024 - Daniel Garcia diff --git a/python-ase.spec b/python-ase.spec index 6dcb83e..549cf02 100644 --- a/python-ase.spec +++ b/python-ase.spec @@ -17,23 +17,19 @@ Name: python-ase -Version: 3.22.1 +Version: 3.23.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 https://gitlab.com/ase/ase/-/merge_requests/2826 -Patch0: support-matplotlib-36.patch -# PATCH-FIX-UPSTREAM https://gitlab.com/ase/ase/-/merge_requests/2582 -Patch1: 2582.patch -# PATCH-FIX-UPSTREAM deprecated-importlib-find_loader.patch https://gitlab.com/ase/ase/-/merge_requests/2938 -Patch2: deprecated-importlib-find_loader.patch +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 numpy >= 1.15.0 with %python-numpy < 2} BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} @@ -42,8 +38,10 @@ 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-numpy >= 1.15.0 with python-numpy < 2) +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %python_subpackages @@ -54,24 +52,22 @@ Atomic Simulation Environment %autosetup -p1 -n ase-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/ase -%python_clone -a %{buildroot}%{_bindir}/ase-db -%python_clone -a %{buildroot}%{_bindir}/ase-gui -%python_clone -a %{buildroot}%{_bindir}/ase-run -%python_clone -a %{buildroot}%{_bindir}/ase-info -%python_clone -a %{buildroot}%{_bindir}/ase-build %python_expand %fdupes %{buildroot}%{$python_sitelib} %check # No scipy CODATA -%pytest -k 'not test_units' +donttest="test_units" +# Broken with current release, remove on upgrade +donttest+=" or test_pw_input_write_nested_flat or test_fix_scaled" +%pytest -k "not ($donttest)" %post -%python_install_alternative ase ase-db ase-gui ase-run ase-info ase-build +%python_install_alternative ase %postun %python_uninstall_alternative ase @@ -80,12 +76,7 @@ Atomic Simulation Environment %doc CHANGELOG.rst README.rst %license COPYING COPYING.LESSER LICENSE %python_alternative %{_bindir}/ase -%python_alternative %{_bindir}/ase-db -%python_alternative %{_bindir}/ase-gui -%python_alternative %{_bindir}/ase-run -%python_alternative %{_bindir}/ase-info -%python_alternative %{_bindir}/ase-build %{python_sitelib}/ase -%{python_sitelib}/ase*info +%{python_sitelib}/ase-%{version}.dist-info %changelog diff --git a/support-matplotlib-36.patch b/support-matplotlib-36.patch deleted file mode 100644 index 95e4627..0000000 --- a/support-matplotlib-36.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 3d4fff328ba9a06d9799563f357cfe5968f1f79c Mon Sep 17 00:00:00 2001 -From: Ask Hjorth Larsen -Date: Mon, 16 Jan 2023 16:41:15 +0100 -Subject: [PATCH] set window title in way that will not crash on matplotlib - 3.6+ - ---- - ase/cli/band_structure.py | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/ase/cli/band_structure.py b/ase/cli/band_structure.py -index 303c64b88..603ad659a 100644 ---- a/ase/cli/band_structure.py -+++ b/ase/cli/band_structure.py -@@ -16,15 +16,17 @@ def read_band_structure(filename): - - def main(args, parser): - import matplotlib.pyplot as plt -+ - bs = read_band_structure(args.calculation) - emin, emax = (float(e) for e in args.range) -- fig = plt.gcf() -- fig.canvas.set_window_title(args.calculation) -+ fig = plt.figure(args.calculation) - ax = fig.gca() -+ - bs.plot(ax=ax, - filename=args.output, - emin=emin + bs.reference, - emax=emax + bs.reference) -+ - if args.output is None: - plt.show() - --- -GitLab -