# pwlf -- piecewise linear fits with a chosen number of segments (breakpoints # found by differential evolution or given). New to Fedora. babelbrain's Step 2 # (TranscranialModeling/BabelIntegrationBASE) imports it unconditionally for # the skull property mappings, so no acoustic simulation runs without it. %global pypi_name pwlf Name: python-%{pypi_name} Version: 2.7.0 Release: 1%{?dist} Summary: Fit piecewise linear functions to data License: MIT URL: https://github.com/cjekel/piecewise_linear_fit_py Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: pwlf fits continuous piecewise linear functions to 1-D data: given the number of line segments it finds the breakpoint locations (differential evolution), or fits the segments for breakpoints you supply, with least-squares and weighted variants, prediction, derivatives, standard errors and p-values.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check %pyproject_check_import cd / # One segment through y = 2x + 1 must recover the slope and intercept. PYTHONPATH=%{buildroot}%{python3_sitelib} %{python3} -c ' import numpy as np, pwlf x = np.linspace(0.0, 10.0, 50) m = pwlf.PiecewiseLinFit(x, 2.0 * x + 1.0) m.fit_with_breaks([0.0, 10.0]) assert abs(m.predict([5.0])[0] - 11.0) < 1e-6, m.predict([5.0]) assert abs(m.slopes[0] - 2.0) < 1e-6, m.slopes' %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md %changelog * Sun Oct 11 2026 Morgan Hough - 2.7.0-1 - Initial package, for babelbrain Step 2.