2023-01-13 18:09:56 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-12-01 12:07:10 +00:00
|
|
|
stdenv,
|
2024-10-27 14:51:40 +00:00
|
|
|
arviz,
|
|
|
|
blackjax,
|
2023-01-13 18:09:56 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
formulae,
|
|
|
|
graphviz,
|
2024-10-27 14:51:40 +00:00
|
|
|
numpyro,
|
2023-01-13 18:09:56 +00:00
|
|
|
pandas,
|
|
|
|
pymc,
|
2023-10-25 05:45:06 +00:00
|
|
|
pytestCheckHook,
|
2024-10-27 14:51:40 +00:00
|
|
|
pythonOlder,
|
|
|
|
setuptools-scm,
|
2023-01-13 18:09:56 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bambi";
|
2024-10-27 14:51:40 +00:00
|
|
|
version = "0.14.0";
|
2023-10-11 04:56:41 +00:00
|
|
|
pyproject = true;
|
2023-06-07 23:09:13 +00:00
|
|
|
|
2024-10-27 14:51:40 +00:00
|
|
|
disabled = pythonOlder "3.10";
|
2023-01-13 18:09:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bambinos";
|
2023-10-11 04:56:41 +00:00
|
|
|
repo = "bambi";
|
2023-01-13 18:09:56 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-10-27 14:51:40 +00:00
|
|
|
hash = "sha256-kxrNNbZfC96/XHb1I7aUHYZdFJvGR80ZI8ell/0FQXc=";
|
2023-01-13 18:09:56 +00:00
|
|
|
};
|
|
|
|
|
2024-10-27 14:51:40 +00:00
|
|
|
build-system = [ setuptools-scm ];
|
2023-06-07 23:09:13 +00:00
|
|
|
|
2024-10-27 14:51:40 +00:00
|
|
|
dependencies = [
|
2023-01-13 18:09:56 +00:00
|
|
|
arviz
|
|
|
|
formulae
|
2023-10-25 05:45:06 +00:00
|
|
|
graphviz
|
2023-01-13 18:09:56 +00:00
|
|
|
pandas
|
|
|
|
pymc
|
|
|
|
];
|
|
|
|
|
2024-10-27 14:51:40 +00:00
|
|
|
# bayeux-ml is not available in nixpkgs
|
|
|
|
# optional-dependencies = {
|
|
|
|
# jax = [ bayeux-ml ];
|
|
|
|
# };
|
2023-01-13 18:09:56 +00:00
|
|
|
|
2023-02-07 02:56:05 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
blackjax
|
|
|
|
numpyro
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2023-06-07 23:09:13 +00:00
|
|
|
|
2024-10-27 14:51:40 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2024-12-01 12:07:10 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# Tests require network access
|
|
|
|
"test_alias_equal_to_name"
|
|
|
|
"test_average_by"
|
|
|
|
"test_ax"
|
|
|
|
"test_basic"
|
|
|
|
"test_censored_response"
|
|
|
|
"test_custom_prior"
|
|
|
|
"test_data_is_copied"
|
|
|
|
"test_distributional_model"
|
|
|
|
"test_elasticity"
|
|
|
|
"test_extra_namespace"
|
|
|
|
"test_fig_kwargs"
|
|
|
|
"test_gamma_with_splines"
|
|
|
|
"test_group_effects"
|
|
|
|
"test_hdi_prob"
|
|
|
|
"test_legend"
|
|
|
|
"test_model_with_group_specific_effects"
|
|
|
|
"test_model_with_intercept"
|
|
|
|
"test_model_without_intercept"
|
|
|
|
"test_non_distributional_model"
|
|
|
|
"test_normal_with_splines"
|
|
|
|
"test_predict_new_groups_fail"
|
|
|
|
"test_predict_new_groups"
|
|
|
|
"test_predict_offset"
|
|
|
|
"test_set_alias_warnings"
|
|
|
|
"test_subplot_kwargs"
|
|
|
|
"test_transforms"
|
|
|
|
"test_use_hdi"
|
|
|
|
"test_with_group_and_panel"
|
|
|
|
"test_with_groups"
|
|
|
|
"test_with_user_values"
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
|
|
|
# Python crash (in matplotlib)
|
|
|
|
# Fatal Python error: Aborted
|
|
|
|
"test_categorical_response"
|
|
|
|
"test_multiple_hsgp_and_by"
|
|
|
|
"test_multiple_outputs_with_alias"
|
|
|
|
"test_plot_priors"
|
|
|
|
"test_term_transformations"
|
|
|
|
];
|
2023-01-13 18:09:56 +00:00
|
|
|
|
2024-10-27 14:51:40 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# bayeux-ml is not available
|
|
|
|
"tests/test_alternative_samplers.py"
|
|
|
|
# Tests require network access
|
|
|
|
"tests/test_interpret.py"
|
|
|
|
"tests/test_interpret_messages.py"
|
|
|
|
];
|
|
|
|
|
2023-06-07 23:09:13 +00:00
|
|
|
pythonImportsCheck = [ "bambi" ];
|
2023-01-13 18:09:56 +00:00
|
|
|
|
2024-12-01 12:07:10 +00:00
|
|
|
meta = {
|
2023-01-13 18:09:56 +00:00
|
|
|
description = "High-level Bayesian model-building interface";
|
2024-10-27 14:51:40 +00:00
|
|
|
homepage = "https://bambinos.github.io/bambi";
|
2023-10-11 04:56:41 +00:00
|
|
|
changelog = "https://github.com/bambinos/bambi/releases/tag/${version}";
|
2024-12-01 12:07:10 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ bcdarwin ];
|
2023-01-13 18:09:56 +00:00
|
|
|
};
|
|
|
|
}
|