1{ lib
2, buildPythonPackage
3, cmake
4, fetchFromGitHub
5, isPy3k
6, pytestCheckHook
7, nbconvert
8, joblib
9, jupyter
10, jupyter-client
11, numpy
12, scipy
13, pandas
14, matplotlib
15, ninja
16, numba
17, pybind11
18, scikit-build
19}:
20
21buildPythonPackage rec {
22 pname = "phik";
23 version = "0.12.3";
24 disabled = !isPy3k;
25 format = "pyproject";
26
27 src = fetchFromGitHub {
28 owner = "KaveIO";
29 repo = "PhiK";
30 rev = "refs/tags/v${version}";
31 hash = "sha256-9o3EDhgmne2J1QfzjjNQc1mUcyCzoVrCnWXqjWkiZU0=";
32 };
33
34 nativeCheckInputs = [
35 pytestCheckHook
36 nbconvert
37 jupyter
38 jupyter-client
39 ];
40
41 propagatedBuildInputs = [
42 joblib
43 numpy
44 scipy
45 pandas
46 matplotlib
47 numba
48 pybind11
49 ];
50
51 # uses setuptools to drive build process
52 dontUseCmakeConfigure = true;
53
54 nativeBuildInputs = [
55 cmake
56 ninja
57 scikit-build
58 ];
59
60 pythonImportsCheck = [ "phik" ];
61
62 postInstall = ''
63 rm -r $out/bin
64 '';
65
66 preCheck = ''
67 # import from $out
68 rm -r phik
69 '';
70
71 meta = with lib; {
72 description = "Phi_K correlation analyzer library";
73 longDescription = "Phi_K is a new and practical correlation coefficient based on several refinements to Pearson’s hypothesis test of independence of two variables.";
74 homepage = "https://phik.readthedocs.io/en/latest/";
75 changelog = "https://github.com/KaveIO/PhiK/blob/${src.rev}/CHANGES.rst";
76 maintainers = with maintainers; [ melsigl ];
77 license = licenses.asl20;
78 };
79}