2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, numpy
|
|
|
|
, python
|
2022-11-02 22:02:43 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cma";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "3.3.0";
|
2022-11-02 22:02:43 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CMA-ES";
|
|
|
|
repo = "pycma";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/r${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-+UJI3hDVbDMfRF4bkwHED3eJCHzxS2hO4YPUzJqcoQI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2022-11-02 22:02:43 +00:00
|
|
|
# At least one doctest fails, thus only limited amount of files is tested
|
|
|
|
${python.executable} -m cma.test interfaces.py purecma.py logger.py optimization_tools.py transformations.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"cma"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-11-02 22:02:43 +00:00
|
|
|
description = "Library for Covariance Matrix Adaptation Evolution Strategy for non-linear numerical optimization";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/CMA-ES/pycma";
|
|
|
|
license = licenses.bsd3;
|
2022-11-02 22:02:43 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|