dkist-processing-common 12.0.0rc6__tar.gz → 12.1.0__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.
Files changed (140) hide show
  1. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/.readthedocs.yml +1 -1
  2. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/CHANGELOG.rst +35 -0
  3. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/PKG-INFO +3 -3
  4. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/fits.py +27 -6
  5. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/constants.py +2 -2
  6. dkist_processing_common-12.1.0/dkist_processing_common/models/flower_pot.py +416 -0
  7. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/average_bud.py +0 -2
  8. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/cs_step.py +10 -10
  9. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/id_bud.py +4 -9
  10. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/lookup_bud.py +7 -11
  11. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/near_bud.py +7 -12
  12. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/retarder.py +9 -13
  13. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/time.py +19 -55
  14. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/unique_bud.py +7 -14
  15. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/parse_l0_input_data.py +4 -2
  16. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/transfer_input_data.py +1 -0
  17. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_codecs.py +57 -11
  18. dkist_processing_common-12.1.0/dkist_processing_common/tests/test_flower_pot.py +247 -0
  19. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_parse_l0_input_data.py +28 -4
  20. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_stems.py +140 -193
  21. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_workflow_task_base.py +0 -11
  22. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common.egg-info/PKG-INFO +3 -3
  23. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common.egg-info/SOURCES.txt +0 -1
  24. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common.egg-info/requires.txt +2 -2
  25. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/pyproject.toml +2 -2
  26. dkist_processing_common-12.0.0rc6/changelog/288.misc.rst +0 -1
  27. dkist_processing_common-12.0.0rc6/dkist_processing_common/models/flower_pot.py +0 -195
  28. dkist_processing_common-12.0.0rc6/dkist_processing_common/tests/test_flower_pot.py +0 -105
  29. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/.gitignore +0 -0
  30. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/.pre-commit-config.yaml +0 -0
  31. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/.snyk +0 -0
  32. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/README.rst +0 -0
  33. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/bitbucket-pipelines.yml +0 -0
  34. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/changelog/.gitempty +0 -0
  35. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/__init__.py +0 -0
  36. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/_util/__init__.py +0 -0
  37. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/_util/constants.py +0 -0
  38. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/_util/graphql.py +0 -0
  39. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/_util/scratch.py +0 -0
  40. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/_util/tags.py +0 -0
  41. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/__init__.py +0 -0
  42. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/array.py +0 -0
  43. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/asdf.py +0 -0
  44. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/basemodel.py +0 -0
  45. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/bytes.py +0 -0
  46. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/iobase.py +0 -0
  47. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/json.py +0 -0
  48. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/path.py +0 -0
  49. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/quality.py +0 -0
  50. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/codecs/str.py +0 -0
  51. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/config.py +0 -0
  52. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/fonts/Lato-Regular.ttf +0 -0
  53. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/fonts/__init__.py +0 -0
  54. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/manual.py +0 -0
  55. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/__init__.py +0 -0
  56. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/dkist_location.py +0 -0
  57. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/fits_access.py +0 -0
  58. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/fried_parameter.py +0 -0
  59. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/graphql.py +0 -0
  60. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/input_dataset.py +0 -0
  61. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/message.py +0 -0
  62. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/message_queue_binding.py +0 -0
  63. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/metric_code.py +0 -0
  64. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/parameters.py +0 -0
  65. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/quality.py +0 -0
  66. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/tags.py +0 -0
  67. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/task_name.py +0 -0
  68. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/telemetry.py +0 -0
  69. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/models/wavelength.py +0 -0
  70. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/__init__.py +0 -0
  71. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/dsps_repeat.py +0 -0
  72. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/experiment_id_bud.py +0 -0
  73. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/l0_fits_access.py +0 -0
  74. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/l1_fits_access.py +0 -0
  75. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/observing_program_id_bud.py +0 -0
  76. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/proposal_id_bud.py +0 -0
  77. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/quality.py +0 -0
  78. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/single_value_single_key_flower.py +0 -0
  79. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/task.py +0 -0
  80. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/parsers/wavelength.py +0 -0
  81. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/__init__.py +0 -0
  82. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/assemble_movie.py +0 -0
  83. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/base.py +0 -0
  84. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/l1_output_data.py +0 -0
  85. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/__init__.py +0 -0
  86. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/globus.py +0 -0
  87. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/interservice_bus.py +0 -0
  88. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/metadata_store.py +0 -0
  89. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/object_store.py +0 -0
  90. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/quality/__init__.py +0 -0
  91. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/quality/_base.py +0 -0
  92. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/mixin/quality/_metrics.py +0 -0
  93. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/output_data_base.py +0 -0
  94. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/quality_metrics.py +0 -0
  95. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/teardown.py +0 -0
  96. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/trial_catalog.py +0 -0
  97. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/trial_output_data.py +0 -0
  98. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tasks/write_l1.py +0 -0
  99. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/__init__.py +0 -0
  100. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/conftest.py +0 -0
  101. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/mock_metadata_store.py +0 -0
  102. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_assemble_movie.py +0 -0
  103. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_assemble_quality.py +0 -0
  104. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_base.py +0 -0
  105. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_constants.py +0 -0
  106. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_cs_step.py +0 -0
  107. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_dkist_location.py +0 -0
  108. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_fits_access.py +0 -0
  109. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_fried_parameter.py +0 -0
  110. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_input_dataset.py +0 -0
  111. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_interservice_bus.py +0 -0
  112. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_interservice_bus_mixin.py +0 -0
  113. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_manual_processing.py +0 -0
  114. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_output_data_base.py +0 -0
  115. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_parameters.py +0 -0
  116. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_publish_catalog_messages.py +0 -0
  117. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_quality.py +0 -0
  118. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_quality_mixin.py +0 -0
  119. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_scratch.py +0 -0
  120. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_submit_dataset_metadata.py +0 -0
  121. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_tags.py +0 -0
  122. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_task_name.py +0 -0
  123. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_task_parsing.py +0 -0
  124. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_teardown.py +0 -0
  125. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_transfer_input_data.py +0 -0
  126. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_transfer_l1_output_data.py +0 -0
  127. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_trial_catalog.py +0 -0
  128. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_trial_output_data.py +0 -0
  129. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common/tests/test_write_l1.py +0 -0
  130. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common.egg-info/dependency_links.txt +0 -0
  131. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/dkist_processing_common.egg-info/top_level.txt +0 -0
  132. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/docs/Makefile +0 -0
  133. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/docs/changelog.rst +0 -0
  134. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/docs/conf.py +0 -0
  135. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/docs/index.rst +0 -0
  136. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/docs/landing_page.rst +0 -0
  137. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/docs/make.bat +0 -0
  138. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/docs/requirements.txt +0 -0
  139. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/licenses/LICENSE.rst +0 -0
  140. {dkist_processing_common-12.0.0rc6 → dkist_processing_common-12.1.0}/setup.cfg +0 -0
@@ -2,7 +2,7 @@ version: 2
2
2
  build:
3
3
  os: ubuntu-20.04
4
4
  tools:
5
- python: "3.12"
5
+ python: "3.13"
6
6
  apt_packages:
7
7
  - libopenjp2-7
8
8
  - graphviz
@@ -1,3 +1,38 @@
1
+ v12.1.0 (2026-01-26)
2
+ ====================
3
+
4
+ Features
5
+ --------
6
+
7
+ - Add `ListStem` base class for huge speedup in cases where the keys don't matter and the `getter` logic only depends on the
8
+ list of values computed by `setter`. This is the case for most (all?) "Buds". (`#282 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/282>`__)
9
+ - Add `SetStem` base class that has all the benefits of `ListStem` but also gets a speedup by storing values in a `set` for
10
+ cases where repeated values don't need to be tracked. (`#282 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/282>`__)
11
+ - Speed up parsing of the `*CadenceBud`, `TaskDateBeginBud`, and `[Task]NearFloatBud` by basing these buds on `ListStem`. (`#284 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/284>`__)
12
+ - Speed up `NumCSStepBud`, `[Task]UniqueBud`, `[Task]ContributingIdsBud`, and `TaskRoundTimeBudBase` parsing by basing
13
+ these buds on `SetStem`. (`#285 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/285>`__)
14
+ - Speed up `CSStepFlower` parsing by using an internal set to keep track of the unique `CSStep` objects. This removes the
15
+ need to compute the unique set when computing the tag for each file. (`#286 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/286>`__)
16
+
17
+
18
+ Misc
19
+ ----
20
+
21
+ - Speed up the reading of INPUT files in Parse tasks by turning off image decompression and checksum checks. (`#280 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/280>`__)
22
+ - Update `RetarderNameBud` to drop "clear" values (i.e., the retarder is out of the beam) in the `setter` instead of the `getter`.
23
+ This brings it in line with standard Bud-practice. (`#285 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/285>`__)
24
+ - Convert the TimeLookupBud to be a SetStem constant. (`#287 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/287>`__)
25
+
26
+
27
+ v12.0.0 (2026-01-22)
28
+ ====================
29
+
30
+ Misc
31
+ ----
32
+
33
+ - Upgrade dkist-processing-core to 7.0.0 which includes an upgrade of Airflow to 3.1.5 and python >= 3.13. (`#278 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/278>`__)
34
+
35
+
1
36
  v11.9.3 (2026-01-07)
2
37
  ====================
3
38
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dkist-processing-common
3
- Version: 12.0.0rc6
3
+ Version: 12.1.0
4
4
  Summary: Common task classes used by the DKIST science data processing pipelines
5
5
  Author-email: NSO / AURA <dkistdc@nso.edu>
6
6
  License: BSD-3-Clause
@@ -17,9 +17,9 @@ Requires-Dist: asdf<4.0.0,>=3.5.0
17
17
  Requires-Dist: astropy>=7.0.0
18
18
  Requires-Dist: dkist-fits-specifications<5.0,>=4.0.0
19
19
  Requires-Dist: dkist-header-validator<6.0,>=5.0.0
20
- Requires-Dist: dkist-processing-core==7.0.0rc8
20
+ Requires-Dist: dkist-processing-core==7.0.1
21
21
  Requires-Dist: dkist-processing-pac<4.0,>=3.1
22
- Requires-Dist: dkist-service-configuration<5.0,>=4.1.7
22
+ Requires-Dist: dkist-service-configuration<5.0,>=4.2.0
23
23
  Requires-Dist: dkist-spectral-lines<4.0,>=3.0.0
24
24
  Requires-Dist: solar-wavelength-calibration<3.0,>=2.0.0
25
25
  Requires-Dist: globus-sdk<5.0.0,>=4.0.0
@@ -31,15 +31,30 @@ def fits_hdulist_encoder(hdu_list: fits.HDUList) -> bytes:
31
31
  return iobase_encoder(file_obj)
32
32
 
33
33
 
34
- def fits_hdu_decoder(path: Path, hdu: int | None = None) -> fits.PrimaryHDU | fits.CompImageHDU:
34
+ def fits_hdu_decoder(
35
+ path: Path,
36
+ hdu: int | None = None,
37
+ checksum: bool = True,
38
+ disable_image_compression: bool = False,
39
+ ) -> fits.PrimaryHDU | fits.CompImageHDU:
35
40
  """Read a Path with `fits` to produce an `HDUList`."""
36
- hdu_list = fits.open(path, checksum=True)
41
+ hdu_list = fits.open(
42
+ path, checksum=checksum, disable_image_compression=disable_image_compression
43
+ )
37
44
  return _extract_hdu(hdu_list, hdu)
38
45
 
39
46
 
40
- def fits_array_decoder(path: Path, hdu: int | None = None, auto_squeeze: bool = True) -> np.ndarray:
47
+ def fits_array_decoder(
48
+ path: Path,
49
+ hdu: int | None = None,
50
+ auto_squeeze: bool = True,
51
+ checksum: bool = True,
52
+ disable_image_compression: bool = False,
53
+ ) -> np.ndarray:
41
54
  """Read a Path with `fits` and return the `.data` property."""
42
- hdu = fits_hdu_decoder(path, hdu=hdu)
55
+ hdu = fits_hdu_decoder(
56
+ path, hdu=hdu, checksum=checksum, disable_image_compression=disable_image_compression
57
+ )
43
58
  data = hdu.data
44
59
 
45
60
  # This conditional is explicitly to catch summit data with a dummy first axis for WCS
@@ -50,10 +65,16 @@ def fits_array_decoder(path: Path, hdu: int | None = None, auto_squeeze: bool =
50
65
 
51
66
 
52
67
  def fits_access_decoder(
53
- path: Path, fits_access_class: Type[FitsAccessBase], **fits_access_kwargs
68
+ path: Path,
69
+ fits_access_class: Type[FitsAccessBase],
70
+ checksum: bool = True,
71
+ disable_image_compression: bool = False,
72
+ **fits_access_kwargs,
54
73
  ) -> FitsAccessBase:
55
74
  """Read a Path with `fits` and ingest into a `FitsAccessBase`-type object."""
56
- hdu = fits_hdu_decoder(path)
75
+ hdu = fits_hdu_decoder(
76
+ path, checksum=checksum, disable_image_compression=disable_image_compression
77
+ )
57
78
  return fits_access_class(hdu=hdu, name=str(path), **fits_access_kwargs)
58
79
 
59
80
 
@@ -333,8 +333,8 @@ class ConstantsBase:
333
333
  def dark_num_raw_frames_per_fpa(self) -> dict[float, list]:
334
334
  """Return the dictionary of exposure times to number of raw frames per fpa."""
335
335
  raw_return = self._db_dict[BudName.dark_num_raw_frames_per_fpa]
336
- # convert nested lists to dictionary
337
- return {k: v for k, v in raw_return}
336
+ # convert JSON string keys back to float
337
+ return {float(k): v for k, v in raw_return.items()}
338
338
 
339
339
  @property
340
340
  def solar_gain_num_raw_frames_per_fpa(self) -> int:
@@ -0,0 +1,416 @@
1
+ """
2
+ Framework for grouping multiple keys and values with arbitrary logic.
3
+
4
+ The key components are:
5
+ **Stem:** ABC for groupings that depend on both the key and (maybe) value. Subgroups (Petals) are implied but not enforced.
6
+
7
+ **ListStem:** ABC for groups that depend on value only. More limited, but faster than `Stem` for cases where the keys don't matter.
8
+
9
+ **SetStem:** ABC for groups that depend on value only and the values are well represented by a `set`. Even more limited, but faster than `Stem` for cases where the keys don't matter.
10
+
11
+ **FlowerPot:** Container for Stem children (Flowers)
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ from abc import ABC
17
+ from abc import abstractmethod
18
+ from collections import defaultdict
19
+ from collections.abc import Hashable
20
+ from typing import Any
21
+
22
+
23
+ class FlowerPot:
24
+ """Base class to hold multiple sets (Stems) of key, value pairs."""
25
+
26
+ def __init__(self):
27
+ self.stems: list[Stem] = list()
28
+
29
+ def __iter__(self):
30
+ return self.stems.__iter__()
31
+
32
+ def __len__(self):
33
+ return self.stems.__len__()
34
+
35
+ def __getitem__(self, item):
36
+ return self.stems.__getitem__(item)
37
+
38
+ def add_dirt(self, key: Hashable, value: Any) -> None:
39
+ """
40
+ Send key and value through all Stems.
41
+
42
+ Parameters
43
+ ----------
44
+ key
45
+ The key
46
+ value
47
+ The value
48
+
49
+ Returns
50
+ -------
51
+ None
52
+ """
53
+ if not isinstance(key, Hashable):
54
+ raise TypeError(f"Type of key ({type(key)}) is not hashable")
55
+
56
+ for stem in self.stems:
57
+ stem.update(key, value)
58
+
59
+
60
+ class SpilledDirt:
61
+ """
62
+ A custom class for when a Stem wants the FlowerPot to skip that particular key/value.
63
+
64
+ Exists because None, False, [], (), etc. etc. are all valid Stem return values
65
+ """
66
+
67
+
68
+ class Thorn:
69
+ """
70
+ Custom class to indicate that a Bud's value should not be used.
71
+
72
+ I.e., don't pick this Bud because it's thorny. This exists for "Picky" Buds that merely perform a check and Error
73
+ on failure. If the check passes we don't need to do anything with the Bud's value and that value should be a Thorn.
74
+ """
75
+
76
+
77
+ class Petal:
78
+ """
79
+ Base class to hold a single key, value pair.
80
+
81
+ Parameters
82
+ ----------
83
+ item
84
+ The key, value pair to be added
85
+ """
86
+
87
+ def __init__(self, item: tuple):
88
+ self.value = item[0]
89
+ self.keys = item[1]
90
+
91
+ def __repr__(self):
92
+ return f"Petal: {{{self.value}: {self.keys}}}"
93
+
94
+
95
+ class Stem(ABC):
96
+ """
97
+ Base class for grouping keys via arbitrary logic on the total collection of keys and values.
98
+
99
+ Parameters
100
+ ----------
101
+ stem_name
102
+ The name to be associated with the stem
103
+ """
104
+
105
+ def __init__(self, stem_name: Any):
106
+ self.stem_name = stem_name
107
+ self.key_to_petal_dict: dict[Hashable, Hashable] = dict()
108
+
109
+ self._petal_cache: list[Petal] = []
110
+ self._need_to_generate_petals: bool = True
111
+
112
+ def update(self, key: Hashable, value: Any) -> None:
113
+ """
114
+ Ingest a single key/value pair.
115
+
116
+ Parameters
117
+ ----------
118
+ key
119
+ The key
120
+ value
121
+ The value
122
+
123
+ Returns
124
+ -------
125
+ None
126
+ """
127
+ result = self.setter(value)
128
+ if result is not SpilledDirt:
129
+ self.key_to_petal_dict[key] = result
130
+ self._need_to_generate_petals = True
131
+
132
+ @property
133
+ def petals(self) -> list[Petal]:
134
+ """Return subgroups and associated keys."""
135
+ if self._need_to_generate_petals:
136
+ self._generate_petal_list()
137
+
138
+ return self._petal_cache
139
+
140
+ @property
141
+ def can_be_picked(self) -> bool:
142
+ """
143
+ Return True if there are any values to be picked.
144
+
145
+ A `Stem` could have no values even after dirt is added if all of the results were `SpilledDirt`.
146
+ """
147
+ return len(self.petals) > 0
148
+
149
+ def _generate_petal_list(self) -> None:
150
+ """
151
+ Generate a list of petals.
152
+
153
+ Generating a petal list can be expensive because it involves inverting the `key_to_petal_dict`. To avoid doing
154
+ this every the `petals` property is accessed, this method produces a cached list of petals that is only
155
+ re-generated when the `key_to_petal_dict` has been updated.
156
+
157
+ Note: We can't make `petals` a `@cached_property` because that would make `petals` always tied to whatever the
158
+ state of this `Stem` was when `petals` was first accessed. And we can't use `lru_cache` because the object that
159
+ changes, `key_to_petal_dict`, is unhashable.
160
+ """
161
+ petal_to_key_dict = defaultdict(list)
162
+ for key in self.key_to_petal_dict.keys():
163
+ petal = self.getter(key)
164
+ petal_to_key_dict[petal].append(key)
165
+
166
+ self._petal_cache = [Petal(item) for item in petal_to_key_dict.items()]
167
+ self._need_to_generate_petals = False
168
+
169
+ @property
170
+ def bud(self) -> Petal:
171
+ """Just the first petal."""
172
+ bud = self.petals[0]
173
+ return bud
174
+
175
+ @abstractmethod
176
+ def setter(self, value: Any) -> Any:
177
+ """
178
+ Logic to apply to a single key/value pair on ingest.
179
+
180
+ Implemented in derived class.
181
+
182
+ Parameters
183
+ ----------
184
+ value
185
+ The value to be added
186
+
187
+ Returns
188
+ -------
189
+ Any
190
+ """
191
+ pass
192
+
193
+ @abstractmethod
194
+ def getter(self, key: Hashable) -> Hashable:
195
+ """
196
+ Logic to apply to all ingested values when picking the Stem.
197
+
198
+ Implemented in derived class.
199
+
200
+ Parameters
201
+ ----------
202
+ key
203
+ The key to return the value of
204
+ Returns
205
+ -------
206
+ The value
207
+ """
208
+ pass
209
+
210
+
211
+ class ListStem(ABC):
212
+ """
213
+ Base class for collecting and applying logic to values in a `list` with a `Stem`-like interface.
214
+
215
+ Unlike the full `Stem`, this class does NOT retain information about the keys and thus does no grouping of keys based
216
+ on values. The direct consequence of this is that the `.petals` property is undefined and will raise an ``AttributeError``
217
+ if accessed. This also means there is no need to invert the `key_to_petal_dict` (because it doesn't exist), which,
218
+ in turn, means there is no need to run the `getter` for every key. The result is that the `bud` property only needs
219
+ one call to `getter`. Thus, the calculation of a single value derived from all values (i.e., `bud`) is much faster
220
+ than using a full `Stem`.
221
+
222
+ Parameters
223
+ ----------
224
+ stem_name
225
+ The name to be associated with the stem
226
+ """
227
+
228
+ def __init__(self, stem_name: Any):
229
+ self.stem_name = stem_name
230
+ self.value_list: list = list()
231
+ self._need_to_compute_bud_value: bool = True
232
+
233
+ def update(self, key: Any, value: Any) -> None:
234
+ """
235
+ Ingest a single key/value pair. Note that the ``key`` is not used.
236
+
237
+ Parameters
238
+ ----------
239
+ key
240
+ The key (unused)
241
+
242
+ value
243
+ The value
244
+
245
+ Returns
246
+ -------
247
+ None
248
+ """
249
+ result = self.setter(value)
250
+ if result is not SpilledDirt:
251
+ self.value_list.append(result)
252
+ self._need_to_compute_bud_value = True
253
+
254
+ @property
255
+ def petals(self) -> None:
256
+ """Raise an error because `ListStem` does not retain key information and therefore cannot group keys."""
257
+ raise AttributeError(
258
+ f"{self.__class__.__name__} subclasses ListStem and therefore does not define the `petals` property"
259
+ )
260
+
261
+ @property
262
+ def can_be_picked(self) -> bool:
263
+ """
264
+ Return True if there are any values to be picked.
265
+
266
+ A `Stem` could have no values even after dirt is added if all of the results were `SpilledDirt`.
267
+ """
268
+ return len(self.value_list) > 0
269
+
270
+ @property
271
+ def bud(self) -> Petal:
272
+ """Return the result of `getter` packaged in a `Petal` object."""
273
+ if self._need_to_compute_bud_value:
274
+ self._value_cache = self.getter()
275
+ self._need_to_compute_bud_value = False
276
+
277
+ return Petal((self._value_cache, "LISTSTEM_NOT_USED"))
278
+
279
+ @abstractmethod
280
+ def setter(self, value: Any) -> Any:
281
+ """
282
+ Logic to apply to a single value pair on ingest.
283
+
284
+ Implemented in derived class.
285
+
286
+ Parameters
287
+ ----------
288
+ value
289
+ The value to be added
290
+
291
+ Returns
292
+ -------
293
+ Any
294
+ """
295
+ pass
296
+
297
+ @abstractmethod
298
+ def getter(self) -> Any:
299
+ """
300
+ Logic to apply to all ingested values when computing the `bud`.
301
+
302
+ Implemented in derived class.
303
+
304
+ Returns
305
+ -------
306
+ The value of the bud
307
+ """
308
+ pass
309
+
310
+
311
+ class SetStem(ABC):
312
+ """
313
+ Base class for collecting and applying logic to values in a `set` with a `Stem`-like interface.
314
+
315
+ Unlike the full `Stem`, this class does NOT retain information about the keys and thus does no grouping of keys based
316
+ on values. The direct consequence of this is that the `.petals` property is undefined and will raise an ``AttributeError``
317
+ if accessed. This also means there is no need to invert the `key_to_petal_dict` (because it doesn't exist), which,
318
+ in turn, means there is no need to run the `getter` for every key. The result is that the `bud` property only needs
319
+ one call to `getter`. Combined with the efficiency of storing values in a `set`, the calculation of a single value
320
+ derived from all values (i.e., `bud`) is much faster than using a full `Stem`.
321
+
322
+ .. Note::
323
+ The use of a `set` as the underlying storage mechanism means information regarding how many times a particular value
324
+ is present will be lost. It also means the return type of `setter` must be hashable. Both of these constraints can
325
+ be avoided by using `ListStem`, which still gets a significant speedup over `Stem` by dropping key information.
326
+
327
+
328
+ Parameters
329
+ ----------
330
+ stem_name
331
+ The name to be associated with the stem
332
+ """
333
+
334
+ def __init__(self, stem_name: Any):
335
+ self.stem_name = stem_name
336
+ self.value_set: set = set()
337
+ self._need_to_compute_bud_value: bool = True
338
+
339
+ def update(self, key: Any, value: Any) -> None:
340
+ """
341
+ Ingest a single key/value pair. Note that the ``key`` is not used.
342
+
343
+ Parameters
344
+ ----------
345
+ key
346
+ The key (unused)
347
+
348
+ value
349
+ The value
350
+
351
+ Returns
352
+ -------
353
+ None
354
+ """
355
+ result = self.setter(value)
356
+ if result is not SpilledDirt:
357
+ self.value_set.add(result)
358
+ self._need_to_compute_bud_value = True
359
+
360
+ @property
361
+ def petals(self) -> None:
362
+ """Raise an error because `SetStem` does not retain key information and therefore cannot group keys."""
363
+ raise AttributeError(
364
+ f"{self.__class__.__name__} subclasses SetStem and therefore does not define the `petals` property"
365
+ )
366
+
367
+ @property
368
+ def can_be_picked(self) -> bool:
369
+ """
370
+ Return True if there are any values to be picked.
371
+
372
+ A `Stem` could have no values even after dirt is added if all of the results were `SpilledDirt`.
373
+ """
374
+ return len(self.value_set) > 0
375
+
376
+ @property
377
+ def bud(self) -> Petal:
378
+ """Return the result of `getter` packaged in a `Petal` object."""
379
+ if self._need_to_compute_bud_value:
380
+ self._value_cache = self.getter()
381
+ self._need_to_compute_bud_value = False
382
+
383
+ return Petal((self._value_cache, "SETSTEM_NOT_USED"))
384
+
385
+ @abstractmethod
386
+ def setter(self, value: Any) -> Hashable:
387
+ """
388
+ Logic to apply to a single value pair on ingest.
389
+
390
+ Must return a Hashable object because the result will be stored in a `set`.
391
+
392
+ Implemented in derived class.
393
+
394
+ Parameters
395
+ ----------
396
+ value
397
+ The value to be added
398
+
399
+ Returns
400
+ -------
401
+ Any
402
+ """
403
+ pass
404
+
405
+ @abstractmethod
406
+ def getter(self) -> Any:
407
+ """
408
+ Logic to apply to all ingested values when computing the `bud`.
409
+
410
+ Implemented in derived class.
411
+
412
+ Returns
413
+ -------
414
+ The value of the bud
415
+ """
416
+ pass
@@ -30,8 +30,6 @@ class TaskAverageBud(TaskNearFloatBud):
30
30
  The function used to convert a header into an IP task type
31
31
  """
32
32
 
33
- key_to_petal_dict: dict[str, float]
34
-
35
33
  def __init__(
36
34
  self,
37
35
  constant_name: str,
@@ -7,6 +7,7 @@ from datetime import timezone
7
7
  from typing import Type
8
8
 
9
9
  from dkist_processing_common.models.constants import BudName
10
+ from dkist_processing_common.models.flower_pot import SetStem
10
11
  from dkist_processing_common.models.flower_pot import SpilledDirt
11
12
  from dkist_processing_common.models.flower_pot import Stem
12
13
  from dkist_processing_common.models.tags import StemName
@@ -103,6 +104,7 @@ class CSStepFlower(Stem):
103
104
  def __init__(self, max_cs_step_time_sec: float):
104
105
  super().__init__(stem_name=StemName.cs_step)
105
106
  self.max_cs_step_time_sec = max_cs_step_time_sec
107
+ self.CS_step_set = set()
106
108
 
107
109
  def setter(self, fits_obj: L0FitsAccess) -> CSStep | Type[SpilledDirt]:
108
110
  """
@@ -119,7 +121,10 @@ class CSStepFlower(Stem):
119
121
  """
120
122
  if fits_obj.ip_task_type != "polcal":
121
123
  return SpilledDirt
122
- return CSStep(fits_obj, max_cs_time_sec=self.max_cs_step_time_sec)
124
+
125
+ cs_step = CSStep(fits_obj, max_cs_time_sec=self.max_cs_step_time_sec)
126
+ self.CS_step_set.add(cs_step)
127
+ return cs_step
123
128
 
124
129
  def getter(self, key) -> str | float | int:
125
130
  """
@@ -133,11 +138,11 @@ class CSStepFlower(Stem):
133
138
  -------
134
139
  The cs step for the given key
135
140
  """
136
- unique_steps = sorted(list(set(self.key_to_petal_dict.values())))
141
+ unique_steps = sorted(self.CS_step_set)
137
142
  return unique_steps.index(self.key_to_petal_dict[key])
138
143
 
139
144
 
140
- class NumCSStepBud(Stem):
145
+ class NumCSStepBud(SetStem):
141
146
  """
142
147
  The total number of CS Steps present in a dataset.
143
148
 
@@ -168,17 +173,12 @@ class NumCSStepBud(Stem):
168
173
  return SpilledDirt
169
174
  return CSStep(fits_obj, max_cs_time_sec=self.max_cs_step_time_sec)
170
175
 
171
- def getter(self, key) -> int:
176
+ def getter(self) -> int:
172
177
  """
173
178
  Return the number of CS Steps present.
174
179
 
175
- Parameters
176
- ----------
177
- key
178
- The input key
179
180
  Returns
180
181
  -------
181
182
  The number of cs steps associated with the key
182
183
  """
183
- value_set = set(self.key_to_petal_dict.values())
184
- return len(value_set)
184
+ return len(self.value_set)
@@ -4,13 +4,13 @@ from enum import StrEnum
4
4
  from typing import Callable
5
5
  from typing import Type
6
6
 
7
+ from dkist_processing_common.models.flower_pot import SetStem
7
8
  from dkist_processing_common.models.flower_pot import SpilledDirt
8
- from dkist_processing_common.models.flower_pot import Stem
9
9
  from dkist_processing_common.parsers.l0_fits_access import L0FitsAccess
10
10
  from dkist_processing_common.parsers.task import passthrough_header_ip_task
11
11
 
12
12
 
13
- class ContributingIdsBud(Stem):
13
+ class ContributingIdsBud(SetStem):
14
14
  """Base class for contributing ID buds."""
15
15
 
16
16
  def __init__(self, constant_name: str, metadata_key: str | StrEnum):
@@ -33,20 +33,15 @@ class ContributingIdsBud(Stem):
33
33
  """
34
34
  return getattr(fits_obj, self.metadata_key)
35
35
 
36
- def getter(self, key) -> tuple[str, ...]:
36
+ def getter(self) -> tuple[str, ...]:
37
37
  """
38
38
  Get all ids seen for any type of frame.
39
39
 
40
- Parameters
41
- ----------
42
- key
43
- The input key
44
-
45
40
  Returns
46
41
  -------
47
42
  IDs from all types of frames
48
43
  """
49
- return tuple(set(self.key_to_petal_dict.values()))
44
+ return tuple(self.value_set)
50
45
 
51
46
 
52
47
  class TaskContributingIdsBud(ContributingIdsBud):