dkist-processing-ops 1.6.11__tar.gz → 1.6.13__tar.gz
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-1.6.11 → dkist_processing_ops-1.6.13}/PKG-INFO +1 -1
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/_version.py +2 -2
- dkist_processing_ops-1.6.13/dkist_processing_ops/tasks/read_memory_leak.py +49 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops.egg-info/PKG-INFO +1 -1
- dkist_processing_ops-1.6.11/dkist_processing_ops/tasks/read_memory_leak.py +0 -73
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/.gitignore +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/.pre-commit-config.yaml +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/LICENSE.rst +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/MANIFEST.in +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/README.rst +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/bitbucket-pipelines.yml +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/__init__.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/dags/scale.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/tasks/__init__.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/tasks/wait.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/tests/__init__.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/tests/test_workflows.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/workflows/__init__.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/workflows/memory_leak.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/workflows/smoke.py +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops.egg-info/SOURCES.txt +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops.egg-info/dependency_links.txt +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops.egg-info/not-zip-safe +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops.egg-info/requires.txt +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops.egg-info/top_level.txt +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/pyproject.toml +0 -0
- {dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/setup.cfg +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from abc import ABC
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
from astropy.io import fits
|
|
6
|
+
from dkist_processing_common.codecs.fits import fits_hdu_decoder
|
|
7
|
+
from dkist_processing_common.codecs.path import path_decoder
|
|
8
|
+
from dkist_processing_common.models.tags import Tag
|
|
9
|
+
from dkist_processing_common.tasks import WorkflowTaskBase
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def generated_hdu_decoder(path: Path) -> fits.PrimaryHDU | fits.CompImageHDU:
|
|
13
|
+
data = np.random.rand(4096, 4096)
|
|
14
|
+
hdu = fits.CompImageHDU(data)
|
|
15
|
+
return hdu
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class FitsDataRead(WorkflowTaskBase, ABC):
|
|
19
|
+
@property
|
|
20
|
+
def run_type(self):
|
|
21
|
+
return self.metadata_store_recipe_run_configuration().get("run_type", "file_read")
|
|
22
|
+
|
|
23
|
+
def run(self) -> None:
|
|
24
|
+
if self.run_type == "file_read":
|
|
25
|
+
hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder)
|
|
26
|
+
for hdu in hdus:
|
|
27
|
+
h = hdu.header
|
|
28
|
+
d = hdu.data
|
|
29
|
+
|
|
30
|
+
if self.run_type == "generated_read":
|
|
31
|
+
hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=generated_hdu_decoder)
|
|
32
|
+
for hdu in hdus:
|
|
33
|
+
h = hdu.header
|
|
34
|
+
d = hdu.data
|
|
35
|
+
|
|
36
|
+
if self.run_type == "file_task":
|
|
37
|
+
filepaths = self.read(tags=[Tag.input(), Tag.frame()], decoder=path_decoder)
|
|
38
|
+
for filepath in filepaths:
|
|
39
|
+
hdu = fits.open(filepath)[1]
|
|
40
|
+
h = hdu.header
|
|
41
|
+
d = hdu.data
|
|
42
|
+
|
|
43
|
+
if self.run_type == "generated_task":
|
|
44
|
+
filepaths = self.read(tags=[Tag.input(), Tag.frame()], decoder=path_decoder)
|
|
45
|
+
for filepath in filepaths:
|
|
46
|
+
data = np.random.rand(4096, 4096)
|
|
47
|
+
hdu = fits.CompImageHDU(data)
|
|
48
|
+
h = hdu.header
|
|
49
|
+
d = hdu.data
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import os
|
|
3
|
-
import sys
|
|
4
|
-
from abc import ABC
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
from typing import Any
|
|
7
|
-
from typing import Generator
|
|
8
|
-
|
|
9
|
-
import numpy as np
|
|
10
|
-
from dkist_processing_common.codecs.fits import fits_hdu_decoder
|
|
11
|
-
from dkist_processing_common.codecs.path import path_decoder
|
|
12
|
-
from dkist_processing_common.models.tags import Tag
|
|
13
|
-
from dkist_processing_common.tasks import tag_type_hint
|
|
14
|
-
from dkist_processing_common.tasks import WorkflowTaskBase
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def yield_from_read(
|
|
18
|
-
self, tags: tag_type_hint, decoder: callable = path_decoder, **decoder_kwargs
|
|
19
|
-
) -> Generator[Any, None, None]:
|
|
20
|
-
yield from (decoder(p, **decoder_kwargs) for p in self.scratch.find_all(tags=tags))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def binary_decoder(path: Path) -> bytes:
|
|
24
|
-
"""Generates a random blob of binary data."""
|
|
25
|
-
data = os.urandom(67109008) # This is the size of the VBI data arrays, in bytes
|
|
26
|
-
logging.info(f"Size of data: {sys.getsizeof(data)}")
|
|
27
|
-
logging.info(f"Bytes of data: {len(data)}")
|
|
28
|
-
return data
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class FitsDataRead(WorkflowTaskBase, ABC):
|
|
32
|
-
@property
|
|
33
|
-
def data_type(self) -> str:
|
|
34
|
-
"""Recipe run configuration indicating how fFITS data should be read."""
|
|
35
|
-
return self.metadata_store_recipe_run_configuration().get("data_type", "fits")
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def read_method(self):
|
|
39
|
-
return self.metadata_store_recipe_run_configuration().get("read_method", "return")
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
def manipulate_data(self):
|
|
43
|
-
return self.metadata_store_recipe_run_configuration().get("manipulate_data", True)
|
|
44
|
-
|
|
45
|
-
def run(self) -> None:
|
|
46
|
-
if self.data_type == "fits":
|
|
47
|
-
if self.read_method == "return":
|
|
48
|
-
hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder)
|
|
49
|
-
for hdu in hdus:
|
|
50
|
-
h = hdu.header
|
|
51
|
-
d = hdu.data
|
|
52
|
-
if self.manipulate_data:
|
|
53
|
-
total = np.sum(d)
|
|
54
|
-
if self.read_method == "yield":
|
|
55
|
-
hdus = yield_from_read(
|
|
56
|
-
self, tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder
|
|
57
|
-
)
|
|
58
|
-
for hdu in hdus:
|
|
59
|
-
h = hdu.header
|
|
60
|
-
d = hdu.data
|
|
61
|
-
if self.manipulate_data:
|
|
62
|
-
total = np.sum(d)
|
|
63
|
-
if self.data_type == "binary":
|
|
64
|
-
if self.read_method == "return":
|
|
65
|
-
hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=binary_decoder)
|
|
66
|
-
for hdu in hdus:
|
|
67
|
-
data = hdu
|
|
68
|
-
if self.read_method == "yield":
|
|
69
|
-
hdus = yield_from_read(
|
|
70
|
-
self, tags=[Tag.input(), Tag.frame()], decoder=binary_decoder
|
|
71
|
-
)
|
|
72
|
-
for hdu in hdus:
|
|
73
|
-
data = hdu
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/__init__.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/dags/scale.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/tasks/__init__.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/tasks/wait.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/tests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dkist_processing_ops-1.6.11 → dkist_processing_ops-1.6.13}/dkist_processing_ops/workflows/smoke.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|