1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 hatch-vcs,
9 hatchling,
10
11 # dependencies
12 numpy,
13 packaging,
14
15 # tests
16 awkward,
17 dask-awkward,
18 notebook,
19 numba,
20 papermill,
21 pytestCheckHook,
22 sympy,
23}:
24
25buildPythonPackage rec {
26 pname = "vector";
27 version = "1.6.3";
28 pyproject = true;
29
30 src = fetchFromGitHub {
31 owner = "scikit-hep";
32 repo = "vector";
33 tag = "v${version}";
34 hash = "sha256-KwxQ2sA8cdHmTRbh23H5iTexMlWK2MxdA8XWpXscpfU=";
35 };
36
37 build-system = [
38 hatch-vcs
39 hatchling
40 ];
41
42 dependencies = [
43 numpy
44 packaging
45 ];
46
47 nativeCheckInputs = [
48 awkward
49 dask-awkward
50 notebook
51 numba
52 papermill
53 pytestCheckHook
54 sympy
55 ];
56
57 pythonImportsCheck = [ "vector" ];
58
59 __darwinAllowLocalNetworking = true;
60
61 disabledTests = [
62 # AssertionErrors in sympy tests
63 "test_lorentz_object"
64 "test_lorentz_sympy"
65 "test_rhophi_eta_t"
66 "test_rhophi_eta_tau"
67 "test_xy_eta_t"
68 "test_xy_eta_tau"
69
70 # AssertionError: assert array([2.]) == array([-2.])
71 "test_issue_443"
72 ]
73 ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
74 # Fatal Python error: Segmentation fault
75 # numba/typed/typeddict.py", line 185 in __setitem__
76 "test_method_transform2D"
77 "test_method_transform3D"
78 "test_method_transform4D"
79 ]
80 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
81 # AssertionError: assert 2.1073424255447017e-08 == 0.0
82 "test_issue_463"
83 ];
84
85 meta = {
86 description = "Library for 2D, 3D, and Lorentz vectors, especially arrays of vectors, to solve common physics problems in a NumPy-like way";
87 homepage = "https://github.com/scikit-hep/vector";
88 changelog = "https://github.com/scikit-hep/vector/releases/tag/${src.tag}";
89 license = with lib.licenses; [ bsd3 ];
90 maintainers = with lib.maintainers; [ veprbl ];
91 };
92}