diff --git a/pkgs/development/python-modules/scikits-odes-core/default.nix b/pkgs/development/python-modules/scikits-odes-core/default.nix new file mode 100644 index 000000000000..2ad7ba3ff35e --- /dev/null +++ b/pkgs/development/python-modules/scikits-odes-core/default.nix @@ -0,0 +1,35 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, +}: + +buildPythonPackage rec { + pname = "scikits-odes-core"; + version = "3.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "bmcage"; + repo = "odes"; + tag = "v${version}"; + hash = "sha256-wOdqRzj45piT9P+qA0xXBCnOZ9Xh+Waej2t51mDcilc="; + }; + + sourceRoot = "${src.name}/packages/scikits-odes-core"; + + build-system = [ setuptools ]; + + pythonImportsCheck = [ "scikits_odes_core" ]; + + # no tests + doCheck = false; + + meta = { + description = "Core support module for scikits-odes"; + homepage = "https://github.com/bmcage/odes/blob/master/packages/scikits-odes-core"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ idontgetoutmuch ]; + }; +} diff --git a/pkgs/development/python-modules/scikits-odes-daepack/default.nix b/pkgs/development/python-modules/scikits-odes-daepack/default.nix new file mode 100644 index 000000000000..228f1c007e7e --- /dev/null +++ b/pkgs/development/python-modules/scikits-odes-daepack/default.nix @@ -0,0 +1,37 @@ +{ + buildPythonPackage, + gfortran, + meson-python, + numpy, + scikits-odes-core, +}: + +buildPythonPackage rec { + inherit (scikits-odes-core) version src; + pname = "scikits-odes-daepack"; + pyproject = true; + + sourceRoot = "${src.name}/packages/scikits-odes-daepack"; + + build-system = [ + meson-python + numpy + ]; + + nativeBuildInputs = [ gfortran ]; + + dependencies = [ + numpy + scikits-odes-core + ]; + + pythonImportsCheck = [ "scikits_odes_daepack" ]; + + # no tests + doCheck = false; + + meta = scikits-odes-core.meta // { + description = "Wrapper around daepack"; + homepage = "https://github.com/bmcage/odes/blob/master/packages/scikits-odes-daepack"; + }; +} diff --git a/pkgs/development/python-modules/scikits-odes-sundials/default.nix b/pkgs/development/python-modules/scikits-odes-sundials/default.nix new file mode 100644 index 000000000000..42deba278c19 --- /dev/null +++ b/pkgs/development/python-modules/scikits-odes-sundials/default.nix @@ -0,0 +1,41 @@ +{ + buildPythonPackage, + sundials, + cython, + numpy, + pkgconfig, + setuptools, + scikits-odes-core, + pytestCheckHook, +}: + +buildPythonPackage rec { + inherit (scikits-odes-core) version src; + pname = "scikits-odes-sundials"; + pyproject = true; + + sourceRoot = "${src.name}/packages/scikits-odes-sundials"; + + build-system = [ + cython + numpy + pkgconfig + setuptools + ]; + + buildInputs = [ sundials ]; + + dependencies = [ + numpy + scikits-odes-core + ]; + + pythonImportsCheck = [ "scikits_odes_sundials" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + meta = scikits-odes-core.meta // { + description = "Sundials wrapper module for scikits-odes"; + homepage = "https://github.com/bmcage/odes/blob/master/packages/scikits-odes-sundials"; + }; +} diff --git a/pkgs/development/python-modules/scikits-odes/default.nix b/pkgs/development/python-modules/scikits-odes/default.nix index f9695701602c..43da95710011 100644 --- a/pkgs/development/python-modules/scikits-odes/default.nix +++ b/pkgs/development/python-modules/scikits-odes/default.nix @@ -1,59 +1,42 @@ { lib, + stdenv, buildPythonPackage, - fetchPypi, - pythonAtLeast, - cython, - enum34, - gfortran, - isPy27, - isPy3k, - numpy, - pytest, - python, + setuptools, scipy, - sundials, + scikits-odes-core, + scikits-odes-daepack, + scikits-odes-sundials, + pytestCheckHook, }: buildPythonPackage rec { + inherit (scikits-odes-core) version src; pname = "scikits.odes"; - version = "2.7.0"; + pyproject = true; - # https://github.com/bmcage/odes/issues/130 - disabled = isPy27 || pythonAtLeast "3.12"; + sourceRoot = "${src.name}/packages/scikits-odes"; - src = fetchPypi { - inherit pname version; - hash = "sha256-px4Z4UhYk3VK6MBQZoIy/MaU8XuDYC51++v3v5+XXh4="; - }; + build-system = [ setuptools ]; - nativeBuildInputs = [ - gfortran - cython + dependencies = [ + scipy + scikits-odes-core + scikits-odes-daepack + scikits-odes-sundials ]; - propagatedBuildInputs = [ - numpy - sundials - scipy - ] ++ lib.optionals (!isPy3k) [ enum34 ]; + pythonImportsCheck = [ "scikits_odes" ]; - nativeCheckInputs = [ pytest ]; + nativeCheckInputs = [ pytestCheckHook ]; - checkPhase = '' - cd $out/${python.sitePackages}/scikits/odes/tests - pytest - ''; + disabledTests = lib.optionals stdenv.hostPlatform.isAarch64 [ + # skip on aarch64, see https://github.com/bmcage/odes/issues/101 + "test_lsodi" + ]; - meta = with lib; { + meta = scikits-odes-core.meta // { description = "Scikit offering extra ode/dae solvers, as an extension to what is available in scipy"; - homepage = "https://github.com/bmcage/odes"; - license = licenses.bsd3; - maintainers = with maintainers; [ idontgetoutmuch ]; - platforms = [ - "aarch64-linux" - "x86_64-linux" - "x86_64-darwin" - ]; + homepage = "https://github.com/bmcage/odes/blob/master/packages/scikits-odes"; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 26bbf39aeb74..7b7d457f5790 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14488,6 +14488,12 @@ self: super: with self; { scikits-odes = callPackage ../development/python-modules/scikits-odes { }; + scikits-odes-core = callPackage ../development/python-modules/scikits-odes-core { }; + + scikits-odes-daepack = callPackage ../development/python-modules/scikits-odes-daepack { }; + + scikits-odes-sundials = callPackage ../development/python-modules/scikits-odes-sundials { }; + scikit-tda = callPackage ../development/python-modules/scikit-tda { }; scipy = callPackage ../development/python-modules/scipy { };