76e2a397c2
This treewide change targets Python packages that specifies pytest flags with pytestFlagsArray, and whose flags cannot be consructed by other pytestCheckHook-honoured arguments. Use the __structuredAttrs-agnostic argument pytestFlags instead of the deprecated pytestFlagsArray. For flags with option arguments, join each flag and their option argument into a single command-line argument following POSIX Utility Argument Syntax[1] for easier overriding (remove/replace). Examples: * [ "-W" "ignore:message:WarningClass" ] -> [ "-Wignore:message:WarningClass" ] * [ "--reruns" "3" ] -> [ "--reruns=3" ] [1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
96 lines
1.9 KiB
Nix
96 lines
1.9 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.5";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "blackjax-devs";
|
|
repo = "blackjax";
|
|
tag = version;
|
|
hash = "sha256-2GTjKjLIWFaluTjdWdUF9Iim973y81xv715xspghRZI=";
|
|
};
|
|
|
|
build-system = [ setuptools-scm ];
|
|
|
|
dependencies = [
|
|
fastprogress
|
|
jax
|
|
jaxlib
|
|
jaxopt
|
|
optax
|
|
typing-extensions
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
pytest-xdist
|
|
];
|
|
|
|
pytestFlags = [
|
|
# DeprecationWarning: JAXopt is no longer maintained
|
|
"-Wignore::DeprecationWarning"
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
"tests/test_benchmarks.py"
|
|
|
|
# Assertion errors on numerical values
|
|
"tests/mcmc/test_integrators.py"
|
|
];
|
|
|
|
disabledTests =
|
|
[
|
|
# too slow
|
|
"test_adaptive_tempered_smc"
|
|
|
|
# AssertionError on numerical values
|
|
"test_barker"
|
|
"test_mclmc"
|
|
"test_mcse4"
|
|
"test_normal_univariate"
|
|
"test_nuts__with_device"
|
|
"test_nuts__with_jit"
|
|
"test_nuts__without_device"
|
|
"test_nuts__without_jit"
|
|
"test_smc_waste_free__with_jit"
|
|
]
|
|
++ 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 ];
|
|
};
|
|
}
|