# uhi -- the Unified Histogram Interface (scikit-hep): the PlottableHistogram # protocol plus NumPy adapters, so plotting and printing libraries can accept # histograms from boost-histogram, NumPy, uproot and others without importing # them. New to Fedora. Needed by python-histoprint, which babelbrain imports # in its Step 1 (BabelDatasetPreps). %global pypi_name uhi Name: python-%{pypi_name} Version: 1.2.1 Release: 1%{?dist} Summary: Unified Histogram Interface for Python histogram libraries License: BSD-3-Clause URL: https://github.com/scikit-hep/uhi Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: uhi defines the PlottableHistogram protocol, a minimal typing interface that histogram producers (boost-histogram, NumPy, uproot, ...) and consumers (mplhep, histoprint, ...) agree on, plus helpers to wrap a NumPy histogram tuple as a plottable object and a JSON schema for serialised histograms.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n %{pypi_name}-%{version} %generate_buildrequires # hatch-vcs reads the version from PKG-INFO in the sdist; pin it anyway. export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_buildrequires %build export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check # uhi.io.hdf5/root/uproot need h5py, ROOT and uproot, none of which uhi requires. %pyproject_check_import -e uhi.io.hdf5 -e uhi.io.root -e uhi.io.uproot cd / PYTHONPATH=%{buildroot}%{python3_sitelib} %{python3} -c ' import numpy as np from uhi.numpy_plottable import ensure_plottable_histogram h = ensure_plottable_histogram(np.histogram(np.arange(100), bins=10)) assert h.values().sum() == 100, h.values()' %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md %{_bindir}/uhi %changelog * Sun Oct 11 2026 Morgan Hough - 1.2.1-1 - Initial package, as a dependency of python-histoprint (babelbrain Step 1).