From 492762b2aeffc008b180a9fc5726424d692c08c2 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Mon, 5 Jul 2021 13:44:39 +0100 Subject: [PATCH] Fix resetting path in Dataset.download (#124) --- changelog/124.bugfix.rst | 1 + dkist/io/array_containers.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 changelog/124.bugfix.rst diff --git a/changelog/124.bugfix.rst b/changelog/124.bugfix.rst new file mode 100644 index 00000000..e73318f5 --- /dev/null +++ b/changelog/124.bugfix.rst @@ -0,0 +1 @@ +Fix a bug where sometimes the path wouldn't be set correctly after FITS file download. diff --git a/dkist/io/array_containers.py b/dkist/io/array_containers.py index 537166ab..7dae1c7e 100644 --- a/dkist/io/array_containers.py +++ b/dkist/io/array_containers.py @@ -70,12 +70,12 @@ def from_external_array_references(cls, ears, **kwargs): Construct a collection from a (nested) iterable of `asdf.ExternalArrayReference` objects. """ - shape = ears[0].shape - dtype = ears[0].dtype - target = ears[0].target + ear0 = np.array(ears).flat[0] + shape = ear0.shape + dtype = ear0.dtype + target = ear0.target - for i, ele in enumerate(ears): - uris = cls._validate_homogenaity(shape, target, dtype, ears) + uris = cls._validate_homogenaity(shape, target, dtype, ears) return cls(uris, target, dtype, shape, **kwargs)