1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 stdenv,
6 pythonOlder,
7 requests,
8 numpy,
9 pandas,
10 scipy,
11 statsmodels,
12 patsy,
13 scikit-learn,
14 tqdm,
15 dask,
16 distributed,
17 stumpy,
18 cloudpickle,
19 pytestCheckHook,
20 pytest-xdist,
21 mock,
22 matplotlib,
23 seaborn,
24 ipython,
25 notebook,
26 pandas-datareader,
27}:
28
29buildPythonPackage rec {
30 pname = "tsfresh";
31 version = "0.20.3";
32 pyproject = true;
33
34 disabled = pythonOlder "3.7";
35
36 src = fetchFromGitHub {
37 owner = "blue-yonder";
38 repo = "tsfresh";
39 rev = "refs/tags/v${version}";
40 hash = "sha256-Lw70PDiRVPiTzpnbfKSo7jjfBitCePSy15QL0z7+bMg=";
41 };
42
43 patches = [
44 # The pyscaffold is not a build dependency but just a python project bootstrapping tool, so we do not need it
45 ./remove-pyscaffold.patch
46 ./remove-pytest-coverage-flags.patch
47 ];
48
49 dependencies = [
50 requests
51 numpy
52 pandas
53 scipy
54 statsmodels
55 patsy
56 scikit-learn
57 tqdm
58 dask
59 distributed
60 stumpy
61 cloudpickle
62 ] ++ dask.optional-dependencies.dataframe;
63
64 nativeCheckInputs = [
65 pytestCheckHook
66 pytest-xdist
67 mock
68 matplotlib
69 seaborn
70 ipython
71 notebook
72 pandas-datareader
73 ];
74
75 disabledTests =
76 [
77 # touches network
78 "test_relevant_extraction"
79 "test_characteristics_downloaded_robot_execution_failures"
80 "test_index"
81 "test_binary_target_is_default"
82 "test_characteristics_downloaded_robot_execution_failures"
83 "test_extraction_runs_through"
84 "test_multilabel_target_on_request"
85 ]
86 ++ lib.optionals stdenv.hostPlatform.isDarwin [
87 # RuntimeError: Cluster failed to start: [Errno 1] Operation not permitted
88 # may require extra privileges on darwin
89 "test_local_dask_cluster_extraction_one_worker"
90 "test_local_dask_cluster_extraction_two_worker"
91 "test_dask_cluster_extraction_one_worker"
92 "test_dask_cluster_extraction_two_workers"
93 ];
94
95 pythonImportsCheck = [ "tsfresh" ];
96
97 meta = {
98 description = "Automatic extraction of relevant features from time series";
99 mainProgram = "run_tsfresh";
100 homepage = "https://github.com/blue-yonder/tsfresh";
101 changelog = "https://github.com/blue-yonder/tsfresh/blob/${src.rev}/CHANGES.rst";
102 license = lib.licenses.mit;
103 maintainers = with lib.maintainers; [ mbalatsko ];
104 };
105}