2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
2023-02-02 18:25:31 +00:00
|
|
|
, buildPythonPackage
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchFromGitHub
|
2023-02-02 18:25:31 +00:00
|
|
|
, cython
|
2023-10-09 19:29:22 +00:00
|
|
|
, versioneer
|
|
|
|
, cons
|
2023-02-02 18:25:31 +00:00
|
|
|
, etuples
|
|
|
|
, filelock
|
|
|
|
, logical-unification
|
|
|
|
, minikanren
|
2023-10-09 19:29:22 +00:00
|
|
|
, numpy
|
|
|
|
, scipy
|
|
|
|
, typing-extensions
|
|
|
|
, jax
|
|
|
|
, jaxlib
|
2023-02-02 18:25:31 +00:00
|
|
|
, numba
|
|
|
|
, numba-scipy
|
2023-10-09 19:29:22 +00:00
|
|
|
, pytest-mock
|
2023-02-02 18:25:31 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2024-01-02 11:29:13 +00:00
|
|
|
, tensorflow-probability
|
2023-10-09 19:29:22 +00:00
|
|
|
, stdenv
|
2023-02-02 18:25:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytensor";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "2.18.5";
|
2023-10-09 19:29:22 +00:00
|
|
|
pyproject = true;
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pymc-devs";
|
2023-10-09 19:29:22 +00:00
|
|
|
repo = "pytensor";
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/rel-${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-0xwzFmYsec7uQaq6a4BAA6MYy2zIVZ0cTwodVJQ6yMs=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "versioneer[toml]==0.28" "versioneer[toml]"
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
2023-10-09 19:29:22 +00:00
|
|
|
versioneer
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cons
|
|
|
|
etuples
|
|
|
|
filelock
|
|
|
|
logical-unification
|
|
|
|
minikanren
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeCheckInputs = [
|
2023-02-02 18:25:31 +00:00
|
|
|
jax
|
|
|
|
jaxlib
|
|
|
|
numba
|
|
|
|
numba-scipy
|
2023-10-09 19:29:22 +00:00
|
|
|
pytest-mock
|
2023-02-02 18:25:31 +00:00
|
|
|
pytestCheckHook
|
2024-01-02 11:29:13 +00:00
|
|
|
tensorflow-probability
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pytensor"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# benchmarks (require pytest-benchmark):
|
|
|
|
"test_elemwise_speed"
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_fused_elemwise_benchmark"
|
2023-02-02 18:25:31 +00:00
|
|
|
"test_logsumexp_benchmark"
|
|
|
|
"test_scan_multiple_output"
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_vector_taps_benchmark"
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Don't run the most compute-intense tests
|
|
|
|
"tests/scan/"
|
|
|
|
"tests/tensor/"
|
|
|
|
"tests/sparse/sandbox/"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays";
|
|
|
|
homepage = "https://github.com/pymc-devs/pytensor";
|
|
|
|
changelog = "https://github.com/pymc-devs/pytensor/releases";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64);
|
|
|
|
};
|
|
|
|
}
|