1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 cython,
7 fftw,
8 pandas,
9 scikit-learn,
10 numpy,
11 pip,
12 setuptools,
13 pytestCheckHook,
14 nix-update-script,
15}:
16
17buildPythonPackage rec {
18 pname = "mrsqm";
19 version = "4";
20 pyproject = true;
21
22 build-system = [
23 setuptools
24 ];
25
26 disabled = pythonOlder "3.8";
27
28 src = fetchFromGitHub {
29 owner = "mlgig";
30 repo = "mrsqm";
31 tag = "r${version}";
32 hash = "sha256-59f18zItV3K6tXcg1v1q2Z8HYrQB8T0ntaaqjxeAEbM=";
33 };
34
35 buildInputs = [ fftw ];
36
37 nativeBuildInputs = [ cython ];
38
39 dependencies = [
40 pandas
41 scikit-learn
42 numpy
43 pip
44 ];
45
46 postPatch = ''
47 substituteInPlace setup.py \
48 --replace-fail "setup_requires=['pytest-runner']," ""
49 substituteInPlace pyproject.toml \
50 --replace-fail "numpy==" "numpy>="
51 '';
52
53 preBuild = ''
54 export HOME=$(mktemp -d)
55 '';
56
57 nativeCheckInputs = [
58 pytestCheckHook
59 ];
60
61 enabledTestPaths = [
62 "tests/mrsqm"
63 ];
64
65 pythonImportsCheck = [ "mrsqm" ];
66
67 passthru.updateScript = nix-update-script {
68 extraArgs = [
69 "--version-regex"
70 "v\\.(.*)"
71 ];
72 };
73
74 meta = {
75 description = "MrSQM (Multiple Representations Sequence Miner) is a time series classifier";
76 homepage = "https://pypi.org/project/mrsqm";
77 changelog = "https://github.com/mlgig/mrsqm/releases/tag/v.${src.tag}";
78 license = lib.licenses.gpl3Only;
79 maintainers = with lib.maintainers; [ mbalatsko ];
80 };
81}