# histoprint -- pretty-prints NumPy (and other uhi-plottable) histograms to the # terminal. New to Fedora. babelbrain's Step 1 (BabelDatasetPreps) imports # text_hist and print_hist from it to show the CT/pseudo-CT intensity # histograms in its log, and the import is unconditional, so without this # package the planning mask cannot be computed at all. %global pypi_name histoprint Name: python-%{pypi_name} Version: 2.7.1 Release: 1%{?dist} Summary: Pretty print of NumPy (and other) histograms to the console License: MIT URL: https://github.com/scikit-hep/histoprint Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: histoprint renders one or more histograms as text in the terminal, stacked or side by side, with several character styles and colours, from NumPy histogram tuples or any object implementing the uhi PlottableHistogram protocol. It also installs a `histoprint` command that reads columns from a text file.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n %{pypi_name}-%{version} %generate_buildrequires 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 # histoprint.rich needs the optional `rich` package. %pyproject_check_import -e %{pypi_name}.rich cd / # The two functions babelbrain uses, on a NumPy histogram. PYTHONPATH=%{buildroot}%{python3_sitelib} %{python3} -c ' import numpy as np from histoprint import text_hist, print_hist import io, contextlib x = np.random.default_rng(0).normal(size=1000) buf = io.StringIO() with contextlib.redirect_stdout(buf): text_hist(x, bins=12, title="t") # data in, like np.histogram print_hist(np.histogram(x, bins=12)) # a histogram tuple in out = buf.getvalue() assert "t" in out and len(out.splitlines()) > 10, out print(out)' PYTHONPATH=%{buildroot}%{python3_sitelib} %{buildroot}%{_bindir}/histoprint --help | grep -q -i usage %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.rst CHANGELOG.md %{_bindir}/histoprint %changelog * Sun Oct 11 2026 Morgan Hough - 2.7.1-1 - Initial package, for babelbrain Step 1.