From 5e6b138f309e3b598ef7aa7e71a42c7455323bb0 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Wed, 20 Sep 2023 12:24:04 -0700 Subject: [PATCH] python3Packages.seasonal: init at 0.3.1 --- .../python-modules/seasonal/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/python-modules/seasonal/default.nix diff --git a/pkgs/development/python-modules/seasonal/default.nix b/pkgs/development/python-modules/seasonal/default.nix new file mode 100644 index 000000000000..6e527407fc2e --- /dev/null +++ b/pkgs/development/python-modules/seasonal/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, numpy +, scipy +, pandas +, matplotlib +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "seasonal"; + version = "0.3.1"; + pyproject = true; + + disable = 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a9863e844878..ecb759dba512 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11701,6 +11701,8 @@ self: super: with self; { python3 = self.python; }); + seasonal = callPackage ../development/python-modules/seasonal { }; + seatconnect = callPackage ../development/python-modules/seatconnect { }; seccomp = callPackage ../development/python-modules/seccomp { };