about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/seasonal/default.nix
blob: d38559ff2eed23efd35590a828bcd5479d816c0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, numpy
, scipy
, pandas
, matplotlib
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "seasonal";
  version = "0.3.1";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "welch";
    repo = "seasonal";
    # There are no tags or releases, but this commit corresponds to the 0.3.1 version
    # PyPI project contains only a wheel
    rev = "2a2396014d46283d0c7aff34cde5dafb6c462c58";
    hash = "sha256-8YedGylH70pI0OyefiS1PG1yc+sg+tchlgcuNvxcNqE=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace 'setup_requires=["pytest-runner"],' ""
  '';

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    numpy
    scipy
  ];

  passthru.optional-dependencies = {
    csv = [
      pandas
    ];
    plot = [
      matplotlib
    ];
  };

  pythonImportsCheck = [ "seasonal" "seasonal.trend" "seasonal.periodogram" ];
  nativeCheckInputs = [
    pytestCheckHook
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  meta = with lib; {
    description = "Robustly estimate trend and periodicity in a timeseries";
    homepage = "https://github.com/welch/seasonal";
    license = licenses.mit;
    maintainers = with maintainers; [ mbalatsko ];
  };
}