dkist-processing-dlnirsp 0.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 (95) hide show
  1. dkist_processing_dlnirsp-0.1.0/.gitignore +194 -0
  2. dkist_processing_dlnirsp-0.1.0/.pre-commit-config.yaml +29 -0
  3. dkist_processing_dlnirsp-0.1.0/.readthedocs.yml +21 -0
  4. dkist_processing_dlnirsp-0.1.0/CHANGELOG.rst +4 -0
  5. dkist_processing_dlnirsp-0.1.0/PKG-INFO +118 -0
  6. dkist_processing_dlnirsp-0.1.0/README.rst +99 -0
  7. dkist_processing_dlnirsp-0.1.0/SCIENCE_CHANGELOG.rst +5 -0
  8. dkist_processing_dlnirsp-0.1.0/bitbucket-pipelines.yml +110 -0
  9. dkist_processing_dlnirsp-0.1.0/changelog/.gitempty +0 -0
  10. dkist_processing_dlnirsp-0.1.0/check_changelog_updated.sh +23 -0
  11. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/__init__.py +9 -0
  12. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/config.py +12 -0
  13. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/dev_scripts/__init__.py +1 -0
  14. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/dev_scripts/test_slitbeam_group_assignment.py +118 -0
  15. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/models/__init__.py +1 -0
  16. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/models/constants.py +148 -0
  17. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/models/parameters.py +164 -0
  18. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/models/tags.py +129 -0
  19. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/parsers/__init__.py +1 -0
  20. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/parsers/dlnirsp_l0_fits_access.py +73 -0
  21. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/parsers/dlnirsp_l1_fits_acess.py +30 -0
  22. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/parsers/mosaic.py +210 -0
  23. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/parsers/task.py +98 -0
  24. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/parsers/time.py +49 -0
  25. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/parsers/wavelength.py +26 -0
  26. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/__init__.py +14 -0
  27. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/assemble_movie.py +144 -0
  28. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/dark.py +89 -0
  29. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/dlnirsp_base.py +101 -0
  30. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/geometric.py +604 -0
  31. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/instrument_polarization.py +448 -0
  32. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/l1_output_data.py +13 -0
  33. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/lamp.py +126 -0
  34. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/linearity_correction.py +144 -0
  35. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/make_movie_frames.py +146 -0
  36. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/mixin/__init__.py +1 -0
  37. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/mixin/corrections.py +157 -0
  38. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/mixin/group_id.py +248 -0
  39. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/mixin/input_frame_loaders.py +27 -0
  40. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/mixin/intermediate_frame_helpers.py +147 -0
  41. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/mixin/linearized_frame_loaders.py +81 -0
  42. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/mixin/matrix_multiplication.py +43 -0
  43. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/parse.py +195 -0
  44. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/quality_metrics.py +178 -0
  45. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/science.py +612 -0
  46. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/solar.py +221 -0
  47. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tasks/write_l1.py +221 -0
  48. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/__init__.py +1 -0
  49. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/conftest.py +1494 -0
  50. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/local_trial_workflows/__init__.py +0 -0
  51. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/local_trial_workflows/e2e_dev_mockers.py +163 -0
  52. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/local_trial_workflows/e2e_helpers.py +513 -0
  53. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/local_trial_workflows/l0_polcals_as_science.py +351 -0
  54. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/local_trial_workflows/l0_solar_gain_as_science.py +364 -0
  55. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/local_trial_workflows/l0_to_l1.py +369 -0
  56. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/local_trial_workflows/translate_files.py +55 -0
  57. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_assemble_movie.py +114 -0
  58. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_assemble_quality.py +43 -0
  59. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_corrections.py +188 -0
  60. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_dark.py +127 -0
  61. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_dlnirsp_base.py +71 -0
  62. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_dlnirsp_constants.py +164 -0
  63. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_dlnirsp_fits_access.py +39 -0
  64. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_geometric.py +218 -0
  65. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_group_id.py +178 -0
  66. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_instrument_polarization_calibration.py +415 -0
  67. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_lamp.py +134 -0
  68. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_linearity_correction.py +258 -0
  69. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_make_movie_frames.py +91 -0
  70. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_parameters.py +93 -0
  71. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_parse.py +459 -0
  72. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_quality.py +170 -0
  73. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_science.py +273 -0
  74. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_solar.py +332 -0
  75. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_workflows.py +9 -0
  76. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/tests/test_write_l1.py +359 -0
  77. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/workflows/__init__.py +2 -0
  78. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp/workflows/l0_processing.py +74 -0
  79. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp.egg-info/PKG-INFO +118 -0
  80. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp.egg-info/SOURCES.txt +94 -0
  81. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp.egg-info/dependency_links.txt +1 -0
  82. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp.egg-info/entry_points.txt +2 -0
  83. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp.egg-info/requires.txt +67 -0
  84. dkist_processing_dlnirsp-0.1.0/dkist_processing_dlnirsp.egg-info/top_level.txt +1 -0
  85. dkist_processing_dlnirsp-0.1.0/docs/Makefile +134 -0
  86. dkist_processing_dlnirsp-0.1.0/docs/changelog.rst +11 -0
  87. dkist_processing_dlnirsp-0.1.0/docs/conf.py +53 -0
  88. dkist_processing_dlnirsp-0.1.0/docs/index.rst +12 -0
  89. dkist_processing_dlnirsp-0.1.0/docs/l0_to_l1_dlnirsp.rst +11 -0
  90. dkist_processing_dlnirsp-0.1.0/docs/make.bat +170 -0
  91. dkist_processing_dlnirsp-0.1.0/docs/requirements_table.rst +8 -0
  92. dkist_processing_dlnirsp-0.1.0/docs/scientific_changelog.rst +10 -0
  93. dkist_processing_dlnirsp-0.1.0/pyproject.toml +31 -0
  94. dkist_processing_dlnirsp-0.1.0/setup.cfg +92 -0
  95. dkist_processing_dlnirsp-0.1.0/setup.py +4 -0
@@ -0,0 +1,194 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ __pycache__
4
+ *.py[cod]
5
+ *$py.class
6
+ *.a
7
+ *.o
8
+ *.pyc
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ *.egg
15
+ *.egg-info
16
+ dist
17
+ build
18
+ eggs
19
+ parts
20
+ bin
21
+ var
22
+ sdist
23
+ develop-eggs
24
+ .installed.cfg
25
+ distribute-*.tar.gz
26
+ .Python
27
+ build/
28
+ develop-eggs/
29
+ dist/
30
+ downloads/
31
+ eggs/
32
+ .eggs/
33
+ lib/
34
+ lib64/
35
+ parts/
36
+ sdist/
37
+ var/
38
+ wheels/
39
+ pip-wheel-metadata/
40
+ share/python-wheels/
41
+ *.egg-info/
42
+ MANIFEST
43
+ scratch
44
+
45
+ # PyInstaller
46
+ # Usually these files are written by a python script from a template
47
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
48
+ *.manifest
49
+ *.spec
50
+
51
+ # Installer logs
52
+ pip-log.txt
53
+ pip-delete-this-directory.txt
54
+
55
+ # Unit test / coverage reports
56
+ htmlcov/
57
+ .tox/
58
+ .nox/
59
+ .coverage
60
+ .coverage.*
61
+ .cache
62
+ nosetests.xml
63
+ coverage.xml
64
+ *.cover
65
+ .hypothesis/
66
+ .pytest_cache/
67
+
68
+ # Translations
69
+ *.mo
70
+ *.pot
71
+
72
+ # Django stuff:
73
+ *.log
74
+ local_settings.py
75
+ db.sqlite3
76
+ db.sqlite3-journal
77
+
78
+ # Flask stuff:
79
+ instance/
80
+ .webassets-cache
81
+
82
+ # Scrapy stuff:
83
+ .scrapy
84
+
85
+ # Sphinx documentation
86
+ docs/_build/
87
+ docs/api/
88
+
89
+ # PyBuilder
90
+ target/
91
+
92
+ # Jupyter Notebook
93
+ .ipynb_checkpoints
94
+
95
+ # IPython
96
+ profile_default/
97
+ ipython_config.py
98
+
99
+ # pyenv
100
+ .python-version
101
+
102
+ # pipenv
103
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
104
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
105
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
106
+ # install all needed dependencies.
107
+ #Pipfile.lock
108
+
109
+ # celery beat schedule file
110
+ celerybeat-schedule
111
+
112
+ # SageMath parsed files
113
+ *.sage.py
114
+
115
+ # Environments
116
+ .env
117
+ .venv
118
+ env/
119
+ venv/
120
+ ENV/
121
+ env.bak/
122
+ venv.bak/
123
+
124
+ # Spyder project settings
125
+ .spyderproject
126
+ .spyproject
127
+
128
+ # Rope project settings
129
+ .ropeproject
130
+
131
+ # PyCharm project settings
132
+ .idea
133
+
134
+ # mkdocs documentation
135
+ /site
136
+
137
+ # mypy
138
+ .mypy_cache/
139
+ .dmypy.json
140
+ dmypy.json
141
+
142
+ # Pyre type checker
143
+ .pyre/
144
+
145
+
146
+ # other
147
+ *.npy
148
+ *.dat
149
+ *.fits
150
+ .tox
151
+ .*.sw[op]
152
+ *~
153
+
154
+ # Ignore .c files by default to avoid including generated code. If you want to
155
+ # add a non-generated .c extension, use `git add -f filename.c`.
156
+ *.c
157
+
158
+ # Other generated files
159
+ */version.py
160
+ */cython_version.py
161
+ htmlcov
162
+
163
+
164
+ # Sphinx
165
+ docs/api
166
+ docs/_build
167
+
168
+ # Eclipse editor project files
169
+ .project
170
+ .pydevproject
171
+ .settings
172
+
173
+ # Floobits project files
174
+ .floo
175
+ .flooignore
176
+
177
+ # Mac OSX
178
+ .DS_Store
179
+
180
+ # Outputs and temp files
181
+ *.png
182
+ *.txt
183
+ *.cprof
184
+ vtfcal/dask-worker-space/
185
+ vtfcal/data/
186
+ tmp??_pars*.fits
187
+
188
+ *data_tree
189
+ dask-worker-space
190
+ logging.*
191
+
192
+ # VS Code
193
+ .history/
194
+ .vscode/
@@ -0,0 +1,29 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v2.4.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: end-of-file-fixer
9
+ - id: check-yaml
10
+ - id: check-added-large-files
11
+ args: [--maxkb=700]
12
+ - id: debug-statements
13
+ - repo: https://github.com/psf/black
14
+ rev: 22.3.0
15
+ hooks:
16
+ - id: black
17
+ args: [ "-l 100" ]
18
+ - repo: https://github.com/asottile/reorder_python_imports
19
+ rev: v2.3.5
20
+ hooks:
21
+ - id: reorder-python-imports
22
+ - repo: https://github.com/pycqa/pydocstyle
23
+ rev: 6.1.1 # pick a git hash / tag to point to
24
+ hooks:
25
+ - id: pydocstyle
26
+ exclude: test
27
+ args:
28
+ - --convention=numpy
29
+ - --add-ignore=D105
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ build:
3
+ os: ubuntu-20.04
4
+ tools:
5
+ python: "3.11"
6
+ apt_packages:
7
+ - libopenjp2-7
8
+ - graphviz
9
+
10
+ sphinx:
11
+ builder: html
12
+ configuration: docs/conf.py
13
+ fail_on_warning: false
14
+
15
+ python:
16
+ install:
17
+ - method: pip
18
+ extra_requirements:
19
+ - all
20
+ - docs
21
+ path: .
@@ -0,0 +1,4 @@
1
+ v0.1.0 (2024-06-06)
2
+ ===================
3
+
4
+ - Initial release. Mostly for first release to DC stacks (i.e., not "production" quality).
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.1
2
+ Name: dkist_processing_dlnirsp
3
+ Version: 0.1.0
4
+ Summary: Science processing code for the DLNIRSP instrument on DKIST
5
+ Home-page: https://bitbucket.org/dkistdc/dkist_processing_dlnirsp/src/main/
6
+ Author: NSO / AURA
7
+ Author-email: "dkistdc@nso.edu"
8
+ License: MIT
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Requires-Python: >=3.11
13
+ Provides-Extra: test
14
+ Provides-Extra: inventory
15
+ Provides-Extra: asdf
16
+ Provides-Extra: quality
17
+ Provides-Extra: grogu
18
+ Provides-Extra: docs
19
+
20
+ dkist-processing-dlnirsp
21
+ ========================
22
+
23
+ Overview
24
+ --------
25
+ The dkist-processing-dlnirsp library contains the implementation of the DLNIRSP pipelines as a collection of the
26
+ `dkist-processing-core <https://pypi.org/project/dkist-processing-core/>`_ framework and
27
+ `dkist-processing-common <https://pypi.org/project/dkist-processing-common/>`_ Tasks.
28
+
29
+ The recommended project structure is to separate tasks and workflows into seperate packages. Having the workflows
30
+ in their own package facilitates using the build_utils to test the integrity of those workflows in the unit test.
31
+
32
+ Calibration Pipeline
33
+ ------------------------
34
+
35
+ Build
36
+ --------
37
+ Artifacts are built through `bitbucket pipelines <bitbucket-pipelines.yml>`_.
38
+
39
+ The pipeline can be used in other repos with a modification of the package and artifact locations
40
+ to use the names relevant to the target repo.
41
+
42
+ e.g. dkist-processing-test -> dkist-processing-vbi and dkist_processing_test -> dkist_processing_vbi
43
+
44
+ Deployment
45
+ ----------
46
+ Deployment is done with `turtlebot <https://bitbucket.org/dkistdc/turtlebot/src/master/>`_ and follows
47
+ the process detailed in `dkist-processing-core <https://pypi.org/project/dkist-processing-core/>`_
48
+
49
+ Environment Variables
50
+ ---------------------
51
+ Only those specified by `dkist-processing-core <https://pypi.org/project/dkist-processing-core/>`_ and `dkist-processing-common <https://pypi.org/project/dkist-processing-common/>`_.
52
+
53
+ Development
54
+ -----------
55
+ .. code-block:: bash
56
+
57
+ git clone git@bitbucket.org:dkistdc/dkist-processing-dlnirsp.git
58
+ cd dkist-processing-dlnirsp
59
+ pre-commit install
60
+ pip install -e .[test]
61
+ pytest -v --cov dkist_processing_nirsp
62
+
63
+ Changelog
64
+ #########
65
+
66
+ When you make **any** change to this repository it **MUST** be accompanied by a changelog file.
67
+ The changelog for this repository uses the `towncrier <https://github.com/twisted/towncrier>`__ package.
68
+ Entries in the changelog for the next release are added as individual files (one per change) to the ``changelog/`` directory.
69
+
70
+ Writing a Changelog Entry
71
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
72
+
73
+ A changelog entry accompanying a change should be added to the ``changelog/`` directory.
74
+ The name of a file in this directory follows a specific template::
75
+
76
+ <PULL REQUEST NUMBER>.<TYPE>[.<COUNTER>].rst
77
+
78
+ The fields have the following meanings:
79
+
80
+ * ``<PULL REQUEST NUMBER>``: This is the number of the pull request, so people can jump from the changelog entry to the diff on BitBucket.
81
+ * ``<TYPE>``: This is the type of the change and must be one of the values described below.
82
+ * ``<COUNTER>``: This is an optional field, if you make more than one change of the same type you can append a counter to the subsequent changes, i.e. ``100.bugfix.rst`` and ``100.bugfix.1.rst`` for two bugfix changes in the same PR.
83
+
84
+ The list of possible types is defined the the towncrier section of ``pyproject.toml``, the types are:
85
+
86
+ * ``feature``: This change is a new code feature.
87
+ * ``bugfix``: This is a change which fixes a bug.
88
+ * ``doc``: A documentation change.
89
+ * ``removal``: A deprecation or removal of public API.
90
+ * ``misc``: Any small change which doesn't fit anywhere else, such as a change to the package infrastructure.
91
+
92
+
93
+ Rendering the Changelog at Release Time
94
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95
+
96
+ When you are about to tag a release first you must run ``towncrier`` to render the changelog.
97
+ The steps for this are as follows:
98
+
99
+ * Run `towncrier build --version vx.y.z` using the version number you want to tag.
100
+ * Agree to have towncrier remove the fragments.
101
+ * Add and commit your changes.
102
+ * Tag the release.
103
+
104
+ **NOTE:** If you forget to add a Changelog entry to a tagged release (either manually or automatically with ``towncrier``)
105
+ then the Bitbucket pipeline will fail. To be able to use the same tag you must delete it locally and on the remote branch:
106
+
107
+ .. code-block:: bash
108
+
109
+ # First, actually update the CHANGELOG and commit the update
110
+ git commit
111
+
112
+ # Delete tags
113
+ git tag -d vWHATEVER.THE.VERSION
114
+ git push --delete origin vWHATEVER.THE.VERSION
115
+
116
+ # Re-tag with the same version
117
+ git tag vWHATEVER.THE.VERSION
118
+ git push --tags origin main
@@ -0,0 +1,99 @@
1
+ dkist-processing-dlnirsp
2
+ ========================
3
+
4
+ Overview
5
+ --------
6
+ The dkist-processing-dlnirsp library contains the implementation of the DLNIRSP pipelines as a collection of the
7
+ `dkist-processing-core <https://pypi.org/project/dkist-processing-core/>`_ framework and
8
+ `dkist-processing-common <https://pypi.org/project/dkist-processing-common/>`_ Tasks.
9
+
10
+ The recommended project structure is to separate tasks and workflows into seperate packages. Having the workflows
11
+ in their own package facilitates using the build_utils to test the integrity of those workflows in the unit test.
12
+
13
+ Calibration Pipeline
14
+ ------------------------
15
+
16
+ Build
17
+ --------
18
+ Artifacts are built through `bitbucket pipelines <bitbucket-pipelines.yml>`_.
19
+
20
+ The pipeline can be used in other repos with a modification of the package and artifact locations
21
+ to use the names relevant to the target repo.
22
+
23
+ e.g. dkist-processing-test -> dkist-processing-vbi and dkist_processing_test -> dkist_processing_vbi
24
+
25
+ Deployment
26
+ ----------
27
+ Deployment is done with `turtlebot <https://bitbucket.org/dkistdc/turtlebot/src/master/>`_ and follows
28
+ the process detailed in `dkist-processing-core <https://pypi.org/project/dkist-processing-core/>`_
29
+
30
+ Environment Variables
31
+ ---------------------
32
+ Only those specified by `dkist-processing-core <https://pypi.org/project/dkist-processing-core/>`_ and `dkist-processing-common <https://pypi.org/project/dkist-processing-common/>`_.
33
+
34
+ Development
35
+ -----------
36
+ .. code-block:: bash
37
+
38
+ git clone git@bitbucket.org:dkistdc/dkist-processing-dlnirsp.git
39
+ cd dkist-processing-dlnirsp
40
+ pre-commit install
41
+ pip install -e .[test]
42
+ pytest -v --cov dkist_processing_nirsp
43
+
44
+ Changelog
45
+ #########
46
+
47
+ When you make **any** change to this repository it **MUST** be accompanied by a changelog file.
48
+ The changelog for this repository uses the `towncrier <https://github.com/twisted/towncrier>`__ package.
49
+ Entries in the changelog for the next release are added as individual files (one per change) to the ``changelog/`` directory.
50
+
51
+ Writing a Changelog Entry
52
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
53
+
54
+ A changelog entry accompanying a change should be added to the ``changelog/`` directory.
55
+ The name of a file in this directory follows a specific template::
56
+
57
+ <PULL REQUEST NUMBER>.<TYPE>[.<COUNTER>].rst
58
+
59
+ The fields have the following meanings:
60
+
61
+ * ``<PULL REQUEST NUMBER>``: This is the number of the pull request, so people can jump from the changelog entry to the diff on BitBucket.
62
+ * ``<TYPE>``: This is the type of the change and must be one of the values described below.
63
+ * ``<COUNTER>``: This is an optional field, if you make more than one change of the same type you can append a counter to the subsequent changes, i.e. ``100.bugfix.rst`` and ``100.bugfix.1.rst`` for two bugfix changes in the same PR.
64
+
65
+ The list of possible types is defined the the towncrier section of ``pyproject.toml``, the types are:
66
+
67
+ * ``feature``: This change is a new code feature.
68
+ * ``bugfix``: This is a change which fixes a bug.
69
+ * ``doc``: A documentation change.
70
+ * ``removal``: A deprecation or removal of public API.
71
+ * ``misc``: Any small change which doesn't fit anywhere else, such as a change to the package infrastructure.
72
+
73
+
74
+ Rendering the Changelog at Release Time
75
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76
+
77
+ When you are about to tag a release first you must run ``towncrier`` to render the changelog.
78
+ The steps for this are as follows:
79
+
80
+ * Run `towncrier build --version vx.y.z` using the version number you want to tag.
81
+ * Agree to have towncrier remove the fragments.
82
+ * Add and commit your changes.
83
+ * Tag the release.
84
+
85
+ **NOTE:** If you forget to add a Changelog entry to a tagged release (either manually or automatically with ``towncrier``)
86
+ then the Bitbucket pipeline will fail. To be able to use the same tag you must delete it locally and on the remote branch:
87
+
88
+ .. code-block:: bash
89
+
90
+ # First, actually update the CHANGELOG and commit the update
91
+ git commit
92
+
93
+ # Delete tags
94
+ git tag -d vWHATEVER.THE.VERSION
95
+ git push --delete origin vWHATEVER.THE.VERSION
96
+
97
+ # Re-tag with the same version
98
+ git tag vWHATEVER.THE.VERSION
99
+ git push --tags origin main
@@ -0,0 +1,5 @@
1
+ v0.1.0 (2024-06-06)
2
+ ===================
3
+
4
+ - Initial release. Pipeline supports both BIFOS and MISI data and produces valid L1 frames. IFU-remapping is not yet implemented
5
+ so the L1 files are presented as a single slit. WCS header values not guaranteed.
@@ -0,0 +1,110 @@
1
+ #Build Configuration for docker deployment to artifactory
2
+ image: python:3.11
3
+
4
+ definitions:
5
+ services:
6
+ redis:
7
+ image: redis
8
+ steps:
9
+ - step: &lint
10
+ caches:
11
+ - pip
12
+ name: Lint
13
+ script:
14
+ - pip install pre-commit
15
+ - pre-commit install
16
+ - pre-commit run --all-files
17
+ - step: &changelog
18
+ caches:
19
+ - pip
20
+ name: Changelog
21
+ script:
22
+ - pip install towncrier
23
+ # We need to fetch the main branch to compare against
24
+ - git remote set-branches --add origin main
25
+ - git fetch origin main
26
+ - towncrier check --compare-with origin/main
27
+ - step: &scan
28
+ caches:
29
+ - pip
30
+ name: Scan
31
+ script:
32
+ - pip install -e .
33
+ - pip freeze | grep -v @ > requirements.txt
34
+ - cat requirements.txt
35
+ - echo $SNYK_VERSION
36
+ - curl -L -o snyk https://github.com/snyk/snyk/releases/download/$SNYK_VERSION/snyk-linux
37
+ - chmod 755 snyk
38
+ - ./snyk -d auth $SNYK_TOKEN
39
+ - echo $SNYK_IGNORE
40
+ - for id in $SNYK_IGNORE; do echo Ignoring $id; ./snyk ignore $id; done
41
+ - cat .snyk || echo "No .snyk found. Probably because there was nothing to ignore."
42
+ - echo $SNYK_CLI_COMMAND
43
+ - $SNYK_CLI_COMMAND
44
+ - step: &test
45
+ caches:
46
+ - pip
47
+ name: Test
48
+ script:
49
+ - pip install .[test]
50
+ - pytest -v -n auto --dist worksteal --cov -m "not development" dkist_processing_dlnirsp
51
+ services:
52
+ - redis
53
+ - step: &docs
54
+ name: Test Docs
55
+ caches:
56
+ - pip
57
+ script:
58
+ - apt update && apt -y install graphviz
59
+ - pip install .[docs]
60
+ - sphinx-build --color -W --keep-going -b html docs docs/_build/html
61
+ - step: &check_changelog
62
+ name: Check for updated CHANGELOG
63
+ script:
64
+ - ./check_changelog_updated.sh
65
+ - step: &push_workflow
66
+ caches:
67
+ - pip
68
+ name: Push Workflow
69
+ script:
70
+ - pip install .
71
+ - export BUILD_VERSION="${BITBUCKET_TAG:1}"
72
+ - export ARTIFACT_FOLDER="${BITBUCKET_REPO_SLUG}_${BUILD_VERSION}/"
73
+ - python -c "from dkist_processing_core.build_utils import export_dags; import dkist_processing_dlnirsp.workflows as workflow_package; export_dags(workflow_package, '${ARTIFACT_FOLDER}')"
74
+ - export SOURCE_PATH="workflow_${BUILD_VERSION}.gz"
75
+ - tar --exclude="bitbucket-pipelines.yml" -cvzf ${SOURCE_PATH} ${ARTIFACT_FOLDER}
76
+ - export TARGET_PATH="generic-packages/dkist-processing-dlnirsp/${BUILD_VERSION}/"
77
+ - curl -fL https://getcli.jfrog.io | sh
78
+ - ./jfrog rt u --url $ARTIFACTORY_URL --user $ARTIFACTORY_USER --password $ARTIFACTORY_PASSWORD ${SOURCE_PATH} ${TARGET_PATH}
79
+ - step: &push_code
80
+ caches:
81
+ - pip
82
+ name: Push Code
83
+ script:
84
+ - python setup.py sdist
85
+ - pip install twine
86
+ - twine upload dist/*
87
+
88
+
89
+ options:
90
+ max-time: 25
91
+ pipelines:
92
+ default:
93
+ - parallel:
94
+ - step: *lint
95
+ - step: *changelog
96
+ - parallel:
97
+ - step: *scan
98
+ - step: *test
99
+ - step: *docs
100
+ tags:
101
+ 'v*':
102
+ - parallel:
103
+ - step: *lint
104
+ - step: *check_changelog
105
+ - parallel:
106
+ - step: *test
107
+ - step: *scan
108
+ - step: *docs
109
+ - step: *push_workflow
110
+ - step: *push_code
File without changes
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ CURRENT_VERSION=`git describe --tags --match v* --exact-match`
4
+ ERROR_STR="CHANGELOG has not been updated for ${CURRENT_VERSION}\\nSee the README for instructions"
5
+ ERROR_PAD="***********"
6
+
7
+ if [[ $CURRENT_VERSION =~ "rc" ]]; then
8
+ echo "release candidate detected"
9
+ exit 0;
10
+ fi
11
+
12
+ ls changelog/*rst 2>/dev/null && {
13
+ echo -e "\\n${ERROR_PAD}"
14
+ echo -e "Unmerged changelog fragments found! You must run towncrier!\\nSee the README for instruction"
15
+ echo -e "${ERROR_PAD}"
16
+ exit 1;
17
+ }
18
+
19
+ head -n 1 CHANGELOG.rst | grep -q $CURRENT_VERSION - || {
20
+ echo -e "\\n${ERROR_PAD}"
21
+ echo -e $ERROR_STR;
22
+ echo -e "${ERROR_PAD}"
23
+ exit 1; }
@@ -0,0 +1,9 @@
1
+ """Processing pipeline for DLNIRSP instrument on DKIST."""
2
+ from pkg_resources import DistributionNotFound
3
+ from pkg_resources import get_distribution
4
+
5
+ try:
6
+ __version__ = get_distribution(__name__).version
7
+ except DistributionNotFound:
8
+ # package is not installed
9
+ __version__ = "unknown"
@@ -0,0 +1,12 @@
1
+ """Configuration for the dkist-processing-dlnirsp package and logging thereof."""
2
+ from dkist_processing_common.config import DKISTProcessingCommonConfiguration
3
+
4
+
5
+ class DKISTProcessingDLNIRSPConfigurations(DKISTProcessingCommonConfiguration):
6
+ """Configurations custom to the dkist-processing-dlnirsp package."""
7
+
8
+ pass # nothing custom.... yet
9
+
10
+
11
+ dkist_processing_dlnirsp_configurations = DKISTProcessingDLNIRSPConfigurations()
12
+ dkist_processing_dlnirsp_configurations.log_configurations()
@@ -0,0 +1 @@
1
+ """Modules to allow easy testing of pipeline components by pipeline developers."""