depot/third_party/nixpkgs/pkgs/development/python-modules/blackjax/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

79 lines
1.6 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools-scm,
# dependencies
fastprogress,
jax,
jaxlib,
jaxopt,
optax,
typing-extensions,
# checks
pytestCheckHook,
pytest-xdist,
stdenv,
}:
buildPythonPackage rec {
pname = "blackjax";
version = "1.2.4";
pyproject = true;
src = fetchFromGitHub {
owner = "blackjax-devs";
repo = "blackjax";
rev = "refs/tags/${version}";
hash = "sha256-qaQBbRAKExRHr4Uhm5/Q1Ydon6ePsjG2PWbwSdR9QZM=";
};
build-system = [ setuptools-scm ];
dependencies = [
fastprogress
jax
jaxlib
jaxopt
optax
typing-extensions
];
nativeCheckInputs = [
pytestCheckHook
pytest-xdist
];
disabledTestPaths =
[ "tests/test_benchmarks.py" ]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# Assertion errors on numerical values
"tests/mcmc/test_integrators.py"
];
disabledTests =
[
# too slow
"test_adaptive_tempered_smc"
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# Numerical test (AssertionError)
# https://github.com/blackjax-devs/blackjax/issues/668
"test_chees_adaptation"
];
pythonImportsCheck = [ "blackjax" ];
meta = {
homepage = "https://blackjax-devs.github.io/blackjax";
description = "Sampling library designed for ease of use, speed and modularity";
changelog = "https://github.com/blackjax-devs/blackjax/releases/tag/${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ bcdarwin ];
};
}