summary refs log tree commit diff
path: root/pkgs/development/python-modules/ecos
diff options
context:
space:
mode:
authorDrew Risinger <drewrisinger@users.noreply.github.com>2020-01-25 18:02:57 -0500
committerJon <jonringer@users.noreply.github.com>2020-02-18 19:28:23 -0800
commit3adda62dc3c80c7f6666c364b3c966a823f66eb5 (patch)
tree791d23d39c437c512e61a65bef9141ceddf59ef2 /pkgs/development/python-modules/ecos
parenta26f334e219d2b9a7d28b4a6c24442fe7204edb0 (diff)
downloadnixpkgs-3adda62dc3c80c7f6666c364b3c966a823f66eb5.tar
nixpkgs-3adda62dc3c80c7f6666c364b3c966a823f66eb5.tar.gz
nixpkgs-3adda62dc3c80c7f6666c364b3c966a823f66eb5.tar.bz2
nixpkgs-3adda62dc3c80c7f6666c364b3c966a823f66eb5.tar.lz
nixpkgs-3adda62dc3c80c7f6666c364b3c966a823f66eb5.tar.xz
nixpkgs-3adda62dc3c80c7f6666c364b3c966a823f66eb5.tar.zst
nixpkgs-3adda62dc3c80c7f6666c364b3c966a823f66eb5.zip
pythonPackages.ecos: init at 2.0.7.post1
Embedded cone solver interface for optimization problems in Python.
Dependency of qiskit-ignis.
Diffstat (limited to 'pkgs/development/python-modules/ecos')
-rw-r--r--pkgs/development/python-modules/ecos/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/ecos/default.nix b/pkgs/development/python-modules/ecos/default.nix
new file mode 100644
index 00000000000..6c07a5d485a
--- /dev/null
+++ b/pkgs/development/python-modules/ecos/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, pythonOlder
+, buildPythonPackage
+, fetchFromGitHub
+, pkgs
+, numpy
+, scipy
+  # check inputs
+, nose
+}:
+
+buildPythonPackage rec {
+  pname = "ecos";
+  version = "2.0.7.post1";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "embotech";
+    repo = "ecos-python";
+    rev = version;
+    sha256 = "1wzmamz2r4xr2zxgfwnm5q283185d1q6a7zn30vip18lxpys70z0";
+    fetchSubmodules = true;
+  };
+
+  prePatch = ''
+    echo '__version__ = "${version}"' >> ./src/ecos/version.py
+  '';
+
+  propagatedBuildInputs = [
+    numpy
+    scipy
+  ];
+
+  checkInputs = [ nose ];
+  checkPhase = ''
+    # Run tests
+    cd ./src
+    nosetests test_interface.py test_interface_bb.py
+  '';
+  pythonImportsCheck = [ "ecos" ];
+
+  meta = with lib; {
+    description = "Python package for ECOS: Embedded Cone Solver";
+    downloadPage = "https://github.com/embotech/ecos-python/releases";
+    homepage = pkgs.ecos.meta.homepage;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ drewrisinger ];
+  };
+}