mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-11-28 00:40:33 +00:00
62 lines
1.5 KiB
Nix
62 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
fetchpatch,
|
|
cython,
|
|
numpy,
|
|
# Check Inputs
|
|
pytestCheckHook,
|
|
python,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "fastdtw";
|
|
version = "0.3.4";
|
|
format = "setuptools";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "slaypni";
|
|
repo = "fastdtw";
|
|
rev = "v${version}";
|
|
hash = "sha256-vJ0SFrI5Spc7VPbLtkHkSmiUkMInsUjwcec6qEgvLEc=";
|
|
};
|
|
|
|
patches = [
|
|
# Removes outdated cythonized C++ file, which doesn't match CPython. Will be auto-used if left.
|
|
# Remove when PR 40 merged
|
|
(fetchpatch {
|
|
url = "https://patch-diff.githubusercontent.com/raw/slaypni/fastdtw/pull/40.patch";
|
|
hash = "sha256-OFF17ziMVeotnN4ddVC4TBfEHM8pzcfFsGEugiBQVXY=";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
propagatedBuildInputs = [ numpy ];
|
|
|
|
pythonImportsCheck = [ "fastdtw.fastdtw" ];
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
preCheck = ''
|
|
echo "Temporarily moving tests to $OUT to find cython modules"
|
|
export PACKAGEDIR=$out/${python.sitePackages}
|
|
cp -r $TMP/source/tests $PACKAGEDIR
|
|
pushd $PACKAGEDIR
|
|
'';
|
|
postCheck = ''
|
|
rm -rf tests
|
|
popd
|
|
'';
|
|
|
|
meta = {
|
|
description = "Python implementation of FastDTW (Dynamic Time Warping)";
|
|
longDescription = ''
|
|
FastDTW is an approximate Dynamic Time Warping (DTW) algorithm that provides
|
|
optimal or near-optimal alignments with an O(N) time and memory complexity.
|
|
'';
|
|
homepage = "https://github.com/slaypni/fastdtw";
|
|
license = lib.licenses.mit;
|
|
maintainers = [ ];
|
|
};
|
|
}
|