git: 7f5de1c96510 - main - math/py-pwlf: New port: Fit piecewise linear functions to data

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 25 Apr 2025 03:22:30 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7f5de1c96510eb8298bea4da91d8fda62afe95bd

commit 7f5de1c96510eb8298bea4da91d8fda62afe95bd
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-04-24 14:11:22 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-04-25 03:22:25 +0000

    math/py-pwlf: New port: Fit piecewise linear functions to data
---
 math/Makefile          |  1 +
 math/py-pwlf/Makefile  | 30 ++++++++++++++++++++++++++++++
 math/py-pwlf/distinfo  |  3 +++
 math/py-pwlf/pkg-descr |  3 +++
 4 files changed, 37 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index 0f652ce2441b..9a06b9741f75 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1057,6 +1057,7 @@
     SUBDIR += py-pplpy
     SUBDIR += py-primecountpy
     SUBDIR += py-primme
+    SUBDIR += py-pwlf
     SUBDIR += py-py-find-1st
     SUBDIR += py-pyFFTW
     SUBDIR += py-pyaudi
diff --git a/math/py-pwlf/Makefile b/math/py-pwlf/Makefile
new file mode 100644
index 000000000000..841f572af021
--- /dev/null
+++ b/math/py-pwlf/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	pwlf
+DISTVERSION=	2.5.1
+CATEGORIES=	math
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Fit piecewise linear functions to data
+WWW=		https://github.com/cjekel/piecewise_linear_fit_py
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	${PYNUMPY} \
+		${PYTHON_PKGNAMEPREFIX}scipy>=1.8.0:science/py-scipy@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	distutils autoplist
+
+NO_ARCH=	yes
+
+TEST_ENV=	${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+TEST_WRKSRC=	${WRKSRC}/tests
+
+do-test:
+	@cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} tests.py
+
+# tests as of 2.5.1: Ran 62 tests in 63.140s
+
+.include <bsd.port.mk>
diff --git a/math/py-pwlf/distinfo b/math/py-pwlf/distinfo
new file mode 100644
index 000000000000..f89e972e87b7
--- /dev/null
+++ b/math/py-pwlf/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1745528718
+SHA256 (pwlf-2.5.1.tar.gz) = d60cade349682df4c1c8952e0a8761afdb1aca601718c253ae11d6add0799a6d
+SIZE (pwlf-2.5.1.tar.gz) = 21890
diff --git a/math/py-pwlf/pkg-descr b/math/py-pwlf/pkg-descr
new file mode 100644
index 000000000000..25e1c5e1ba68
--- /dev/null
+++ b/math/py-pwlf/pkg-descr
@@ -0,0 +1,3 @@
+pwlf is a Python library for fitting continuous piecewise linear functions
+to data.
+Just specify the number of line segments you desire and provide the data.