2023-03-24 00:07:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-03-05 16:20:37 +00:00
|
|
|
, buildPythonPackage
|
2022-06-16 17:23:12 +00:00
|
|
|
, cons
|
|
|
|
, cython
|
|
|
|
, etuples
|
2022-03-05 16:20:37 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, filelock
|
2023-03-24 00:07:29 +00:00
|
|
|
, hatch-vcs
|
|
|
|
, hatchling
|
2022-06-26 10:26:21 +00:00
|
|
|
, jax
|
|
|
|
, jaxlib
|
2022-03-05 16:20:37 +00:00
|
|
|
, logical-unification
|
|
|
|
, minikanren
|
|
|
|
, numba
|
|
|
|
, numba-scipy
|
2022-06-16 17:23:12 +00:00
|
|
|
, numpy
|
2022-03-05 16:20:37 +00:00
|
|
|
, pytestCheckHook
|
2024-05-15 15:35:15 +00:00
|
|
|
, pythonAtLeast
|
2022-06-16 17:23:12 +00:00
|
|
|
, pythonOlder
|
|
|
|
, scipy
|
|
|
|
, typing-extensions
|
2022-03-05 16:20:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aesara";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.9.3";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Python 3.12 is not supported: https://github.com/aesara-devs/aesara/issues/1520
|
|
|
|
disabled = pythonOlder "3.8" || pythonAtLeast "3.12";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aesara-devs";
|
|
|
|
repo = "aesara";
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "refs/tags/rel-${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-aO0+O7Ts9phsV4ghunNolxfAruGBbC+tHjVkmFedcCI=";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
2022-03-05 16:20:37 +00:00
|
|
|
cython
|
2023-03-24 00:07:29 +00:00
|
|
|
hatch-vcs
|
|
|
|
hatchling
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2022-06-16 17:23:12 +00:00
|
|
|
cons
|
2022-03-05 16:20:37 +00:00
|
|
|
etuples
|
2022-06-16 17:23:12 +00:00
|
|
|
filelock
|
2022-03-05 16:20:37 +00:00
|
|
|
logical-unification
|
|
|
|
minikanren
|
2022-06-16 17:23:12 +00:00
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
typing-extensions
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-26 10:26:21 +00:00
|
|
|
jax
|
|
|
|
jaxlib
|
2022-06-16 17:23:12 +00:00
|
|
|
numba
|
|
|
|
numba-scipy
|
2022-03-05 16:20:37 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
2023-03-24 00:07:29 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail "--durations=50" "" \
|
|
|
|
--replace-fail "hatch-vcs >=0.3.0,<0.4.0" "hatch-vcs"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
preBuild = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"aesara"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Don't run the most compute-intense tests
|
|
|
|
"tests/scan/"
|
|
|
|
"tests/tensor/"
|
|
|
|
"tests/sandbox/"
|
2022-11-02 22:02:43 +00:00
|
|
|
"tests/sparse/sandbox/"
|
2023-03-24 00:07:29 +00:00
|
|
|
# JAX is not available on all platform and often broken
|
|
|
|
"tests/link/jax/"
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
# 2024-04-27: The current nixpkgs numba version is too recent and incompatible with aesara 2.9.3
|
|
|
|
"tests/link/numba/"
|
2023-03-24 00:07:29 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Disable all benchmark tests
|
|
|
|
"test_scan_multiple_output"
|
|
|
|
"test_logsumexp_benchmark"
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
# TypeError: exceptions must be derived from Warning, not <class 'NoneType'>
|
|
|
|
"test_api_deprecation_warning"
|
|
|
|
# AssertionError: assert ['Elemwise{Co..._i{0} 0', ...] == ['Elemwise{Co..._i{0} 0', ...]
|
|
|
|
# At index 3 diff: '| |Gemv{inplace} d={0: [0]} 2' != '| |CGemv{inplace} d={0: [0]} 2'
|
|
|
|
"test_debugprint"
|
|
|
|
# ValueError: too many values to unpack (expected 3)
|
|
|
|
"test_ExternalCOp_c_code_cache_version"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays";
|
|
|
|
homepage = "https://github.com/aesara-devs/aesara";
|
2023-03-24 00:07:29 +00:00
|
|
|
changelog = "https://github.com/aesara-devs/aesara/releases/tag/rel-${version}";
|
2022-03-05 16:20:37 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ Etjean ];
|
2022-11-02 22:02:43 +00:00
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64);
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
}
|