about summary refs log tree commit diff
path: root/pkgs/development/python-modules/energyflow
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2022-09-24 11:32:11 -0400
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2022-09-26 11:41:15 -0400
commit4d213f68566c87bafa01fbb2ec60b10c158b46aa (patch)
treebf930a95b266d88469a7b065e692e208097c3952 /pkgs/development/python-modules/energyflow
parentab6dd73dc6ad500137d4907e01d4a93551be728e (diff)
python3Packages.energyflow: init at 1.3.2
Diffstat (limited to 'pkgs/development/python-modules/energyflow')
-rw-r--r--pkgs/development/python-modules/energyflow/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/energyflow/default.nix b/pkgs/development/python-modules/energyflow/default.nix
new file mode 100644
index 0000000000000..44342d732eca9
--- /dev/null
+++ b/pkgs/development/python-modules/energyflow/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, h5py
+, numpy
+, six
+, wasserstein
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "EnergyFlow";
+  version = "1.3.2";
+
+  src = fetchFromGitHub {
+    owner = "pkomiske";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-fjT8c0ZTjdufP334upPzRVdTJDIBs84I7PkFu4CMcQw=";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.cfg \
+      --replace "setup_requires=" "" \
+      --replace "pytest-runner" ""
+  '';
+
+  propagatedBuildInputs = [
+    h5py
+    numpy
+    six
+    wasserstein
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+  pytestFlagsArray = [
+    "energyflow/tests"
+  ];
+  disabledTestPaths = [
+    "energyflow/tests/test_archs.py" # requires tensorflow
+    "energyflow/tests/test_emd.py" # requires "ot"
+  ];
+
+  pythonImportsCheck = [ "energyflow" ];
+
+  meta = with lib; {
+    description = "Python package for the EnergyFlow suite of tools";
+    homepage = "https://energyflow.network/";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}