1{ lib
2, buildPythonPackage
3, cmake
4, fetchFromGitHub
5, joblib
6, jupyter
7, jupyter-client
8, matplotlib
9, nbconvert
10, ninja
11, numba
12, numpy
13, pandas
14, pybind11
15, pytestCheckHook
16, pythonOlder
17, scikit-build
18, scipy
19, setuptools
20}:
21
22buildPythonPackage rec {
23 pname = "phik";
24 version = "0.12.3";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "KaveIO";
31 repo = "PhiK";
32 rev = "refs/tags/v${version}";
33 hash = "sha256-9o3EDhgmne2J1QfzjjNQc1mUcyCzoVrCnWXqjWkiZU0=";
34 };
35
36 nativeBuildInputs = [
37 cmake
38 ninja
39 scikit-build
40 setuptools
41 ];
42
43 propagatedBuildInputs = [
44 joblib
45 numpy
46 scipy
47 pandas
48 matplotlib
49 numba
50 pybind11
51 ];
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 nbconvert
56 jupyter
57 jupyter-client
58 ];
59
60 # Uses setuptools to drive build process
61 dontUseCmakeConfigure = true;
62
63 pythonImportsCheck = [
64 "phik"
65 ];
66
67 postInstall = ''
68 rm -r $out/bin
69 '';
70
71 preCheck = ''
72 # import from $out
73 rm -r phik
74 '';
75
76 disabledTests = [
77 # TypeError: 'numpy.float64' object cannot be interpreted as an integer
78 # https://github.com/KaveIO/PhiK/issues/73
79 "test_significance_matrix_hybrid"
80 "test_significance_matrix_mc"
81 ];
82
83 disabledTestPaths = [
84 # Don't test integrations
85 "tests/phik_python/integration/"
86 ];
87
88 meta = with lib; {
89 description = "Phi_K correlation analyzer library";
90 longDescription = ''
91 Phi_K is a new and practical correlation coefficient based on several refinements to
92 Pearson’s hypothesis test of independence of two variables.
93 '';
94 homepage = "https://phik.readthedocs.io/";
95 changelog = "https://github.com/KaveIO/PhiK/blob/${version}/CHANGES.rst";
96 license = licenses.asl20;
97 maintainers = with maintainers; [ melsigl ];
98 };
99}