2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-08-22 20:05:09 +00:00
|
|
|
, pythonOlder
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchPypi
|
|
|
|
, jax
|
|
|
|
, jaxlib
|
|
|
|
, multipledispatch
|
|
|
|
, numpy
|
2023-08-22 20:05:09 +00:00
|
|
|
, tqdm
|
|
|
|
, funsor
|
2022-06-16 17:23:12 +00:00
|
|
|
, pytestCheckHook
|
2023-10-09 19:29:22 +00:00
|
|
|
# TODO: uncomment when tensorflow-probability gets fixed.
|
|
|
|
# , tensorflow-probability
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "numpyro";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.13.2";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version pname;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-Um8LFVGAlMeOaN9uMwycHJzqEnTaxp8FYXIk+m2VTug=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jax
|
|
|
|
jaxlib
|
|
|
|
multipledispatch
|
2023-08-22 20:05:09 +00:00
|
|
|
numpy
|
2022-06-16 17:23:12 +00:00
|
|
|
tqdm
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
funsor
|
2022-06-16 17:23:12 +00:00
|
|
|
pytestCheckHook
|
2023-10-09 19:29:22 +00:00
|
|
|
# TODO: uncomment when tensorflow-probability gets fixed.
|
|
|
|
# tensorflow-probability
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"numpyro"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# AssertionError due to tolerance issues
|
|
|
|
"test_beta_binomial_log_prob"
|
|
|
|
"test_collapse_beta"
|
|
|
|
"test_cpu"
|
|
|
|
"test_gamma_poisson"
|
|
|
|
"test_gof"
|
|
|
|
"test_hpdi"
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_kl_dirichlet_dirichlet"
|
2022-06-16 17:23:12 +00:00
|
|
|
"test_kl_univariate"
|
|
|
|
"test_mean_var"
|
|
|
|
# Tests want to download data
|
|
|
|
"data_load"
|
|
|
|
"test_jsb_chorales"
|
2023-05-24 13:37:59 +00:00
|
|
|
# RuntimeWarning: overflow encountered in cast
|
|
|
|
"test_zero_inflated_logits_probs_agree"
|
|
|
|
# NameError: unbound axis name: _provenance
|
|
|
|
"test_model_transformation"
|
2024-02-29 20:09:43 +00:00
|
|
|
# Using deprecated (removed in jax==0.4.24) jax.core.safe_map
|
|
|
|
# https://github.com/pyro-ppl/numpyro/issues/1733
|
|
|
|
"test_beta_bernoulli"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# TODO: remove when tensorflow-probability gets fixed.
|
|
|
|
disabledTestPaths = [
|
|
|
|
"test/test_distributions.py"
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for probabilistic programming with NumPy";
|
|
|
|
homepage = "https://num.pyro.ai/";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/pyro-ppl/numpyro/releases/tag/${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|