dkist-processing-ops 1.6.6__py3-none-any.whl → 1.6.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dkist-processing-ops might be problematic. Click here for more details.
- dkist_processing_ops/_version.py +2 -2
- dkist_processing_ops/tasks/read_memory_leak.py +32 -36
- {dkist_processing_ops-1.6.6.dist-info → dkist_processing_ops-1.6.7.dist-info}/METADATA +1 -1
- {dkist_processing_ops-1.6.6.dist-info → dkist_processing_ops-1.6.7.dist-info}/RECORD +7 -7
- {dkist_processing_ops-1.6.6.dist-info → dkist_processing_ops-1.6.7.dist-info}/LICENSE.rst +0 -0
- {dkist_processing_ops-1.6.6.dist-info → dkist_processing_ops-1.6.7.dist-info}/WHEEL +0 -0
- {dkist_processing_ops-1.6.6.dist-info → dkist_processing_ops-1.6.7.dist-info}/top_level.txt +0 -0
dkist_processing_ops/_version.py
CHANGED
|
@@ -1,55 +1,51 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from abc import ABC
|
|
2
3
|
from pathlib import Path
|
|
4
|
+
from typing import Any
|
|
5
|
+
from typing import Generator
|
|
3
6
|
|
|
4
7
|
import numpy as np
|
|
5
8
|
from astropy.io import fits
|
|
6
9
|
from dkist_processing_common.codecs.fits import fits_hdu_decoder
|
|
10
|
+
from dkist_processing_common.codecs.path import path_decoder
|
|
7
11
|
from dkist_processing_common.models.tags import Tag
|
|
12
|
+
from dkist_processing_common.tasks import tag_type_hint
|
|
8
13
|
from dkist_processing_common.tasks import WorkflowTaskBase
|
|
9
14
|
|
|
10
15
|
|
|
11
|
-
def
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return hdul[1]
|
|
16
|
+
def yield_from_read(
|
|
17
|
+
self, tags: tag_type_hint, decoder: callable = path_decoder, **decoder_kwargs
|
|
18
|
+
) -> Generator[Any, None, None]:
|
|
19
|
+
yield from (decoder(p, **decoder_kwargs) for p in self.scratch.find_all(tags=tags))
|
|
16
20
|
|
|
17
21
|
|
|
18
|
-
def
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
hdu_to_return = _extract_hdu(hdu_list).copy()
|
|
22
|
-
hdu_list.close()
|
|
23
|
-
return hdu_to_return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def fits_hdu_decoder_with_close_and_del(path: Path) -> fits.PrimaryHDU | fits.CompImageHDU:
|
|
27
|
-
"""Read a Path with `fits` to produce an `HDUList`."""
|
|
28
|
-
hdu_list = fits.open(path, memmap=False)
|
|
29
|
-
hdu_to_return = _extract_hdu(hdu_list).copy()
|
|
30
|
-
hdu_list.close()
|
|
31
|
-
del hdu_list
|
|
32
|
-
return hdu_to_return
|
|
22
|
+
def binary_decoder(path: Path) -> bytes:
|
|
23
|
+
"""Generates a random blob of binary data."""
|
|
24
|
+
return os.urandom(67109008) # This is the size of the VBI data arrays, in bytes
|
|
33
25
|
|
|
34
26
|
|
|
35
27
|
class FitsDataRead(WorkflowTaskBase, ABC):
|
|
36
28
|
@property
|
|
37
|
-
def
|
|
29
|
+
def data_type(self) -> str:
|
|
38
30
|
"""Recipe run configuration indicating how fFITS data should be read."""
|
|
39
|
-
return self.metadata_store_recipe_run_configuration().get(
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
return self.metadata_store_recipe_run_configuration().get("data_type", "fits")
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def read_method(self):
|
|
35
|
+
return self.metadata_store_recipe_run_configuration().get("read_method", "return")
|
|
42
36
|
|
|
43
37
|
def run(self) -> None:
|
|
44
|
-
if self.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
if self.data_type == "fits":
|
|
39
|
+
if self.read_method == "return":
|
|
40
|
+
hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder)
|
|
41
|
+
if self.read_method == "yield":
|
|
42
|
+
hdus = yield_from_read(
|
|
43
|
+
self, tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder
|
|
44
|
+
)
|
|
45
|
+
if self.data_type == "binary":
|
|
46
|
+
if self.read_method == "return":
|
|
47
|
+
hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=binary_decoder)
|
|
48
|
+
if self.read_method == "yield":
|
|
49
|
+
hdus = yield_from_read(
|
|
50
|
+
self, tags=[Tag.input(), Tag.frame()], decoder=binary_decoder
|
|
51
|
+
)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
dkist_processing_ops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
dkist_processing_ops/_version.py,sha256=
|
|
2
|
+
dkist_processing_ops/_version.py,sha256=UBH9kvxesdE0svvcKwHfK8rz5bJUzNXPBHo7APqVEfk,411
|
|
3
3
|
dkist_processing_ops/dags/scale.py,sha256=We5TYjNhkJ-5ykfbrOMgjTpXdzOCkIeyKyA-40sU9r0,2312
|
|
4
4
|
dkist_processing_ops/tasks/__init__.py,sha256=P81O9cg4dlBMqBTaWitdsAte68RsMtDlhV30JSZfXUY,107
|
|
5
|
-
dkist_processing_ops/tasks/read_memory_leak.py,sha256=
|
|
5
|
+
dkist_processing_ops/tasks/read_memory_leak.py,sha256=DxL-WOvcE4WFF-crmsVGaLHeFR-AfdV7BfnZE01KkEU,1990
|
|
6
6
|
dkist_processing_ops/tasks/wait.py,sha256=uObka-nH1dKPcGBDsp3t2RCtTV2F1kksM0V-lRewFuY,273
|
|
7
7
|
dkist_processing_ops/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
dkist_processing_ops/tests/test_workflows.py,sha256=Ch_8BlGeQyPJU_9hB_GOncwW-SoZwpRUVKMOEz0RQZk,285
|
|
9
9
|
dkist_processing_ops/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
dkist_processing_ops/workflows/memory_leak.py,sha256=lYXAYyJVjXif3Os9xPDp-bPTG_je6HOw1uvRJ4WMUi4,758
|
|
11
11
|
dkist_processing_ops/workflows/smoke.py,sha256=ofXu0_iYF6L3zQy-BOVvS5VdzKhmXs1gyugqMNkd-GM,878
|
|
12
|
-
dkist_processing_ops-1.6.
|
|
13
|
-
dkist_processing_ops-1.6.
|
|
14
|
-
dkist_processing_ops-1.6.
|
|
15
|
-
dkist_processing_ops-1.6.
|
|
16
|
-
dkist_processing_ops-1.6.
|
|
12
|
+
dkist_processing_ops-1.6.7.dist-info/LICENSE.rst,sha256=LJjTmkf2-q1phdZSySMpiyPxgLOy6zYHOr3R1Bb1__8,327
|
|
13
|
+
dkist_processing_ops-1.6.7.dist-info/METADATA,sha256=HExJ8RIWlc8uQgKrmFHUwIW1Y5mk3QWDJdTNFTurheM,1499
|
|
14
|
+
dkist_processing_ops-1.6.7.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
15
|
+
dkist_processing_ops-1.6.7.dist-info/top_level.txt,sha256=o_SNho1HKt6wvCSUhm9qzX9FS2iopnqYuMos1CCD9cI,21
|
|
16
|
+
dkist_processing_ops-1.6.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|