dkist-processing-ops 1.6.13__tar.gz → 1.6.14__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.13 → dkist_processing_ops-1.6.14}/PKG-INFO +1 -1
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/_version.py +2 -2
- dkist_processing_ops-1.6.14/dkist_processing_ops/tasks/read_memory_leak.py +74 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops.egg-info/PKG-INFO +1 -1
- dkist_processing_ops-1.6.13/dkist_processing_ops/tasks/read_memory_leak.py +0 -49
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/.gitignore +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/.pre-commit-config.yaml +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/LICENSE.rst +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/MANIFEST.in +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/README.rst +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/bitbucket-pipelines.yml +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/__init__.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/dags/scale.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/tasks/__init__.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/tasks/wait.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/tests/__init__.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/tests/test_workflows.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/workflows/__init__.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/workflows/memory_leak.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/workflows/smoke.py +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops.egg-info/SOURCES.txt +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops.egg-info/dependency_links.txt +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops.egg-info/not-zip-safe +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops.egg-info/requires.txt +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops.egg-info/top_level.txt +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/pyproject.toml +0 -0
- {dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/setup.cfg +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import gc
|
|
2
|
+
from abc import ABC
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
from astropy.io import fits
|
|
7
|
+
from dkist_processing_common.codecs.fits import fits_hdu_decoder
|
|
8
|
+
from dkist_processing_common.codecs.path import path_decoder
|
|
9
|
+
from dkist_processing_common.models.tags import Tag
|
|
10
|
+
from dkist_processing_common.tasks import WorkflowTaskBase
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def generated_hdu_decoder(path: Path) -> fits.PrimaryHDU | fits.CompImageHDU:
|
|
14
|
+
data = np.random.rand(4096, 4096)
|
|
15
|
+
hdu = fits.CompImageHDU(data)
|
|
16
|
+
return hdu
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def fits_garbage_collect_hdu_decoder(path: Path) -> fits.PrimaryHDU | fits.CompImageHDU:
|
|
20
|
+
hdul = fits.open(path)
|
|
21
|
+
hdu = fits.CompImageHDU(header=hdul[1].header, data=hdul[1].data)
|
|
22
|
+
hdul.close()
|
|
23
|
+
del hdul
|
|
24
|
+
gc.collect()
|
|
25
|
+
return hdu
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class FitsDataRead(WorkflowTaskBase, ABC):
|
|
29
|
+
@property
|
|
30
|
+
def run_type(self):
|
|
31
|
+
return self.metadata_store_recipe_run_configuration().get("run_type", "file_read")
|
|
32
|
+
|
|
33
|
+
def run(self) -> None:
|
|
34
|
+
if self.run_type == "garbage_collect_read":
|
|
35
|
+
hdus = self.read(
|
|
36
|
+
tags=[Tag.input(), Tag.frame()], decoder=fits_garbage_collect_hdu_decoder
|
|
37
|
+
)
|
|
38
|
+
for hdu in hdus:
|
|
39
|
+
h = hdu.header
|
|
40
|
+
d = hdu.data
|
|
41
|
+
|
|
42
|
+
if self.run_type == "garbage_collect_task":
|
|
43
|
+
filepaths = self.read(tags=[Tag.input(), Tag.frame()], decoder=path_decoder)
|
|
44
|
+
for filepath in filepaths:
|
|
45
|
+
hdu = fits_garbage_collect_hdu_decoder(filepath)
|
|
46
|
+
h = hdu.header
|
|
47
|
+
d = hdu.data
|
|
48
|
+
|
|
49
|
+
if self.run_type == "file_read":
|
|
50
|
+
hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder)
|
|
51
|
+
for hdu in hdus:
|
|
52
|
+
h = hdu.header
|
|
53
|
+
d = hdu.data
|
|
54
|
+
#
|
|
55
|
+
# if self.run_type == "generated_read":
|
|
56
|
+
# hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=generated_hdu_decoder)
|
|
57
|
+
# for hdu in hdus:
|
|
58
|
+
# h = hdu.header
|
|
59
|
+
# d = hdu.data
|
|
60
|
+
#
|
|
61
|
+
# if self.run_type == "file_task":
|
|
62
|
+
# filepaths = self.read(tags=[Tag.input(), Tag.frame()], decoder=path_decoder)
|
|
63
|
+
# for filepath in filepaths:
|
|
64
|
+
# hdu = fits.open(filepath)[1]
|
|
65
|
+
# h = hdu.header
|
|
66
|
+
# d = hdu.data
|
|
67
|
+
#
|
|
68
|
+
# if self.run_type == "generated_task":
|
|
69
|
+
# filepaths = self.read(tags=[Tag.input(), Tag.frame()], decoder=path_decoder)
|
|
70
|
+
# for filepath in filepaths:
|
|
71
|
+
# data = np.random.rand(4096, 4096)
|
|
72
|
+
# hdu = fits.CompImageHDU(data)
|
|
73
|
+
# h = hdu.header
|
|
74
|
+
# d = hdu.data
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/__init__.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/dags/scale.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/tasks/__init__.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/tasks/wait.py
RENAMED
|
File without changes
|
{dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/dkist_processing_ops/tests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dkist_processing_ops-1.6.13 → dkist_processing_ops-1.6.14}/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
|