mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-11-27 08:20:13 +00:00
65 lines
1.2 KiB
Nix
65 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
setuptools,
|
|
|
|
# dependencies
|
|
numpy,
|
|
|
|
# optional-dependencies
|
|
matplotlib,
|
|
scipy,
|
|
|
|
# tests
|
|
python,
|
|
writableTmpDirAsHomeHook,
|
|
}:
|
|
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "cma";
|
|
version = "4.5.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "CMA-ES";
|
|
repo = "pycma";
|
|
tag = "r${finalAttrs.version}";
|
|
hash = "sha256-54atJuPFTczLN4piSLh84+W0GKJ1u/LgurZZpRrQZe4=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [ numpy ];
|
|
|
|
optional-dependencies = {
|
|
plotting = [ matplotlib ];
|
|
statistical-tests = [ scipy ];
|
|
};
|
|
|
|
pythonImportsCheck = [ "cma" ];
|
|
|
|
nativeCheckInputs = [
|
|
writableTmpDirAsHomeHook
|
|
]
|
|
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
|
|
${python.executable} -m cma.test
|
|
|
|
runHook postCheck
|
|
'';
|
|
|
|
meta = {
|
|
description = "Library for Covariance Matrix Adaptation Evolution Strategy for non-linear numerical optimization";
|
|
homepage = "https://github.com/CMA-ES/pycma";
|
|
changelog = "https://github.com/CMA-ES/pycma/releases/tag/${finalAttrs.src.tag}";
|
|
license = lib.licenses.bsd3;
|
|
maintainers = [ ];
|
|
};
|
|
})
|