Skip to content

Commit 5bfd24d

Browse files
committed
remoe fitsable unit tests to autconf
1 parent 538aa09 commit 5bfd24d

3 files changed

Lines changed: 0 additions & 153 deletions

File tree

test_autoarray/structures/arrays/test_array_1d_util.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,35 +56,3 @@ def test__array_1d_native_from():
5656
)
5757

5858
assert (array_1d_native == np.array([1.0, 2.0, 0.0, 0.0, 3.0, 4.0])).all()
59-
60-
61-
def test__numpy_array_1d_via_fits_from():
62-
arr = aa.util.array_1d.numpy_array_1d_via_fits_from(
63-
file_path=path.join(test_data_path, "3_ones.fits"), hdu=0
64-
)
65-
66-
assert (arr == np.ones((3))).all()
67-
68-
69-
def test__numpy_array_1d_to_fits__output_and_load():
70-
file_path = path.join(test_data_path, "array_out.fits")
71-
72-
if path.exists(file_path):
73-
os.remove(file_path)
74-
75-
arr = np.array([10.0, 30.0, 40.0, 92.0, 19.0, 20.0])
76-
77-
aa.util.array_1d.numpy_array_1d_to_fits(
78-
arr, file_path=file_path, header_dict={"A": 1}
79-
)
80-
81-
array_load = aa.util.array_1d.numpy_array_1d_via_fits_from(
82-
file_path=file_path,
83-
hdu=0,
84-
)
85-
86-
assert (arr == array_load).all()
87-
88-
header_load = aa.header_obj_from(file_path=file_path, hdu=0)
89-
90-
assert header_load["A"] == 1

test_autoarray/structures/arrays/test_array_2d_util.py

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
import os
44
import numpy as np
5-
import pytest
65

7-
from astropy.io import fits
8-
9-
import autoarray as aa
106

117
test_data_path = os.path.join(
128
"{}".format(os.path.dirname(os.path.realpath(__file__))), "files"
@@ -290,60 +286,6 @@ def test__resized_array_2d_from__padding_with_new_origin():
290286
)
291287
).all()
292288

293-
294-
def test__ndarray_via_fits_from():
295-
arr = util.array_2d.ndarray_via_fits_from(
296-
file_path=os.path.join(test_data_path, "3x3_ones.fits"), hdu=0
297-
)
298-
299-
assert (arr == np.ones((3, 3))).all()
300-
301-
arr = util.array_2d.ndarray_via_fits_from(
302-
file_path=os.path.join(test_data_path, "4x3_ones.fits"), hdu=0
303-
)
304-
305-
assert (arr == np.ones((4, 3))).all()
306-
307-
308-
def test__numpy_array_2d_to_fits():
309-
file_path = os.path.join(test_data_path, "array_out.fits")
310-
311-
if os.path.exists(file_path):
312-
os.remove(file_path)
313-
314-
arr = np.array([[10.0, 30.0, 40.0], [92.0, 19.0, 20.0]])
315-
316-
util.array_2d.numpy_array_2d_to_fits(arr, file_path=file_path)
317-
318-
array_load = util.array_2d.ndarray_via_fits_from(file_path=file_path, hdu=0)
319-
320-
assert (arr == array_load).all()
321-
322-
323-
def test__numpy_array_2d_to_fits__header_dict():
324-
file_path = os.path.join(test_data_path, "array_out.fits")
325-
326-
if os.path.exists(file_path):
327-
os.remove(file_path)
328-
329-
arr = np.array([[10.0, 30.0, 40.0], [92.0, 19.0, 20.0]])
330-
331-
util.array_2d.numpy_array_2d_to_fits(arr, file_path=file_path, header_dict={"A": 1})
332-
333-
header = aa.header_obj_from(file_path=file_path, hdu=0)
334-
335-
assert header["A"] == 1
336-
337-
338-
def test__header_obj_from():
339-
header_obj = aa.header_obj_from(
340-
file_path=os.path.join(test_data_path, "3x3_ones.fits"), hdu=0
341-
)
342-
343-
assert isinstance(header_obj, fits.header.Header)
344-
assert header_obj["BITPIX"] == -64
345-
346-
347289
def test__replace_noise_map_2d_values_where_image_2d_values_are_negative():
348290
image_2d = np.ones(shape=(2, 2))
349291

test_autoarray/structures/test_flip_for_ds9.py

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

0 commit comments

Comments
 (0)