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