Skip to content

Commit

Permalink
Fix dataset fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Nov 20, 2019
1 parent 9ee489d commit 4c1e653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dkist/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ def dataset(array, identity_gwcs):
assert ds.data is array
assert ds.wcs is identity_gwcs

ds._array_container = DaskFITSArrayContainer([ExternalArrayReference('test1.fits', 0, 'float', (10, 10)),
ExternalArrayReference('test2.fits', 0, 'float', (10, 10))],
ds._array_container = DaskFITSArrayContainer([ExternalArrayReference('test1.fits', 0, 'float', array.shape)],
loader=AstropyFITSLoader)

return ds
Expand Down
5 changes: 4 additions & 1 deletion dkist/io/array_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def __init__(self, reference_array, *, loader, **kwargs):
if reference_shape[0] == 1:
reference_shape = reference_shape[1:]

self.shape = tuple(list(reference_array.shape) + list(reference_shape))
if len(reference_array) == 1:
self.shape = reference_shape
else:
self.shape = tuple(list(reference_array.shape) + list(reference_shape))

loader_array = np.empty_like(reference_array, dtype=object)
for i, ele in enumerate(reference_array.flat):
Expand Down

0 comments on commit 4c1e653

Please sign in to comment.