Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slicing of FileManager #199

Merged
merged 6 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/199.bugfix.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix a bug where ``FileManager.download`` would fail if there was not an
asdf file or quality report PDF in inventory.
2 changes: 2 additions & 0 deletions changelog/199.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix an issue with slicing a dataset where the slicing wouldn't work correctly
if the first axis of the data array has length one.
24 changes: 24 additions & 0 deletions dkist/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,27 @@ def simple_tiled_dataset(dataset):
ds.meta['inventory'] = dataset.meta['inventory']
dataset_array = np.array(datasets).reshape((2,2))
return TiledDataset(dataset_array, dataset.meta['inventory'])


@pytest.fixture
def small_visp_dataset():
"""
This fixture is used to test when the array in the FITS file has a length
one NAXIS 3.
"""
# This asdf file wont work with sunpy less than 4
pytest.importorskip("sunpy", "4.0.0")

# This dataset was generated by the following code:
# from dkist_data_simulator.spec214.visp import SimpleVISPDataset
# from dkist_inventory.asdf_generator import dataset_from_fits
# import astropy.units as u

# ds = SimpleVISPDataset(n_maps=1, n_steps=3, n_stokes=1, time_delta=10,
# linewave=500*u.nm, detector_shape=(10, 25))
# ds.generate_files(vispdir)
# dataset_from_fits(vispdir, "test_visp.asdf")

vispdir = Path(rootdir) / "small_visp"
with asdf.open(vispdir / "test_visp.asdf") as f:
return f.tree['dataset']
7 changes: 7 additions & 0 deletions dkist/data/test/small_visp/0.fits

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dkist/data/test/small_visp/1.fits

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dkist/data/test/small_visp/2.fits

Large diffs are not rendered by default.

Loading