sci-physics/yoda: add 2.1.3, enable py3.14

Closes: https://bugs.gentoo.org/974132
Signed-off-by: Alexander Puck Neuwirth <apn-pucky@gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/46314
This commit is contained in:
Alexander Puck Neuwirth
2026-05-25 13:31:00 +02:00
parent d0a6f44637
commit 8a69e50e3d
4 changed files with 288 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
DIST YODA-1.9.10.tar.bz2 1278729 BLAKE2B f6ae9b579d79b6be62e9644e327f0b449882c0f1a0efaac09ac97eae90a2ced10bf2b13447d75390552b3e4d8c128e7a33184bf8b2d308236f828e611df6d7a4 SHA512 54a455a1b2772ea3201477d4dddcf0c92c85bfee8825d8726d62331ebacb37fc8d1f6e02cdfe592722f2a747a46786d2bdb3c36cc982794a30b25e718d32e998
DIST YODA-2.1.2.tar.bz2 1022526 BLAKE2B 75f13b04b66b632c66e2442f8bf8ccdb23ce15eec88e9b26a7924d0dc0e4ca80be0eadaf032aeec489a48b2b21beb9656d4f8fdf03ece02dca81133e23850d8d SHA512 39c21f97333c98744006d39903c3cdfd617a8ab6fc253f08412898e8998678963912bd6c6fb0b7bb58e162f48658606d9cdb891f12bc64ff730b158292ff9a85
DIST YODA-2.1.3.tar.bz2 1033195 BLAKE2B 14065f1bc9a149206e07b80551740b59d8701106cb787ef5c1e1846590d819fd544fe5949859018f3c36daecebdb255308904091eb33b82eb6796a0b43c770f2 SHA512 8424746078434f0fedc405f35d89638bdf01a1f1e49dfed8a8da98682f3d9561356d9eea7cdc22898a861bc980c000e75cc4e63ed9e15670e53b2f15760cf813

View File

@@ -0,0 +1,173 @@
From 22c3cfbd04bdd7ef31db0800f9fa8d5a7f637e2e Mon Sep 17 00:00:00 2001
From: Alexander Puck Neuwirth <alexander@neuwirth-informatik.de>
Date: Mon, 25 May 2026 12:55:59 +0200
Subject: [PATCH 1/2] Use namespace std and remove std:: prefixes
---
tests/TestBinnedStorage.cc | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/tests/TestBinnedStorage.cc b/tests/TestBinnedStorage.cc
index 4ce8a18c..b61a078a 100644
--- a/tests/TestBinnedStorage.cc
+++ b/tests/TestBinnedStorage.cc
@@ -9,18 +9,19 @@
#include <vector>
using namespace YODA;
+using namespace std;
-using DStrAxis = Axis<std::string>;
+using DStrAxis = Axis<string>;
using CDblAxis = Axis<double>;
using DIntAxis = Axis<int>;
using BinningT = Binning<DStrAxis, CDblAxis, DIntAxis>;
template <typename T>
-using StorageT = BinnedStorage<T, std::string, double, int>;
+using StorageT = BinnedStorage<T, string, double, int>;
template <size_t N, typename T>
-using FillableT = FillableStorage<N, T, std::string, double, int>;
+using FillableT = FillableStorage<N, T, string, double, int>;
auto constructors() {
BinningT binning({"test1", "test2"}, {1., 2., 3., 4.}, {1, 2, 3, 4, 5});
@@ -63,7 +64,7 @@ auto adapterConstructors() {
auto binStorage2 = FillableT<3, double>(binning, adapter1);
auto binStorage3 = FillableT<3, TestClass>(binning, adapter2);
- binStorage3.fill({"test1", 1.5, 1}, std::make_index_sequence<3>());
+ binStorage3.fill({"test1", 1.5, 1}, make_index_sequence<3>());
FillableT<3, TestClass>::BinType& bin = binStorage3.binAt({"test1", 1.5, 1});
@@ -83,10 +84,10 @@ auto set() {
}
auto binsVectorWrapper() {
- auto binning = std::make_shared<BinningT>(
+ auto binning = make_shared<BinningT>(
BinningT({"test1", "test2"}, {1., 2., 3., 4.}, {1, 2, 3, 4, 5}));
using BinT = Bin<3, int, BinningT>;
- std::vector<BinT> bins;
+ vector<BinT> bins;
bins.reserve(100);
for(size_t i = 0; i < 100; i++){
@@ -94,9 +95,9 @@ auto binsVectorWrapper() {
}
/// @note Must be sorted.
- std::vector<size_t> hiddenBins = {0, 9, 15, 87};
+ vector<size_t> hiddenBins = {0, 9, 15, 87};
- auto vecWrapper = BinsVecWrapper<std::vector<BinT>>(bins, hiddenBins);
+ auto vecWrapper = BinsVecWrapper<vector<BinT>>(bins, hiddenBins);
for (auto& bin : vecWrapper) {
for (auto& i : hiddenBins) {
@@ -178,8 +179,8 @@ auto dbnAdapter() {
auto binStorage = FillableT<3, Dbn<3>>(binning);
- binStorage.fill({"test1", 1.4, 1}, std::make_index_sequence<3>(), 2.0, 1.0);
- binStorage.fill({"test1", 1.6, 1}, std::make_index_sequence<3>(), 2.0, 1.0);
+ binStorage.fill({"test1", 1.4, 1}, make_index_sequence<3>(), 2.0, 1.0);
+ binStorage.fill({"test1", 1.6, 1}, make_index_sequence<3>(), 2.0, 1.0);
auto& bin = binStorage.binAt({"test1", 1.4, 1});
@@ -190,7 +191,7 @@ auto shape() {
vector<string> sedges{"A", "B", "C"};
vector<double> dedges{1.,2.,3.,4.};
vector<int> iedges{1,2,3,4,5,6,7};
- using BinStorageT = BinnedStorage<double, std::string, double, int>;
+ using BinStorageT = BinnedStorage<double, string, double, int>;
BinStorageT storage(sedges, dedges, iedges);
const bool res1 = storage.shape() == vector<size_t>{3, 3, 7};
const bool res2 = storage.shape(true) == vector<size_t>{4, 5, 8};
@@ -198,10 +199,10 @@ auto shape() {
}
auto getBins() {
- using BinStorageT = BinnedStorage<double, std::string, double>;
+ using BinStorageT = BinnedStorage<double, string, double>;
BinStorageT binnedStorage1({"test1", "test2"}, { 1.0, 2.0, 3.0});
- std::vector<size_t> overflowIndices = {0, 1, 2, 3, 6, 9, 10, 11};
+ vector<size_t> overflowIndices = {0, 1, 2, 3, 6, 9, 10, 11};
auto binsVec1 = binnedStorage1.bins();
@@ -213,11 +214,11 @@ auto getBins() {
/// @note Double curly braces to construct temporary axes, because
/// there is no constructor defined to work with arguments
- /// of std::initializer_list<T> and std::initializer_list<std::initializer_list<T>>
+ /// of initializer_list<T> and initializer_list<initializer_list<T>>
/// type. Intermediate axis is created.
/*BinStorageT binnedStorage2({{"test1", "test2"}}, {{{1., 2.}, {3., 4.}}});
- std::vector<size_t> hiddenBinIndices = {4, 5}; /// {0,1} + 2*2
+ vector<size_t> hiddenBinIndices = {4, 5}; /// {0,1} + 2*2
auto binsVec2 = binnedStorage2.bins(true);
@@ -231,7 +232,7 @@ auto getBins() {
}
auto mergeBins() {
- using BinStorageT = BinnedStorage<double, std::string, double>;
+ using BinStorageT = BinnedStorage<double, string, double>;
BinStorageT binnedStorage1({"test1", "test2"}, {1., 2., 3.});
BinStorageT binnedStorage2({"test1", "test2"}, {1., 2., 3., 4., 5., 6.});
@@ -248,7 +249,7 @@ auto mergeBins() {
}
auto binnedStorageOperators() {
- using BinStorageT = BinnedStorage<double, std::string, double>;
+ using BinStorageT = BinnedStorage<double, string, double>;
BinStorageT binnedStorage1({"test1", "test2"}, {1., 2., 3.});
BinStorageT binnedStorage2({"test1", "test2"}, {1., 2., 3., 4., 5., 6.});
--
GitLab
From a34335f7058152218ba35a5c2af13780c1c6524f Mon Sep 17 00:00:00 2001
From: Alexander Puck Neuwirth <alexander@neuwirth-informatik.de>
Date: Mon, 25 May 2026 14:01:46 +0200
Subject: [PATCH 2/2] rename: set -> setFunction
---
tests/TestBinnedStorage.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/TestBinnedStorage.cc b/tests/TestBinnedStorage.cc
index b61a078a..9382f40f 100644
--- a/tests/TestBinnedStorage.cc
+++ b/tests/TestBinnedStorage.cc
@@ -71,7 +71,7 @@ auto adapterConstructors() {
return CHECK_TEST_RES(bin.counter == 1);
}
-auto set() {
+auto setFunction() {
BinningT binning({"test1", "test2"}, {1., 2., 3., 4.}, {1, 2, 3, 4, 5});
auto binStorage = FillableT<3, TestClass>(binning, [](...){});
@@ -285,7 +285,7 @@ auto testBinnedStorage() {
return CHECK_TEST_RES(
(constructors() == EXIT_SUCCESS) &&
(adapterConstructors() == EXIT_SUCCESS) &&
- (set() == EXIT_SUCCESS) &&
+ (setFunction() == EXIT_SUCCESS) &&
(binsVectorWrapper() == EXIT_SUCCESS) &&
(binSpaceCharacteristics() == EXIT_SUCCESS) &&
(arithmeticWrapper() == EXIT_SUCCESS) &&
--
GitLab

View File

@@ -0,0 +1,113 @@
# Copyright 2022-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{12..14} )
inherit bash-completion-r1 python-single-r1 optfeature autotools
DESCRIPTION="Yet more Objects for (High Energy Physics) Data Analysis"
HOMEPAGE="https://yoda.hepforge.org/"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://gitlab.com/hepcedar/yoda"
EGIT_BRANCH="main"
else
SRC_URI="https://yoda.hepforge.org/downloads?f=${P^^}.tar.bz2 -> ${P^^}.tar.bz2"
S="${WORKDIR}/${P^^}"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="GPL-3"
SLOT="0/${PV}"
IUSE="test +highfive +python +zlib"
RESTRICT="!test? ( test )"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND="
dev-cpp/yaml-cpp
highfive? (
sci-libs/highfive
sci-libs/hdf5[cxx]
)
python? ( ${PYTHON_DEPS} )
zlib? ( virtual/zlib:= )
"
DEPEND="${RDEPEND}"
BDEPEND="
python? (
$(python_gen_cond_dep '
>=dev-python/cython-0.29.24[${PYTHON_USEDEP}]
')
test? (
$(python_gen_cond_dep '
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/matplotlib[${PYTHON_USEDEP}]
')
)
)
"
PATCHES=(
"${FILESDIR}"/${P}-stdvector.patch
)
pkg_setup() {
use python && python-single-r1_pkg_setup
}
src_prepare() {
default
# reconf due to 9999 version
eautoreconf
}
src_configure() {
# we need to use the prefix cython here
econf --disable-static \
--with-yaml-cpp="${EPREFIX}/usr" \
$(use_enable highfive h5) \
$(use_with highfive highfive "${ESYSROOT}/usr") \
$(use_enable python pyext) \
$(use_with zlib zlib "${ESYSROOT}/usr") \
$(usex python CYTHON="${ESYSROOT}/usr/bin/cython")
}
src_test() {
# PYTESTS and SHTESTS both require python tools
if use python; then
emake check
else
emake check PYTESTS= SHTESTS= NO_PYTHON=1
fi
}
src_install() {
default
if use python ; then
newbashcomp "${ED}"/etc/bash_completion.d/${PN}-completion ${PN}-config
bashcomp_alias ${PN}-config \
${PN}ls \
${PN}diff \
${PN}merge \
${PN}stack \
${PN}scale \
${PN}plot \
${PN}envelope \
${PN}cnv \
${PN}2root
rm "${ED}"/etc/bash_completion.d/${PN}-completion || die
python_optimize
fi
find "${ED}" -name '*.la' -delete || die
}
pkg_postinst() {
optfeature "root conversion" sci-physics/root
optfeature "latex plotting support" virtual/latex-base
optfeature "python plotting support" dev-python/matplotlib
}

View File

@@ -3,7 +3,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{12..13} )
PYTHON_COMPAT=( python3_{12..14} )
inherit bash-completion-r1 python-single-r1 optfeature autotools