Skip to content

Commit a4c6d2d

Browse files
committed
[skip ci] merge tests from a private fork
1 parent a55da20 commit a4c6d2d

12 files changed

+3321
-0
lines changed

tests/root/test_EulerAngles.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Copyright (c) 2019-2021, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
2+
#
3+
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
4+
# or https://github.com/scikit-hep/vector for details.
5+
6+
import pytest
7+
from hypothesis import given, strategies as st
8+
9+
import vector
10+
11+
# If ROOT is not available, skip these tests.
12+
ROOT = pytest.importorskip("ROOT")
13+
14+
# 4D constructor arguments to get all the weird cases.
15+
constructor = [
16+
(0, 0, 0, 0),
17+
(0, 0, 1, 0), # theta == 0.0
18+
(0, 0, -1, 0),
19+
(0, 0, 1, 0),
20+
(0, 0, 0, 4294967296),
21+
(0, 4294967296, 0, 0),
22+
(0, 0, 0, 10),
23+
(0, 0, 0, -10),
24+
(1, 2, 3, 0),
25+
(1, 2, 3, 10),
26+
(1, 2, 3, -10),
27+
(1., 2., 3., 2.5),
28+
(1, 2, 3, 2.5),
29+
(1, 2, 3, -2.5),
30+
]
31+
32+
# Coordinate conversion methods to apply to the VectorObject4D.
33+
coordinate_list = [
34+
"to_xyzt",
35+
"to_xythetat", # may fail for constructor2
36+
"to_xyetat",
37+
"to_rhophizt",
38+
"to_rhophithetat",
39+
"to_rhophietat",
40+
"to_xyztau",
41+
"to_xythetatau",
42+
"to_xyetatau",
43+
"to_rhophiztau",
44+
"to_rhophithetatau",
45+
"to_rhophietatau",
46+
]
47+
48+
@pytest.fixture(scope="module", params=coordinate_list)
49+
def coordinates(request):
50+
return request.param
51+
52+
angle_list = [
53+
0,
54+
0.0,
55+
0.7853981633974483,
56+
-0.7853981633974483,
57+
1.5707963267948966,
58+
-1.5707963267948966,
59+
3.141592653589793,
60+
-3.141592653589793,
61+
6.283185307179586,
62+
-6.283185307179586,
63+
]
64+
65+
@pytest.fixture(scope="module", params=angle_list)
66+
def angle(request):
67+
return request.param
68+
69+
scalar_list = [
70+
0,
71+
-1,
72+
1.0,
73+
100000.0000,
74+
-100000.0000,
75+
]
76+
77+
@pytest.fixture(scope="module", params=scalar_list)
78+
def scalar(request):
79+
return request.param

0 commit comments

Comments
 (0)