2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
matplotlib,
|
|
|
|
niapy,
|
|
|
|
numpy,
|
|
|
|
poetry-core,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
scikit-learn,
|
|
|
|
toml-adapt,
|
|
|
|
tomli,
|
|
|
|
torch,
|
2023-03-15 16:39:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "nianet";
|
|
|
|
version = "1.1.4";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SasoPavlic";
|
2024-01-25 14:12:00 +00:00
|
|
|
repo = "nianet";
|
|
|
|
rev = "refs/tags/version_${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-FZipl6Z9AfiL6WH0kvUn8bVxt8JLdDVlmTSqnyxe0nY=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2024-01-25 14:12:00 +00:00
|
|
|
toml-adapt
|
2023-03-15 16:39:30 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeCheckInputs = [
|
2023-03-15 16:39:30 +00:00
|
|
|
pytestCheckHook
|
2024-01-25 14:12:00 +00:00
|
|
|
tomli
|
2023-03-15 16:39:30 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "nianet" ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|