Merge pull request #192781 from veprbl/pr/energyflow_init

This commit is contained in:
Martin Weinelt 2022-09-26 17:53:48 +02:00 committed by GitHub
commit dae204faa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 108 additions and 0 deletions

View File

@ -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 ];
};
}

View File

@ -0,0 +1,50 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, numpy
, llvmPackages
, wurlitzer
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "Wasserstein";
version = "1.1.0";
src = fetchFromGitHub {
owner = "pkomiske";
repo = pname;
rev = "89c2d6279a7e0aa3b56bcc8fb7b6009420f2563e"; # https://github.com/pkomiske/Wasserstein/issues/1
hash = "sha256-s9en6XwvO/WPsF7/+SEmGePHZQgl7zLgu5sEn4nD9YE=";
};
buildInputs = [
llvmPackages.openmp
];
propagatedBuildInputs = [
numpy
wurlitzer
];
checkInputs = [
pytestCheckHook
];
pytestFlagsArray = [
"wasserstein/tests"
];
disabledTestPaths = [
"wasserstein/tests/test_emd.py" # requires "ot"
# cyclic dependency on energyflow
"wasserstein/tests/test_externalemdhandler.py"
"wasserstein/tests/test_pairwiseemd.py"
];
pythonImportsCheck = [ "wasserstein" ];
meta = with lib; {
description = "Python/C++ library for computing Wasserstein distances efficiently";
homepage = "https://github.com/pkomiske/Wasserstein";
license = licenses.gpl3Only;
maintainers = with maintainers; [ veprbl ];
};
}

View File

@ -2948,6 +2948,8 @@ in {
enamlx = callPackage ../development/python-modules/enamlx { };
energyflow = callPackage ../development/python-modules/energyflow { };
enhancements = callPackage ../development/python-modules/enhancements { };
enlighten = callPackage ../development/python-modules/enlighten { };
@ -11647,6 +11649,8 @@ in {
wasabi = callPackage ../development/python-modules/wasabi { };
wasserstein = callPackage ../development/python-modules/wasserstein { };
wasm = callPackage ../development/python-modules/wasm { };
wasmerPackages = pkgs.recurseIntoAttrs (callPackage ../development/python-modules/wasmer { });