1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, matplotlib
5, niapy
6, numpy
7, poetry-core
8, pytestCheckHook
9, pythonOlder
10, scikit-learn
11, toml-adapt
12, torch
13}:
14
15buildPythonPackage rec {
16 pname = "nianet";
17 version = "1.1.4";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "SasoPavlic";
24 repo = pname;
25 rev = "version_${version}";
26 sha256 = "sha256-FZipl6Z9AfiL6WH0kvUn8bVxt8JLdDVlmTSqnyxe0nY=";
27 };
28
29 nativeBuildInputs = [
30 toml-adapt
31 poetry-core
32 ];
33
34 propagatedBuildInputs = [
35 niapy
36 numpy
37 scikit-learn
38 torch
39 ];
40
41 # create niapy and torch dep version consistent
42 preBuild = ''
43 toml-adapt -path pyproject.toml -a change -dep niapy -ver X
44 toml-adapt -path pyproject.toml -a change -dep torch -ver X
45 '';
46
47 checkInputs = [
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [
52 "nianet"
53 ];
54
55 meta = with lib; {
56 description = "Designing and constructing neural network topologies using nature-inspired algorithms";
57 homepage = "https://github.com/SasoPavlic/NiaNet";
58 changelog = "https://github.com/SasoPavlic/NiaNet/releases/tag/v${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ firefly-cpp ];
61 };
62}