1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools,
7
8 cmdstanpy,
9 numpy,
10 matplotlib,
11 pandas,
12 holidays,
13 tqdm,
14 importlib-resources,
15
16 dask,
17 distributed,
18
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "prophet";
24 version = "1.1.5";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "facebook";
31 repo = "prophet";
32 rev = version;
33 hash = "sha256-liTg5Hm+FPpRQajBnnJKBh3JPGyu0Hflntf0isj1FiQ=";
34 };
35
36 sourceRoot = "${src.name}/python";
37
38 env.PROPHET_REPACKAGE_CMDSTAN = "false";
39
40 nativeBuildInputs = [ setuptools ];
41
42 propagatedBuildInputs = [
43 cmdstanpy
44 numpy
45 matplotlib
46 pandas
47 holidays
48 tqdm
49 importlib-resources
50 ];
51
52 passthru.optional-dependencies.parallel = [
53 dask
54 distributed
55 ] ++ dask.optional-dependencies.dataframe;
56
57 preCheck = ''
58 # use the generated files from $out for testing
59 mv prophet/tests .
60 rm -r prophet
61 '';
62
63 nativeCheckInputs = [ pytestCheckHook ];
64
65 pythonImportsCheck = [ "prophet" ];
66
67 meta = {
68 changelog = "https://github.com/facebook/prophet/releases/tag/${src.rev}";
69 description = "A tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth";
70 homepage = "https://facebook.github.io/prophet/";
71 license = lib.licenses.mit;
72 maintainers = with lib.maintainers; [ tomasajt ];
73 };
74}