dkist-processing-common 11.1.0rc1__tar.gz → 11.2.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 (134) hide show
  1. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/CHANGELOG.rst +38 -0
  2. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/PKG-INFO +1 -1
  3. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/graphql.py +5 -0
  4. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/assemble_movie.py +2 -2
  5. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/quality/_metrics.py +15 -6
  6. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/write_l1.py +9 -1
  7. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_quality_mixin.py +6 -2
  8. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_workflow_task_base.py +2 -3
  9. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_write_l1.py +1 -1
  10. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common.egg-info/PKG-INFO +1 -1
  11. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common.egg-info/SOURCES.txt +0 -1
  12. dkist_processing_common-11.1.0rc1/changelog/255.misc.rst +0 -3
  13. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/.gitignore +0 -0
  14. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/.pre-commit-config.yaml +0 -0
  15. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/.readthedocs.yml +0 -0
  16. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/.snyk +0 -0
  17. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/README.rst +0 -0
  18. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/bitbucket-pipelines.yml +0 -0
  19. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/changelog/.gitempty +0 -0
  20. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/__init__.py +0 -0
  21. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/_util/__init__.py +0 -0
  22. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/_util/constants.py +0 -0
  23. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/_util/graphql.py +0 -0
  24. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/_util/scratch.py +0 -0
  25. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/_util/tags.py +0 -0
  26. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/__init__.py +0 -0
  27. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/array.py +0 -0
  28. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/asdf.py +0 -0
  29. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/basemodel.py +0 -0
  30. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/bytes.py +0 -0
  31. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/fits.py +0 -0
  32. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/iobase.py +0 -0
  33. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/json.py +0 -0
  34. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/path.py +0 -0
  35. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/quality.py +0 -0
  36. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/codecs/str.py +0 -0
  37. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/config.py +0 -0
  38. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/fonts/Lato-Regular.ttf +0 -0
  39. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/fonts/__init__.py +0 -0
  40. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/manual.py +0 -0
  41. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/__init__.py +0 -0
  42. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/constants.py +0 -0
  43. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/dkist_location.py +0 -0
  44. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/fits_access.py +0 -0
  45. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/flower_pot.py +0 -0
  46. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/fried_parameter.py +0 -0
  47. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/input_dataset.py +0 -0
  48. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/message.py +0 -0
  49. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/message_queue_binding.py +0 -0
  50. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/metric_code.py +0 -0
  51. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/parameters.py +0 -0
  52. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/quality.py +0 -0
  53. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/tags.py +0 -0
  54. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/task_name.py +0 -0
  55. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/models/wavelength.py +0 -0
  56. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/__init__.py +0 -0
  57. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/cs_step.py +0 -0
  58. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/dsps_repeat.py +0 -0
  59. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/experiment_id_bud.py +0 -0
  60. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/id_bud.py +0 -0
  61. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/l0_fits_access.py +0 -0
  62. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/l1_fits_access.py +0 -0
  63. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/near_bud.py +0 -0
  64. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/proposal_id_bud.py +0 -0
  65. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/quality.py +0 -0
  66. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/retarder.py +0 -0
  67. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/single_value_single_key_flower.py +0 -0
  68. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/task.py +0 -0
  69. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/time.py +0 -0
  70. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/unique_bud.py +0 -0
  71. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/parsers/wavelength.py +0 -0
  72. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/__init__.py +0 -0
  73. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/base.py +0 -0
  74. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/l1_output_data.py +0 -0
  75. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/__init__.py +0 -0
  76. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/globus.py +0 -0
  77. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/interservice_bus.py +0 -0
  78. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/metadata_store.py +0 -0
  79. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/object_store.py +0 -0
  80. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/quality/__init__.py +0 -0
  81. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/mixin/quality/_base.py +0 -0
  82. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/output_data_base.py +0 -0
  83. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/parse_l0_input_data.py +0 -0
  84. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/quality_metrics.py +0 -0
  85. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/teardown.py +0 -0
  86. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/transfer_input_data.py +0 -0
  87. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/trial_catalog.py +0 -0
  88. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tasks/trial_output_data.py +0 -0
  89. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/__init__.py +0 -0
  90. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/conftest.py +0 -0
  91. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/mock_metadata_store.py +0 -0
  92. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_assemble_movie.py +0 -0
  93. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_assemble_quality.py +0 -0
  94. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_base.py +0 -0
  95. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_codecs.py +0 -0
  96. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_constants.py +0 -0
  97. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_cs_step.py +0 -0
  98. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_dkist_location.py +0 -0
  99. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_fits_access.py +0 -0
  100. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_flower_pot.py +0 -0
  101. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_fried_parameter.py +0 -0
  102. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_input_dataset.py +0 -0
  103. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_interservice_bus.py +0 -0
  104. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_interservice_bus_mixin.py +0 -0
  105. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_manual_processing.py +0 -0
  106. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_output_data_base.py +0 -0
  107. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_parameters.py +0 -0
  108. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_parse_l0_input_data.py +0 -0
  109. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_publish_catalog_messages.py +0 -0
  110. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_quality.py +0 -0
  111. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_scratch.py +0 -0
  112. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_stems.py +0 -0
  113. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_submit_dataset_metadata.py +0 -0
  114. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_tags.py +0 -0
  115. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_task_name.py +0 -0
  116. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_task_parsing.py +0 -0
  117. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_teardown.py +0 -0
  118. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_transfer_input_data.py +0 -0
  119. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_transfer_l1_output_data.py +0 -0
  120. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_trial_catalog.py +0 -0
  121. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common/tests/test_trial_output_data.py +0 -0
  122. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common.egg-info/dependency_links.txt +0 -0
  123. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common.egg-info/requires.txt +0 -0
  124. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/dkist_processing_common.egg-info/top_level.txt +0 -0
  125. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/docs/Makefile +0 -0
  126. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/docs/changelog.rst +0 -0
  127. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/docs/conf.py +0 -0
  128. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/docs/index.rst +0 -0
  129. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/docs/landing_page.rst +0 -0
  130. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/docs/make.bat +0 -0
  131. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/docs/requirements.txt +0 -0
  132. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/licenses/LICENSE.rst +0 -0
  133. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/pyproject.toml +0 -0
  134. {dkist_processing_common-11.1.0rc1 → dkist_processing_common-11.2.0}/setup.cfg +0 -0
@@ -1,3 +1,41 @@
1
+ v11.2.0 (2025-07-18)
2
+ ====================
3
+
4
+ Bugfixes
5
+ --------
6
+
7
+ - Move the writing of spectral line keys in L1 data to later in the process, after the instruments have had a chance to rewrite the WCS info. (`#252 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/252>`__)
8
+
9
+
10
+ v11.1.0 (2025-07-15)
11
+ ====================
12
+
13
+ Misc
14
+ ----
15
+
16
+ - The graphql and input dataset models are now set to validate whenever attributes are assigned, including after instantiation. (`#255 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/255>`__)
17
+ - Create a factory for custom `FakeGQLClient` used in tests. The factory and associated default returns live in a
18
+ new `mock_metadata_store.py` module in the tests directory. `FakeGQLClient` is now a test fixture and does not need to
19
+ be imported in tests. (`#255 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/255>`__)
20
+ - Fix a Pydantic warning in the graphql model. Because we validate the `RecipeRunConfiguration` as a JSON dictionary and
21
+ convert it to a model after validation, we need a serializer so Pydantic knows what to expect back out. (`#258 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/258>`__)
22
+
23
+
24
+ v11.0.1 (2025-07-10)
25
+ ====================
26
+
27
+ Bugfixes
28
+ --------
29
+
30
+ - Ignore NaN and Inf values when storing the quality results of a wavelength calibration fit. (`#260 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/260>`__)
31
+
32
+
33
+ Misc
34
+ ----
35
+
36
+ - Removing usages of `pkg_resources`, which is on track to be deprecated. (`#254 <https://bitbucket.org/dkistdc/dkist-processing-common/pull-requests/254>`__)
37
+
38
+
1
39
  v11.0.0 (2025-07-02)
2
40
  ====================
3
41
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dkist-processing-common
3
- Version: 11.1.0rc1
3
+ Version: 11.2.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
@@ -1,6 +1,7 @@
1
1
  """GraphQL Data models for the metadata store api."""
2
2
  from pydantic import BaseModel
3
3
  from pydantic import ConfigDict
4
+ from pydantic import field_serializer
4
5
  from pydantic import field_validator
5
6
  from pydantic import Json
6
7
 
@@ -129,6 +130,10 @@ class RecipeRunResponse(GraphqlBaseModel):
129
130
  return RecipeRunConfiguration()
130
131
  return RecipeRunConfiguration.model_validate(value)
131
132
 
133
+ @field_serializer("configuration")
134
+ def _serialize_as_basemodel(self, config: RecipeRunConfiguration):
135
+ return config.model_dump()
136
+
132
137
 
133
138
  class RecipeRunMutationResponse(GraphqlBaseModel):
134
139
  """Recipe run mutation response."""
@@ -2,10 +2,10 @@
2
2
  import logging
3
3
  from abc import ABC
4
4
  from abc import abstractmethod
5
+ from importlib.resources import files
5
6
  from typing import Literal
6
7
 
7
8
  import numpy as np
8
- import pkg_resources
9
9
  from matplotlib import colormaps
10
10
  from moviepy import VideoClip
11
11
  from PIL import Image
@@ -66,7 +66,7 @@ class AssembleMovie(WorkflowTaskBase, ABC):
66
66
  MINIMUM_DURATION = 10 # seconds
67
67
  MAXIMUM_DURATION = 60 # seconds
68
68
  FPS = 15
69
- FONT_FILE = pkg_resources.resource_filename("dkist_processing_common", "fonts/Lato-Regular.ttf")
69
+ FONT_FILE = files("dkist_processing_common").joinpath("fonts/Lato-Regular.ttf")
70
70
  TEXT_MARGIN_PX = 5
71
71
  MPL_COLOR_MAP = "viridis"
72
72
 
@@ -1365,13 +1365,22 @@ class _WavecalQualityMixin:
1365
1365
  wcs = WCS(best_fit_header)
1366
1366
  best_fit_wavelength = wcs.spectral.pixel_to_world(np.arange(input_spectrum.size))
1367
1367
 
1368
+ finite_idx = (
1369
+ np.isfinite(input_wavelength)
1370
+ * np.isfinite(input_spectrum)
1371
+ * np.isfinite(best_fit_wavelength)
1372
+ * np.isfinite(best_fit_atlas)
1373
+ * np.isfinite(normalized_residuals)
1374
+ * np.isfinite(weight_data)
1375
+ )
1376
+
1368
1377
  data = {
1369
- "input_wavelength_nm": input_wavelength.to_value(u.nm).tolist(),
1370
- "input_spectrum": input_spectrum.tolist(),
1371
- "best_fit_wavelength_nm": best_fit_wavelength.to_value(u.nm).tolist(),
1372
- "best_fit_atlas": best_fit_atlas.tolist(),
1373
- "normalized_residuals": normalized_residuals.tolist(),
1374
- "weights": None if weights is None else weight_data.tolist(),
1378
+ "input_wavelength_nm": input_wavelength.to_value(u.nm)[finite_idx].tolist(),
1379
+ "input_spectrum": input_spectrum[finite_idx].tolist(),
1380
+ "best_fit_wavelength_nm": best_fit_wavelength.to_value(u.nm)[finite_idx].tolist(),
1381
+ "best_fit_atlas": best_fit_atlas[finite_idx].tolist(),
1382
+ "normalized_residuals": normalized_residuals[finite_idx].tolist(),
1383
+ "weights": None if weights is None else weight_data[finite_idx].tolist(),
1375
1384
  }
1376
1385
 
1377
1386
  self._record_values(values=data, tags=[Tag.quality(MetricCode.wavecal_fit)])
@@ -230,7 +230,13 @@ class WriteL1Frame(WorkflowTaskBase, MetadataStoreMixin, ABC):
230
230
  header = self.add_contributing_id_headers(header=header)
231
231
  header["MANPROCD"] = self.workflow_had_manual_intervention
232
232
  header["PRODUCT"] = self.compute_product_id(header["IDSOBSID"], header["PROCTYPE"])
233
- # Spectral line keywords
233
+ return header
234
+
235
+ def add_spectral_line_headers(
236
+ self,
237
+ header: fits.Header,
238
+ ) -> fits.Header:
239
+ """Add datacenter table keys relating to spectral lines."""
234
240
  wavelength_range = self.get_wavelength_range(header=header)
235
241
  spectral_lines = get_spectral_lines(
236
242
  wavelength_min=wavelength_range.min,
@@ -364,6 +370,8 @@ class WriteL1Frame(WorkflowTaskBase, MetadataStoreMixin, ABC):
364
370
  header = self.add_doc_headers(header=header)
365
371
  # Add the dataset headers (abstract - implement in instrument task)
366
372
  header = self.add_dataset_headers(header=header, stokes=stokes_param)
373
+ # Add the spectral line headers
374
+ header = self.add_spectral_line_headers(header=header)
367
375
  # Remove any headers not contained in spec 214
368
376
  header = remove_spec_122_keys_and_spec_214_l0_keys(input_headers=header)
369
377
  # Remove any keys referring to axes that don't exist
@@ -1201,12 +1201,16 @@ def wavecal_input_wavelength() -> u.Quantity:
1201
1201
 
1202
1202
  @pytest.fixture(scope="session")
1203
1203
  def wavecal_input_spectrum(wavecal_input_wavelength) -> np.ndarray:
1204
- return (wavecal_input_wavelength.value - wavecal_input_wavelength.size // 2) ** 2 + 10.0
1204
+ spec = (wavecal_input_wavelength.value - wavecal_input_wavelength.size // 2) ** 2 + 10.0
1205
+ spec[spec.size // 2] = np.nan
1206
+ return spec
1205
1207
 
1206
1208
 
1207
1209
  @pytest.fixture(scope="session")
1208
1210
  def wavecal_weights(wavecal_input_wavelength) -> np.ndarray:
1209
- return np.arange(wavecal_input_wavelength.size)
1211
+ weights = np.arange(wavecal_input_wavelength.size, dtype=float)
1212
+ weights[0] = np.inf
1213
+ return weights
1210
1214
 
1211
1215
 
1212
1216
  @pytest.fixture(scope="session")
@@ -2,12 +2,11 @@ import json
2
2
  import logging
3
3
  import re
4
4
  import tomllib
5
- from dataclasses import asdict
5
+ from importlib.metadata import version
6
6
  from pathlib import Path
7
7
  from string import ascii_uppercase
8
8
 
9
9
  import pytest
10
- from pkg_resources import get_distribution
11
10
  from sqids import Sqids
12
11
 
13
12
  import dkist_processing_common
@@ -272,7 +271,7 @@ def test_library_versions(provenance_task, package_dependencies):
272
271
  # installed packages.
273
272
  for package in package_dependencies:
274
273
  assert package in libraries
275
- assert libraries[package] == get_distribution(package).version
274
+ assert libraries[package] == version(package)
276
275
 
277
276
 
278
277
  def test_record_provenance(provenance_task):
@@ -677,7 +677,7 @@ def test_spectral_line_keys(write_l1_task, mocker, fake_gql_client):
677
677
  new=fake_gql_client,
678
678
  )
679
679
  task, _, header = write_l1_task
680
- header = task.add_datacenter_headers(header=header, hdu_size=1024, stokes="I")
680
+ header = task.add_spectral_line_headers(header=header)
681
681
  assert header["SPECLN01"] == "Fe XIII (1079.8 nm)"
682
682
  assert header["SPECLN02"] == "He I (1083.0 nm)"
683
683
  assert header["NSPECLNS"] == 2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dkist-processing-common
3
- Version: 11.1.0rc1
3
+ Version: 11.2.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
@@ -7,7 +7,6 @@ README.rst
7
7
  bitbucket-pipelines.yml
8
8
  pyproject.toml
9
9
  changelog/.gitempty
10
- changelog/255.misc.rst
11
10
  dkist_processing_common/__init__.py
12
11
  dkist_processing_common/config.py
13
12
  dkist_processing_common/manual.py
@@ -1,3 +0,0 @@
1
- Create a factory for custom `FakeGQLClient` used in tests. The factory and associated default returns live in a
2
- new `mock_metadata_store.py` module in the tests directory. `FakeGQLClient` is now a test fixture and does not need to
3
- be imported in tests.