aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2025-04-24 14:11:22 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2025-04-25 03:22:25 +0000
commit7f5de1c96510eb8298bea4da91d8fda62afe95bd (patch)
tree3831d2c8687340129ac9b36bdb70c38b7966587c
parent64620e6d0d9975a199fed65dca89a20c91db67e0 (diff)
math/py-pwlf: New port: Fit piecewise linear functions to data
-rw-r--r--math/Makefile1
-rw-r--r--math/py-pwlf/Makefile30
-rw-r--r--math/py-pwlf/distinfo3
-rw-r--r--math/py-pwlf/pkg-descr3
4 files changed, 37 insertions, 0 deletions
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.