From d35e9da8857b915c8a985e32408016af371cf66d Mon Sep 17 00:00:00 2001 From: Yuri Victorovich Date: Fri, 5 Jun 2026 10:51:44 -0700 Subject: [PATCH] math/py-numdifftools: New port: Solver of automatic numerical differentiation problems --- math/Makefile | 1 + math/py-numdifftools/Makefile | 30 ++++++++++++++++++++++++++++++ math/py-numdifftools/distinfo | 3 +++ math/py-numdifftools/pkg-descr | 5 +++++ 4 files changed, 39 insertions(+) create mode 100644 math/py-numdifftools/Makefile create mode 100644 math/py-numdifftools/distinfo create mode 100644 math/py-numdifftools/pkg-descr diff --git a/math/Makefile b/math/Makefile index 75e93400324b..212831cb5709 100644 --- a/math/Makefile +++ b/math/Makefile @@ -1068,6 +1068,7 @@ SUBDIR += py-nevergrad SUBDIR += py-nlopt SUBDIR += py-numba-stats + SUBDIR += py-numdifftools SUBDIR += py-numexpr SUBDIR += py-numpoly SUBDIR += py-numpy diff --git a/math/py-numdifftools/Makefile b/math/py-numdifftools/Makefile new file mode 100644 index 000000000000..2dfa966daffd --- /dev/null +++ b/math/py-numdifftools/Makefile @@ -0,0 +1,30 @@ +PORTNAME= numdifftools +DISTVERSION= 0.9.42 +CATEGORIES= math python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Solver for automatic numerical differentiation problems +WWW= https://github.com/pbrod/numdifftools/ + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE.txt + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pdm-backend>0:devel/py-pdm-backend@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>=1.21.2:math/py-numpy@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}scipy>=1.7.3:science/py-scipy@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hypothesis>=3.6:devel/py-hypothesis@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}statsmodels>=0.6:math/py-statsmodels@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist pep517 pytest + +NO_ARCH= yes + +TEST_ENV= ${MAKE_ENV} MPLBACKEND=Agg PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} +PYTEST_ARGS= --override-ini=addopts= src/numdifftools/tests/ + +# tests as of 0.9.42: 116 passed, 28 skipped, 242 warnings in 12.80s + +.include diff --git a/math/py-numdifftools/distinfo b/math/py-numdifftools/distinfo new file mode 100644 index 000000000000..6da6108ca231 --- /dev/null +++ b/math/py-numdifftools/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1780681268 +SHA256 (numdifftools-0.9.42.tar.gz) = 866675171f293c4bf2f1e1c5bf9b88a07d5396903e3b3e7fcc3879e2a01cfbc1 +SIZE (numdifftools-0.9.42.tar.gz) = 79612 diff --git a/math/py-numdifftools/pkg-descr b/math/py-numdifftools/pkg-descr new file mode 100644 index 000000000000..08bc636c0e24 --- /dev/null +++ b/math/py-numdifftools/pkg-descr @@ -0,0 +1,5 @@ +Numdifftools is a suite of tools written in Python to solve automatic +numerical differentiation problems in one or more variables. It +provides functions for calculating derivatives, Jacobians, Hessians, +and gradients, all with error estimates. The methods are based on +the complex-step derivative approximation and extrapolation algorithms.