depot/third_party/nixpkgs/pkgs/development/python-modules/nianet/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

63 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
matplotlib,
niapy,
numpy,
poetry-core,
pytestCheckHook,
pythonOlder,
scikit-learn,
toml-adapt,
tomli,
torch,
}:
buildPythonPackage rec {
pname = "nianet";
version = "1.1.4";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "SasoPavlic";
repo = "nianet";
rev = "refs/tags/version_${version}";
sha256 = "sha256-FZipl6Z9AfiL6WH0kvUn8bVxt8JLdDVlmTSqnyxe0nY=";
};
nativeBuildInputs = [
poetry-core
toml-adapt
];
propagatedBuildInputs = [
niapy
numpy
scikit-learn
torch
];
# create niapy and torch dep version consistent
preBuild = ''
toml-adapt -path pyproject.toml -a change -dep niapy -ver X
toml-adapt -path pyproject.toml -a change -dep torch -ver X
'';
nativeCheckInputs = [
pytestCheckHook
tomli
];
pythonImportsCheck = [ "nianet" ];
meta = with lib; {
description = "Designing and constructing neural network topologies using nature-inspired algorithms";
homepage = "https://github.com/SasoPavlic/NiaNet";
changelog = "https://github.com/SasoPavlic/NiaNet/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ firefly-cpp ];
};
}