forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astroscrappy-1.0.3-endian-fix-tests.patch
100 lines (81 loc) · 3.85 KB
/
astroscrappy-1.0.3-endian-fix-tests.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From 5b5ce99c63d03e60b6027f09f72231db11a87bf2 Mon Sep 17 00:00:00 2001
From: Curtis McCully <[email protected]>
Date: Thu, 3 Dec 2015 12:02:38 -0800
Subject: [PATCH] Made tests not endian specific.
--- a/astroscrappy/tests/test_utils.py
+++ b/astroscrappy/tests/test_utils.py
@@ -56,7 +56,7 @@
def test_medfilt5():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
npmed5 = ndimage.filters.median_filter(a, size=(5, 5), mode='nearest')
npmed5[:2, :] = a[:2, :]
npmed5[-2:, :] = a[-2:, :]
@@ -68,7 +68,7 @@
def test_medfilt7():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
npmed7 = ndimage.filters.median_filter(a, size=(7, 7), mode='nearest')
npmed7[:3, :] = a[:3, :]
npmed7[-3:, :] = a[-3:, :]
@@ -80,7 +80,7 @@
def test_sepmedfilt3():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
npmed3 = ndimage.filters.median_filter(a, size=(1, 3), mode='nearest')
npmed3[:, :1] = a[:, :1]
npmed3[:, -1:] = a[:, -1:]
@@ -95,7 +95,7 @@
def test_sepmedfilt5():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
npmed5 = ndimage.filters.median_filter(a, size=(1, 5), mode='nearest')
npmed5[:, :2] = a[:, :2]
npmed5[:, -2:] = a[:, -2:]
@@ -110,7 +110,7 @@
def test_sepmedfilt7():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
npmed7 = ndimage.filters.median_filter(a, size=(1, 7), mode='nearest')
npmed7[:, :3] = a[:, :3]
npmed7[:, -3:] = a[:, -3:]
@@ -125,7 +125,7 @@
def test_sepmedfilt9():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
npmed9 = ndimage.filters.median_filter(a, size=(1, 9), mode='nearest')
npmed9[:, :4] = a[:, :4]
npmed9[:, -4:] = a[:, -4:]
@@ -174,7 +174,7 @@
def test_subsample():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
npsubsamp = np.zeros((a.shape[0] * 2, a.shape[1] * 2), dtype=np.float32)
for i in range(a.shape[0]):
for j in range(a.shape[1]):
@@ -189,8 +189,8 @@
def test_rebin():
a = np.ascontiguousarray(np.random.random((2002, 2002)), dtype=np.float32)
- a = a.astype('<f4')
- nprebin = np.zeros((1001, 1001), dtype=np.float32).astype('<f4')
+ a = a.astype('f4')
+ nprebin = np.zeros((1001, 1001), dtype=np.float32).astype('f4')
for i in range(1001):
for j in range(1001):
nprebin[i, j] = (a[2 * i, 2 * j] + a[2 * i + 1, 2 * j] +
@@ -202,7 +202,7 @@
def test_laplaceconvolve():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
k = np.array([[0.0, -1.0, 0.0], [-1.0, 4.0, -1.0], [0.0, -1.0, 0.0]])
k = k.astype('<f4')
npconv = ndimage.filters.convolve(a, k, mode='constant', cval=0.0)
@@ -211,8 +211,8 @@
def test_convolve():
- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('<f4')
- k = np.ascontiguousarray(np.random.random((5, 5))).astype('<f4')
+ a = np.ascontiguousarray(np.random.random((1001, 1001))).astype('f4')
+ k = np.ascontiguousarray(np.random.random((5, 5))).astype('f4')
npconv = ndimage.filters.convolve(a, k, mode='constant', cval=0.0)
cconv = convolve(a, k)
assert_allclose(cconv, npconv, rtol=0, atol=1e-5)