2023-02-22 10:55:15 +00:00
|
|
|
{ lib
|
2024-05-15 15:35:15 +00:00
|
|
|
, stdenv
|
2023-02-22 10:55:15 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
, pytest-xdist
|
2023-02-22 10:55:15 +00:00
|
|
|
, pytestCheckHook
|
2023-10-19 13:55:26 +00:00
|
|
|
, setuptools-scm
|
2023-02-22 10:55:15 +00:00
|
|
|
, fastprogress
|
|
|
|
, jax
|
|
|
|
, jaxlib
|
|
|
|
, jaxopt
|
|
|
|
, optax
|
|
|
|
, typing-extensions
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "blackjax";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.2.1";
|
2023-10-19 13:55:26 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "blackjax-devs";
|
2024-01-13 08:15:51 +00:00
|
|
|
repo = "blackjax";
|
2023-02-22 10:55:15 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-VoWBCjFMyE5LVJyf7du/pKlnvDHj22lguiP6ZUzH9ak=";
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2023-10-19 13:55:26 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2023-02-22 10:55:15 +00:00
|
|
|
fastprogress
|
|
|
|
jax
|
|
|
|
jaxlib
|
|
|
|
jaxopt
|
|
|
|
optax
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_benchmarks.py"
|
|
|
|
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
|
|
|
|
# Assertion errors on numerical values
|
|
|
|
"tests/mcmc/test_integrators.py"
|
|
|
|
];
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
disabledTests = [
|
|
|
|
# too slow
|
|
|
|
"test_adaptive_tempered_smc"
|
2024-05-15 15:35:15 +00:00
|
|
|
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
|
|
|
|
# Numerical test (AssertionError)
|
|
|
|
# https://github.com/blackjax-devs/blackjax/issues/668
|
|
|
|
"test_chees_adaptation"
|
2023-02-22 10:55:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"blackjax"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://blackjax-devs.github.io/blackjax";
|
|
|
|
description = "Sampling library designed for ease of use, speed and modularity";
|
2023-10-19 13:55:26 +00:00
|
|
|
changelog = "https://github.com/blackjax-devs/blackjax/releases/tag/${version}";
|
2023-02-22 10:55:15 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|