2022-09-10 22:41:14 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
numpy,
|
|
|
|
poetry-core,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-01-14 12:53:10 +01:00
|
|
|
pname = "fireflyalgorithm";
|
2025-01-12 19:35:34 +08:00
|
|
|
version = "0.4.6";
|
2024-01-14 12:53:10 +01:00
|
|
|
pyproject = true;
|
2022-09-10 22:41:14 +02:00
|
|
|
|
2024-01-14 12:53:10 +01:00
|
|
|
disabled = pythonOlder "3.9";
|
2022-09-10 22:41:14 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "firefly-cpp";
|
2024-01-14 12:53:10 +01:00
|
|
|
repo = "FireflyAlgorithm";
|
2025-01-03 21:24:13 +01:00
|
|
|
tag = version;
|
2025-01-12 19:35:34 +08:00
|
|
|
hash = "sha256-NMmwjKtIk8KR0YXXSXkJhiQsbjMusaLnstUWx0izCNA=";
|
2022-09-10 22:41:14 +02:00
|
|
|
};
|
|
|
|
|
2025-01-12 19:35:34 +08:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail 'numpy = "^1.26.1"' ""
|
|
|
|
'';
|
2022-09-10 22:41:14 +02:00
|
|
|
|
2025-01-12 19:35:34 +08:00
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
|
|
dependencies = [ numpy ];
|
2022-09-10 22:41:14 +02:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-09-10 22:41:14 +02:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "fireflyalgorithm" ];
|
|
|
|
|
2025-01-12 19:35:34 +08:00
|
|
|
meta = {
|
2022-09-10 22:41:14 +02:00
|
|
|
description = "Implementation of the stochastic nature-inspired algorithm for optimization";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "firefly-algorithm";
|
2022-09-10 22:41:14 +02:00
|
|
|
homepage = "https://github.com/firefly-cpp/FireflyAlgorithm";
|
2022-12-28 18:28:15 +01:00
|
|
|
changelog = "https://github.com/firefly-cpp/FireflyAlgorithm/blob/${version}/CHANGELOG.md";
|
2025-01-12 19:35:34 +08:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ firefly-cpp ];
|
2022-09-10 22:41:14 +02:00
|
|
|
};
|
|
|
|
}
|