Skip to content

Commit d55304f

Browse files
Jammy2211Jammy2211
authored andcommitted
remove tests which use now unusued project code
1 parent e69ff07 commit d55304f

5 files changed

Lines changed: 0 additions & 253 deletions

File tree

autoarray/structures/decorators/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from .project_grid import project_grid
2-
from .to_projected import to_projected
31
from .to_array import to_array
42
from .to_grid import to_grid
53
from .to_vector_yx import to_vector_yx

autoarray/structures/decorators/project_grid.py

Lines changed: 0 additions & 103 deletions
This file was deleted.

autoarray/structures/decorators/to_projected.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

autoarray/structures/mock/mock_decorators.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ def __init__(self, centre=(0.0, 0.0), angle=0.0):
8686
self.centre = centre
8787
self.angle = angle
8888

89-
@decorators.project_grid
90-
def ndarray_1d_from(self, grid, *args, **kwargs):
91-
return np.ones(shape=grid.shape[0])
92-
93-
9489
class MockGrid2DLikeObj:
9590
def __init__(self):
9691
self.centre = (0.0, 0.0)

test_autoarray/structures/decorators/test_to_array.py

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,6 @@
33
import autoarray as aa
44

55

6-
def test__in_grid_1d__out_ndarray_1d():
7-
grid_1d = aa.Grid1D.no_mask(values=[1.0, 2.0, 3.0], pixel_scales=1.0)
8-
9-
obj = aa.m.MockGrid1DLikeObj()
10-
11-
ndarray_1d = obj.ndarray_1d_from(grid=grid_1d)
12-
13-
assert isinstance(ndarray_1d, aa.Array1D)
14-
assert (ndarray_1d.native == np.array([1.0, 1.0, 1.0])).all()
15-
assert ndarray_1d.pixel_scales == (1.0,)
16-
17-
obj = aa.m.MockGrid1DLikeObj(centre=(1.0, 0.0), angle=45.0)
18-
19-
ndarray_1d = obj.ndarray_1d_from(grid=grid_1d)
20-
21-
assert isinstance(ndarray_1d, aa.Array1D)
22-
assert (ndarray_1d.native == np.array([1.0, 1.0, 1.0])).all()
23-
assert ndarray_1d.pixel_scales == (1.0,)
24-
25-
mask_1d = aa.Mask1D(mask=[True, False, False, True], pixel_scales=(1.0,))
26-
27-
grid_1d = aa.Grid1D.from_mask(mask=mask_1d)
28-
29-
obj = aa.m.MockGrid2DLikeObj()
30-
31-
ndarray_1d = obj.ndarray_1d_from(grid=grid_1d)
32-
33-
assert isinstance(ndarray_1d, aa.Array1D)
34-
assert (ndarray_1d.native == np.array([0.0, 1.0, 1.0, 0.0])).all()
35-
36-
376
def test__in_grid_1d__out_ndarray_1d_list():
387
mask = aa.Mask1D(mask=[True, False, False, True], pixel_scales=(1.0,))
398

@@ -50,55 +19,6 @@ def test__in_grid_1d__out_ndarray_1d_list():
5019
assert (ndarray_1d_list[1].native == np.array([[0.0, 2.0, 2.0, 0.0]])).all()
5120

5221

53-
def test__in_grid_2d__out_ndarray_1d():
54-
grid_2d = aa.Grid2D.uniform(shape_native=(4, 4), pixel_scales=1.0)
55-
56-
obj = aa.m.MockGrid1DLikeObj()
57-
58-
ndarray_1d = obj.ndarray_1d_from(grid=grid_2d)
59-
60-
assert isinstance(ndarray_1d, aa.Array1D)
61-
assert (ndarray_1d.native == np.array([1.0])).all()
62-
assert ndarray_1d.pixel_scales == (1.0,)
63-
64-
obj = aa.m.MockGrid1DLikeObj(centre=(1.0, 0.0))
65-
66-
ndarray_1d = obj.ndarray_1d_from(grid=grid_2d)
67-
68-
assert isinstance(ndarray_1d, aa.Array1D)
69-
assert (ndarray_1d.native == np.array([1.0, 1.0, 1.0, 1.0])).all()
70-
assert ndarray_1d.pixel_scales == (1.0,)
71-
72-
mask = aa.Mask2D(
73-
mask=[
74-
[True, True, True, True],
75-
[True, False, False, True],
76-
[True, False, False, True],
77-
[True, True, True, True],
78-
],
79-
pixel_scales=(1.0, 1.0),
80-
)
81-
82-
grid_2d = aa.Grid2D.from_mask(mask=mask)
83-
84-
obj = aa.m.MockGrid2DLikeObj()
85-
86-
ndarray_1d = obj.ndarray_1d_from(grid=grid_2d)
87-
88-
assert isinstance(ndarray_1d, aa.Array2D)
89-
assert (
90-
ndarray_1d.native
91-
== np.array(
92-
[
93-
[0.0, 0.0, 0.0, 0.0],
94-
[0.0, 1.0, 1.0, 0.0],
95-
[0.0, 1.0, 1.0, 0.0],
96-
[0.0, 0.0, 0.0, 0.0],
97-
]
98-
)
99-
).all()
100-
101-
10222
def test__in_grid_2d__out_ndarray_1d_list():
10323
mask = aa.Mask2D(
10424
mask=[

0 commit comments

Comments
 (0)