dkist-processing-ops 1.6.6rc1__tar.gz → 1.6.7__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.

Files changed (27) hide show
  1. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/PKG-INFO +1 -1
  2. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/_version.py +2 -2
  3. dkist_processing_ops-1.6.7/dkist_processing_ops/tasks/read_memory_leak.py +51 -0
  4. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops.egg-info/PKG-INFO +1 -1
  5. dkist_processing_ops-1.6.6rc1/dkist_processing_ops/tasks/read_memory_leak.py +0 -55
  6. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/.gitignore +0 -0
  7. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/.pre-commit-config.yaml +0 -0
  8. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/LICENSE.rst +0 -0
  9. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/MANIFEST.in +0 -0
  10. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/README.rst +0 -0
  11. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/bitbucket-pipelines.yml +0 -0
  12. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/__init__.py +0 -0
  13. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/dags/scale.py +0 -0
  14. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/tasks/__init__.py +0 -0
  15. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/tasks/wait.py +0 -0
  16. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/tests/__init__.py +0 -0
  17. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/tests/test_workflows.py +0 -0
  18. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/workflows/__init__.py +0 -0
  19. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/workflows/memory_leak.py +0 -0
  20. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops/workflows/smoke.py +0 -0
  21. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops.egg-info/SOURCES.txt +0 -0
  22. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops.egg-info/dependency_links.txt +0 -0
  23. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops.egg-info/not-zip-safe +0 -0
  24. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops.egg-info/requires.txt +0 -0
  25. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/dkist_processing_ops.egg-info/top_level.txt +0 -0
  26. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/pyproject.toml +0 -0
  27. {dkist_processing_ops-1.6.6rc1 → dkist_processing_ops-1.6.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dkist-processing-ops
3
- Version: 1.6.6rc1
3
+ Version: 1.6.7
4
4
  Summary: Automated Processing smoke test and operations workflows
5
5
  Author-email: NSO / AURA <dkistdc@nso.edu>
6
6
  License: BSD 3-Clause
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.6.6rc1'
16
- __version_tuple__ = version_tuple = (1, 6, 6)
15
+ __version__ = version = '1.6.7'
16
+ __version_tuple__ = version_tuple = (1, 6, 7)
@@ -0,0 +1,51 @@
1
+ import os
2
+ from abc import ABC
3
+ from pathlib import Path
4
+ from typing import Any
5
+ from typing import Generator
6
+
7
+ import numpy as np
8
+ from astropy.io import fits
9
+ from dkist_processing_common.codecs.fits import fits_hdu_decoder
10
+ from dkist_processing_common.codecs.path import path_decoder
11
+ from dkist_processing_common.models.tags import Tag
12
+ from dkist_processing_common.tasks import tag_type_hint
13
+ from dkist_processing_common.tasks import WorkflowTaskBase
14
+
15
+
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))
20
+
21
+
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
25
+
26
+
27
+ class FitsDataRead(WorkflowTaskBase, ABC):
28
+ @property
29
+ def data_type(self) -> str:
30
+ """Recipe run configuration indicating how fFITS data should be read."""
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")
36
+
37
+ def run(self) -> None:
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dkist-processing-ops
3
- Version: 1.6.6rc1
3
+ Version: 1.6.7
4
4
  Summary: Automated Processing smoke test and operations workflows
5
5
  Author-email: NSO / AURA <dkistdc@nso.edu>
6
6
  License: BSD 3-Clause
@@ -1,55 +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.models.tags import Tag
8
- from dkist_processing_common.tasks import WorkflowTaskBase
9
-
10
-
11
- def _extract_hdu(hdul: fits.HDUList) -> fits.PrimaryHDU | fits.CompImageHDU:
12
- """Return the fits hdu associated with the data in the hdu list."""
13
- if hdul[0].data is not None:
14
- return hdul[0]
15
- return hdul[1]
16
-
17
-
18
- def fits_hdu_decoder_with_close(path: Path) -> fits.PrimaryHDU | fits.CompImageHDU:
19
- """Read a Path with `fits` to produce an `HDUList`."""
20
- hdu_list = fits.open(path, memmap=False)
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
33
-
34
-
35
- class FitsDataRead(WorkflowTaskBase, ABC):
36
- @property
37
- def fits_data_read_strategy(self) -> str:
38
- """Recipe run configuration indicating how fFITS data should be read."""
39
- return self.metadata_store_recipe_run_configuration().get(
40
- "fits_data_read_strategy", "leave_open"
41
- )
42
-
43
- def run(self) -> None:
44
- if self.fits_data_read_strategy == "leave_open":
45
- hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder)
46
- if self.fits_data_read_strategy == "close":
47
- hdus = self.read(tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder_with_close)
48
- if self.fits_data_read_strategy == "close_and_del":
49
- hdus = self.read(
50
- tags=[Tag.input(), Tag.frame()], decoder=fits_hdu_decoder_with_close_and_del
51
- )
52
- for hdu in hdus:
53
- data = hdu.data
54
- header = hdu.header
55
- total = np.sum(data)