1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 h5py,
6 numpy,
7 six,
8 wasserstein,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "energyflow";
14 version = "1.3.3";
15
16 src = fetchFromGitHub {
17 owner = "pkomiske";
18 repo = "EnergyFlow";
19 rev = "refs/tags/v${version}";
20 hash = "sha256-Ioyk0IpyxcDdL2+3zkUa6yydavyphoh4do7GCz5nG60=";
21 };
22
23 postPatch = ''
24 substituteInPlace setup.cfg \
25 --replace "setup_requires=" "" \
26 --replace "pytest-runner" ""
27 '';
28
29 propagatedBuildInputs = [
30 h5py
31 numpy
32 six
33 wasserstein
34 ];
35
36 nativeCheckInputs = [ pytestCheckHook ];
37 pytestFlagsArray = [ "energyflow/tests" ];
38 disabledTestPaths = [
39 "energyflow/tests/test_archs.py" # requires tensorflow
40 "energyflow/tests/test_emd.py" # requires "ot"
41 ];
42
43 pythonImportsCheck = [ "energyflow" ];
44
45 meta = with lib; {
46 description = "Python package for the EnergyFlow suite of tools";
47 homepage = "https://energyflow.network/";
48 license = licenses.gpl3Only;
49 maintainers = with maintainers; [ veprbl ];
50 };
51}