summaryrefslogtreecommitdiff
path: root/dev-python/pyamg
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-python/pyamg
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-python/pyamg')
-rw-r--r--dev-python/pyamg/Manifest1
-rw-r--r--dev-python/pyamg/files/pyamg-5.3.0-backport.patch36
-rw-r--r--dev-python/pyamg/metadata.xml19
-rw-r--r--dev-python/pyamg/pyamg-5.3.0-r1.ebuild62
-rw-r--r--dev-python/pyamg/pyamg-5.3.0.ebuild57
5 files changed, 175 insertions, 0 deletions
diff --git a/dev-python/pyamg/Manifest b/dev-python/pyamg/Manifest
new file mode 100644
index 000000000000..c3b6767c57be
--- /dev/null
+++ b/dev-python/pyamg/Manifest
@@ -0,0 +1 @@
+DIST pyamg-5.3.0.gh.tar.gz 4148527 BLAKE2B ee759f86474aab91a7774afade01b4647943a790cf2e1148d24f01e26b9be61c29df29cac2a6b62aa62d2428786f3cfa26c957c0fd5972b4e0c8eab1dad06c1d SHA512 f2e11705cfbcd28a59a7ec226eb9d5f4ef978adb9104953c6f5f01868d82c9e4f7605ecc57664e467cf78733f5ebc2ec80859a7136cd5c1c4351c603a978a5fc
diff --git a/dev-python/pyamg/files/pyamg-5.3.0-backport.patch b/dev-python/pyamg/files/pyamg-5.3.0-backport.patch
new file mode 100644
index 000000000000..b69bc3e2730b
--- /dev/null
+++ b/dev-python/pyamg/files/pyamg-5.3.0-backport.patch
@@ -0,0 +1,36 @@
+From 9f8299bcf1141e627503c3f208eda413bc1e28e6 Mon Sep 17 00:00:00 2001
+From: Stephen Huan <stephen.huan@cgdct.moe>
+Date: Tue, 24 Mar 2026 21:47:30 -0400
+Subject: [PATCH] fix(util/utils): duplicate zeros in filter_operator
+
+The explicit zeros added to A to match C's nonzeros can be redundant
+with the existing entries in A. These duplicate entries are acted on
+independently by amg_core.satisfy_constraints_helper, causing the
+update to effectively happen multiple times when duplicate entries in
+sparse arrays are added together according to scipy's semantics.
+---
+ pyamg/util/utils.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/pyamg/util/utils.py b/pyamg/util/utils.py
+index 69ed1507..4a955253 100644
+--- a/pyamg/util/utils.py
++++ b/pyamg/util/utils.py
+@@ -1242,7 +1242,7 @@ def filter_operator(A, C, B, Bf, BtBinv=None):
+ C = C.copy()
+ C.data[:] = 1
+ A = A.multiply(C)
+- # add explicit zeros to A wherever C is nonzero, but A is zero
++ # add explicit zeros to A wherever C is nonzero
+ A = A.tocoo()
+ C = C.tocoo()
+ A.data = np.hstack((np.zeros(C.data.shape, dtype=A.dtype), A.data))
+@@ -1252,6 +1252,8 @@ def filter_operator(A, C, B, Bf, BtBinv=None):
+ A = A.tobsr((rows_per_block, cols_per_block))
+ else:
+ A = A.tocsr()
++ # eliminate redundant zeros created by the above
++ A.sum_duplicates()
+
+ # Calculate difference between A @ B and Bf
+ diff = A @ B - Bf
diff --git a/dev-python/pyamg/metadata.xml b/dev-python/pyamg/metadata.xml
new file mode 100644
index 000000000000..e44283d35f49
--- /dev/null
+++ b/dev-python/pyamg/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <longdescription lang="en">
+ PyAMG is a library of Algebraic Multigrid (AMG) solvers with a
+ Python interface.
+ The predominant portion of PyAMG is written in Python with a smaller
+ amount of supporting C++ code for performance critical operations.
+ </longdescription>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-python/pyamg/pyamg-5.3.0-r1.ebuild b/dev-python/pyamg/pyamg-5.3.0-r1.ebuild
new file mode 100644
index 000000000000..1797efe3c8c8
--- /dev/null
+++ b/dev-python/pyamg/pyamg-5.3.0-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit distutils-r1
+
+DESCRIPTION="Algebraic multigrid solvers in Python"
+HOMEPAGE="
+ https://github.com/pyamg/pyamg/
+ https://pypi.org/project/pyamg/
+"
+SRC_URI="
+ https://github.com/pyamg/pyamg/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="
+ dev-python/pybind11[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+"
+RDEPEND="
+ dev-python/cppheaderparser[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ >=dev-python/scipy-1.11.0[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ ${DEPEND}
+ >=dev-python/setuptools-scm-7.0.0[${PYTHON_USEDEP}]
+ test? (
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_PLUGINS=()
+distutils_enable_tests pytest
+
+src_prepare() {
+ local PATCHES=(
+ # https://github.com/pyamg/pyamg/commit/9f8299bcf1141e627503c3f208eda413bc1e28e6
+ "${FILESDIR}/${P}-backport.patch"
+ )
+
+ distutils-r1_src_prepare
+
+ # invalid with >=setuptools-scm-9
+ sed -i -e '/version =/d' setup.cfg || die
+}
+
+python_test() {
+ cd "${T}" || die
+ epytest --pyargs pyamg
+}
diff --git a/dev-python/pyamg/pyamg-5.3.0.ebuild b/dev-python/pyamg/pyamg-5.3.0.ebuild
new file mode 100644
index 000000000000..a145f2a12b04
--- /dev/null
+++ b/dev-python/pyamg/pyamg-5.3.0.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit distutils-r1
+
+DESCRIPTION="Algebraic multigrid solvers in Python"
+HOMEPAGE="
+ https://github.com/pyamg/pyamg/
+ https://pypi.org/project/pyamg/
+"
+SRC_URI="
+ https://github.com/pyamg/pyamg/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="
+ dev-python/pybind11[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+"
+RDEPEND="
+ dev-python/cppheaderparser[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ >=dev-python/scipy-1.11.0[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ ${DEPEND}
+ >=dev-python/setuptools-scm-7.0.0[${PYTHON_USEDEP}]
+ test? (
+ dev-python/matplotlib[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_PLUGINS=()
+distutils_enable_tests pytest
+
+src_prepare() {
+ distutils-r1_src_prepare
+
+ # invalid with >=setuptools-scm-9
+ sed -i -e '/version =/d' setup.cfg || die
+}
+
+python_test() {
+ cd "${T}" || die
+ epytest --pyargs pyamg
+}