orGUI 1.4.0__tar.gz → 1.5.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 (197) hide show
  1. orgui-1.5.0/.github/workflows/release.yml +105 -0
  2. {orgui-1.4.0 → orgui-1.5.0}/.gitignore +37 -37
  3. orgui-1.5.0/.readthedocs.yaml +20 -0
  4. orgui-1.5.0/AGENTS.md +281 -0
  5. {orgui-1.4.0 → orgui-1.5.0}/CHANGELOG.md +628 -475
  6. {orgui-1.4.0 → orgui-1.5.0}/LICENSE +20 -20
  7. orgui-1.5.0/PKG-INFO +179 -0
  8. orgui-1.5.0/README.rst +117 -0
  9. {orgui-1.4.0 → orgui-1.5.0}/benchmarks/benchmark.ipynb +648 -652
  10. {orgui-1.4.0 → orgui-1.5.0}/benchmarks/benchmark.json +282 -282
  11. {orgui-1.4.0 → orgui-1.5.0}/benchmarks/benchmark_compression.py +189 -191
  12. {orgui-1.4.0 → orgui-1.5.0}/cliff.toml +159 -159
  13. orgui-1.5.0/doc/Makefile +20 -0
  14. orgui-1.5.0/doc/check_rtd_imports.py +37 -0
  15. orgui-1.5.0/doc/generate_release_notes.py +161 -0
  16. orgui-1.5.0/doc/make.bat +35 -0
  17. orgui-1.5.0/doc/requirements.txt +4 -0
  18. orgui-1.5.0/doc/source/_static/custom.css +11 -0
  19. orgui-1.5.0/doc/source/_static/orgui_gui_mode.png +0 -0
  20. orgui-1.5.0/doc/source/_static/orgui_gui_overview_annotated.png +0 -0
  21. orgui-1.5.0/doc/source/_templates/sidebar/brand.html +19 -0
  22. orgui-1.5.0/doc/source/api.rst +28 -0
  23. orgui-1.5.0/doc/source/beamline_backends.rst +265 -0
  24. orgui-1.5.0/doc/source/conf.py +49 -0
  25. orgui-1.5.0/doc/source/developer.rst +8 -0
  26. orgui-1.5.0/doc/source/entry_points.rst +364 -0
  27. orgui-1.5.0/doc/source/geometry.rst +77 -0
  28. orgui-1.5.0/doc/source/gui_overview.rst +190 -0
  29. orgui-1.5.0/doc/source/image_integration.rst +71 -0
  30. orgui-1.5.0/doc/source/index.rst +24 -0
  31. orgui-1.5.0/doc/source/installation.rst +50 -0
  32. orgui-1.5.0/doc/source/parallax/.ipynb_checkpoints/sensor_thickness_corrections-checkpoint.ipynb +1852 -0
  33. orgui-1.5.0/doc/source/parallax/.virtual_documents/Untitled.ipynb +98 -0
  34. orgui-1.5.0/doc/source/parallax/calibration_20keV.poni +12 -0
  35. orgui-1.5.0/doc/source/parallax/parallax_sensor_thickness.png +0 -0
  36. orgui-1.5.0/doc/source/parallax/parallax_sensor_thickness.svg +301 -0
  37. orgui-1.5.0/doc/source/parallax/sensor_thickness_corrections.ipynb +1851 -0
  38. orgui-1.5.0/doc/source/release_notes.rst +172 -0
  39. orgui-1.5.0/doc/source/release_procedure.rst +166 -0
  40. orgui-1.5.0/doc/source/startup_configuration.rst +319 -0
  41. orgui-1.5.0/doc/source/ub_matrix.rst +56 -0
  42. {orgui-1.4.0 → orgui-1.5.0}/examples/automatic_rocking_extraction.py +91 -91
  43. {orgui-1.4.0 → orgui-1.5.0}/examples/backend/CHESS_QM2.py +432 -437
  44. {orgui-1.4.0 → orgui-1.5.0}/examples/backend/P212_backend.py +276 -283
  45. {orgui-1.4.0 → orgui-1.5.0}/examples/batch_processing/batch_integrate.py +50 -51
  46. {orgui-1.4.0 → orgui-1.5.0}/examples/config_minimal +49 -49
  47. {orgui-1.4.0 → orgui-1.5.0}/examples/config_withPoni_backendfile +60 -60
  48. {orgui-1.4.0 → orgui-1.5.0}/examples/config_withPoni_noXtal +53 -53
  49. {orgui-1.4.0 → orgui-1.5.0}/examples/config_withPoni_withBulfile +57 -57
  50. {orgui-1.4.0 → orgui-1.5.0}/examples/config_withPoni_withCiffile +60 -60
  51. {orgui-1.4.0 → orgui-1.5.0}/examples/config_withPoni_withXtalfile +59 -59
  52. {orgui-1.4.0 → orgui-1.5.0}/examples/crystal_files/Fe3O4(100).bul +58 -58
  53. {orgui-1.4.0 → orgui-1.5.0}/examples/crystal_files/Pt100.bul +7 -7
  54. {orgui-1.4.0 → orgui-1.5.0}/examples/crystal_files/Pt100_with_surface_model.xtal +23 -23
  55. {orgui-1.4.0 → orgui-1.5.0}/examples/crystal_files/Pt_mp-126_symmetrized.cif +218 -218
  56. {orgui-1.4.0 → orgui-1.5.0}/examples/poni_files/P3_100_calib.poni +12 -12
  57. {orgui-1.4.0 → orgui-1.5.0}/examples/poni_files/poni.poni +12 -12
  58. {orgui-1.4.0 → orgui-1.5.0}/examples/poni_files/poni_example.poni +12 -12
  59. {orgui-1.4.0 → orgui-1.5.0}/hdf_locking_tests/orgui_h5open_test.ipynb +203 -203
  60. orgui-1.5.0/orGUI.egg-info/PKG-INFO +179 -0
  61. {orgui-1.4.0 → orgui-1.5.0}/orGUI.egg-info/SOURCES.txt +34 -0
  62. {orgui-1.4.0 → orgui-1.5.0}/orGUI.egg-info/requires.txt +12 -4
  63. {orgui-1.4.0 → orgui-1.5.0}/orgui/__init__.py +43 -40
  64. orgui-1.5.0/orgui/_version.py +24 -0
  65. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/ArrayTableDialog.py +439 -433
  66. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/QHKLDialog.py +115 -114
  67. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/QReflectionSelector.py +1021 -1011
  68. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/QScanSelector.py +1454 -1354
  69. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/QUBCalculator.py +1759 -1720
  70. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/ROIutils.py +144 -149
  71. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/__init__.py +35 -36
  72. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/_roi_sum_accel.py +186 -187
  73. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/bgroi.py +364 -370
  74. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/database.py +654 -656
  75. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/imagePeakFinder.py +183 -187
  76. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/orGUI.py +4972 -4176
  77. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/peak1Dintegr.py +2620 -2372
  78. {orgui-1.4.0 → orgui-1.5.0}/orgui/app/qutils.py +366 -368
  79. orgui-1.5.0/orgui/app/test/test_orGUI_reflections.py +120 -0
  80. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/__init__.py +31 -32
  81. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/backends.py +166 -154
  82. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/beamline/ID31DiffractLinTilt.py +76 -77
  83. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/beamline/P212_tools.py +591 -598
  84. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/beamline/__init__.py +35 -36
  85. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/beamline/fio_reader.py +109 -110
  86. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/beamline/id31_tools.py +1051 -711
  87. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/interlacedScanLoader.py +10 -15
  88. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/scans.py +158 -159
  89. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/udefaults.py +161 -163
  90. {orgui-1.4.0 → orgui-1.5.0}/orgui/backend/universalScanLoader.py +7 -8
  91. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/__init__.py +31 -32
  92. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/util.py +703 -705
  93. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/CTRcalc.py +863 -885
  94. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/CTRfilm.py +877 -903
  95. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/CTRopt.py +650 -653
  96. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/CTRplotutil.py +997 -1005
  97. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/CTRuc.py +1950 -1960
  98. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/CTRutil.py +518 -530
  99. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/DetectorCalibration.py +526 -695
  100. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/HKLVlieg.py +1475 -1468
  101. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/ReciprocalNavigation.py +399 -401
  102. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/_CTRcalc_accel.py +179 -181
  103. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/__init__.py +45 -46
  104. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/element_data.py +213 -213
  105. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/test/__init__.py +56 -57
  106. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/test/test_CTRcalc.py +151 -152
  107. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/test/test_DetectorCalibration.py +359 -360
  108. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/test/test_HKLcalc.py +85 -88
  109. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/test/testdata/0V12_calculated.dat +4001 -4001
  110. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/test/testdata/0V12_calculated.xpr +26 -26
  111. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/Fe3O4(100).bul +58 -58
  112. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/Pt100.bul +7 -7
  113. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/Pt100_small.bul +4 -4
  114. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/Pt110.bul +5 -5
  115. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/Pt111.bul +6 -6
  116. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/Pt310.bul +13 -13
  117. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/Pt3O4(100).bul +18 -18
  118. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/PtO(001).bul +9 -9
  119. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/PtO(010).bul +8 -8
  120. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/PtO(100).bul +9 -9
  121. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/__init__.py +66 -67
  122. {orgui-1.4.0 → orgui-1.5.0}/orgui/datautils/xrayutils/unitcells/a-PtO2(0001).bul +5 -5
  123. orgui-1.5.0/orgui/logger_utils.py +271 -0
  124. orgui-1.5.0/orgui/main.py +363 -0
  125. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/__init__.py +58 -59
  126. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/alpha.svg +66 -66
  127. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/anchor-ROI.svg +104 -104
  128. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/disable-image.svg +67 -67
  129. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/document-nx-new.svg +178 -178
  130. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/document-nx-open.svg +151 -151
  131. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/document-nx-save.svg +72 -72
  132. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/incident_corrections.svg +441 -441
  133. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/intersect_s1.svg +88 -88
  134. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/intersect_s2.svg +88 -88
  135. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-all-link.svg +211 -211
  136. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-horizontal-link.svg +211 -211
  137. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-no-link.svg +193 -193
  138. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-view.svg +160 -160
  139. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/logo.svg +875 -875
  140. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/logo_social_media.svg +852 -852
  141. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/logo_v1.svg +197 -197
  142. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/max_image.svg +76 -76
  143. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/max_image2.svg +82 -82
  144. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/orguiicon.svg +82 -82
  145. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search-image.svg +94 -94
  146. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search-peak.svg +138 -138
  147. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search-reflection.svg +126 -126
  148. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search.svg +91 -91
  149. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/select-image.svg +60 -60
  150. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/set-reflection.svg +91 -91
  151. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/sum_image.svg +62 -62
  152. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/sum_image2.svg +74 -74
  153. {orgui-1.4.0 → orgui-1.5.0}/pyproject.toml +101 -70
  154. orgui-1.5.0/requirements.txt +15 -0
  155. {orgui-1.4.0 → orgui-1.5.0}/setup.cfg +4 -4
  156. orgui-1.4.0/PKG-INFO +0 -156
  157. orgui-1.4.0/README.rst +0 -107
  158. orgui-1.4.0/orGUI.egg-info/PKG-INFO +0 -156
  159. orgui-1.4.0/orgui/_version.py +0 -34
  160. orgui-1.4.0/orgui/main.py +0 -132
  161. orgui-1.4.0/requirements.txt +0 -11
  162. {orgui-1.4.0 → orgui-1.5.0}/examples/poni_files/README.txt +0 -0
  163. {orgui-1.4.0 → orgui-1.5.0}/hdf_locking_tests/data/proposal_sample.h5 +0 -0
  164. {orgui-1.4.0 → orgui-1.5.0}/hdf_locking_tests/data/sample_0001/sample_0001.h5 +0 -0
  165. {orgui-1.4.0 → orgui-1.5.0}/hdf_locking_tests/data/sample_0001/scan_0001/p3_0000.h5 +0 -0
  166. {orgui-1.4.0 → orgui-1.5.0}/hdf_locking_tests/test_locking.h5 +0 -0
  167. {orgui-1.4.0 → orgui-1.5.0}/orGUI.egg-info/dependency_links.txt +0 -0
  168. {orgui-1.4.0 → orgui-1.5.0}/orGUI.egg-info/entry_points.txt +0 -0
  169. {orgui-1.4.0 → orgui-1.5.0}/orGUI.egg-info/top_level.txt +0 -0
  170. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/alpha.png +0 -0
  171. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/anchor-ROI.png +0 -0
  172. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/diffractometer_v3.png +0 -0
  173. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/disable-image.png +0 -0
  174. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/document-nx-new.png +0 -0
  175. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/document-nx-open.png +0 -0
  176. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/document-nx-save.png +0 -0
  177. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/incident_corrections.png +0 -0
  178. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/intersect_s1.png +0 -0
  179. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/intersect_s2.png +0 -0
  180. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-all-link.png +0 -0
  181. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-horizontal-link.png +0 -0
  182. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-no-link.png +0 -0
  183. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/lattice-view.png +0 -0
  184. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/logo.png +0 -0
  185. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/logo_social_media.png +0 -0
  186. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/logo_v1.png +0 -0
  187. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/max_image.png +0 -0
  188. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/max_image2.png +0 -0
  189. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/orguiicon.png +0 -0
  190. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search-image.png +0 -0
  191. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search-peak.png +0 -0
  192. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search-reflection.png +0 -0
  193. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/search.png +0 -0
  194. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/select-image.png +0 -0
  195. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/set-reflection.png +0 -0
  196. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/sum_image.png +0 -0
  197. {orgui-1.4.0 → orgui-1.5.0}/orgui/resources/icons/sum_image2.png +0 -0
@@ -0,0 +1,105 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: release-${{ github.ref }}
13
+ cancel-in-progress: false
14
+
15
+ jobs:
16
+ build:
17
+ name: Build distributions
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - name: Check out repository
22
+ uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.x"
30
+
31
+ - name: Install packaging tools
32
+ run: python -m pip install --upgrade build twine
33
+
34
+ - name: Build distributions
35
+ run: python -m build
36
+
37
+ - name: Check distributions
38
+ run: python -m twine check dist/*
39
+
40
+ - name: Extract release notes from CHANGELOG.md
41
+ run: |
42
+ python - <<'PY'
43
+ from pathlib import Path
44
+ import os
45
+ import re
46
+ import sys
47
+
48
+ tag = os.environ["GITHUB_REF_NAME"]
49
+ version = tag.removeprefix("v")
50
+ changelog = Path("CHANGELOG.md").read_text(encoding="utf-8")
51
+ pattern = re.compile(
52
+ rf"^## \[{re.escape(version)}\].*?(?=^## \[|\Z)",
53
+ re.MULTILINE | re.DOTALL,
54
+ )
55
+ match = pattern.search(changelog)
56
+ if not match:
57
+ print(f"CHANGELOG.md has no release section for {version!r}.", file=sys.stderr)
58
+ print("Add the manual release notes, commit them, and move/recreate the tag.", file=sys.stderr)
59
+ sys.exit(1)
60
+
61
+ Path("release-notes.md").write_text(match.group(0).strip() + "\n", encoding="utf-8")
62
+ PY
63
+
64
+ - name: Upload distribution artifacts
65
+ uses: actions/upload-artifact@v4
66
+ with:
67
+ name: dist
68
+ path: dist/*
69
+
70
+ - name: Upload release notes
71
+ uses: actions/upload-artifact@v4
72
+ with:
73
+ name: release-notes
74
+ path: release-notes.md
75
+
76
+ release:
77
+ name: Create release and publish
78
+ runs-on: ubuntu-latest
79
+ needs: build
80
+ environment: pypi
81
+ permissions:
82
+ contents: write
83
+ id-token: write
84
+
85
+ steps:
86
+ - name: Download distribution artifacts
87
+ uses: actions/download-artifact@v4
88
+ with:
89
+ name: dist
90
+ path: dist
91
+
92
+ - name: Download release notes
93
+ uses: actions/download-artifact@v4
94
+ with:
95
+ name: release-notes
96
+ path: .
97
+
98
+ - name: Create GitHub release
99
+ uses: softprops/action-gh-release@v2
100
+ with:
101
+ body_path: release-notes.md
102
+ files: dist/*
103
+
104
+ - name: Publish to PyPI
105
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -1,38 +1,38 @@
1
- # Compiled source #
2
- ###################
3
- *.com
4
- *.class
5
- *.dll
6
- *.exe
7
- *.o
8
- *.so
9
- *.py[cod]
10
- __pycache__/
11
- dist/
12
- build/
13
- orgui.egg-info/
14
- orgui/_version.py
15
-
16
- # Packages #
17
- ############
18
- # it's better to unpack these files and commit the raw source
19
- # git has its own built in compression methods
20
- *.7z
21
- *.dmg
22
- *.gz
23
- *.iso
24
- *.jar
25
- *.rar
26
- *.tar
27
- *.zip
28
-
29
- # OS generated files #
30
- ######################
31
- .DS_Store
32
- .DS_Store?
33
- ._*
34
- .Spotlight-V100
35
- .Trashes
36
- ehthumbs.db
37
- Thumbs.db
1
+ # Compiled source #
2
+ ###################
3
+ *.com
4
+ *.class
5
+ *.dll
6
+ *.exe
7
+ *.o
8
+ *.so
9
+ *.py[cod]
10
+ __pycache__/
11
+ dist/
12
+ build/
13
+ orgui.egg-info/
14
+ orgui/_version.py
15
+
16
+ # Packages #
17
+ ############
18
+ # it's better to unpack these files and commit the raw source
19
+ # git has its own built in compression methods
20
+ *.7z
21
+ *.dmg
22
+ *.gz
23
+ *.iso
24
+ *.jar
25
+ *.rar
26
+ *.tar
27
+ *.zip
28
+
29
+ # OS generated files #
30
+ ######################
31
+ .DS_Store
32
+ .DS_Store?
33
+ ._*
34
+ .Spotlight-V100
35
+ .Trashes
36
+ ehthumbs.db
37
+ Thumbs.db
38
38
  .vs/
@@ -0,0 +1,20 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "latest"
7
+ jobs:
8
+ post_install:
9
+ - python doc/check_rtd_imports.py
10
+
11
+ sphinx:
12
+ configuration: doc/source/conf.py
13
+
14
+ python:
15
+ install:
16
+ - requirements: doc/requirements.txt
17
+ - method: pip
18
+ path: .
19
+ extra_requirements:
20
+ - full
orgui-1.5.0/AGENTS.md ADDED
@@ -0,0 +1,281 @@
1
+ # AGENTS.md
2
+
3
+ ## Purpose
4
+
5
+ This repository contains `orGUI`, a Python GUI and analysis toolkit for surface X-ray diffraction data from large 2D detectors. It combines:
6
+
7
+ - reciprocal-space geometry and diffractometer calculations
8
+ - detector calibration and detector-to-angle / detector-to-Q transforms
9
+ - beamline and file-format loading
10
+ - GUI workflows for orientation finding and ROI-based integration
11
+
12
+ For this project, scientific correctness is more important than stylistic cleanup. Prefer small, well-verified changes over broad refactors. Units matter, but they are one part of the broader correctness story alongside geometry conventions, detector behavior, file-format compatibility, and regression coverage.
13
+
14
+ ## Repository map
15
+
16
+ - `orgui/datautils/xrayutils/`
17
+ Core scientific code. This is the highest-risk area.
18
+ - `HKLVlieg.py`: lattice, UB, diffractometer geometry, angle transforms
19
+ - `DetectorCalibration.py`: detector geometry, pixel/angle/Q conversions, pyFAI integration
20
+ - `ReciprocalNavigation.py`: allowed reflections / CTR navigation helpers
21
+ - `CTRcalc.py`: main CTR crystal entry point; defines `SXRDCrystal`, imports and connects the lower-level CTR stack, and is the usual entry point into `CTRuc.py` and `CTRfilm.py`
22
+ - `CTRuc.py`: unit-cell and water-model definitions; atomic positions, structure factors, density helpers, fit parameters
23
+ - `CTRfilm.py`: higher-level film and epitaxy objects built on top of unit cells, including stacked/interface models such as `Film` and `EpitaxyInterface`
24
+ - `CTRutil.py`: shared CTR parameter utilities and parsing helpers used by the CTR modules
25
+ - `CTRplotutil.py`: CTR data containers, plotting helpers, and ANAROD-style import/export paths used in tests and analysis workflows
26
+ - `_CTRcalc_accel.py`: optional numba-accelerated kernels for selected CTR calculations
27
+ - `element_data.py`, `unitcells/`: scattering-factor data and bundled structure/unit-cell reference files
28
+ - `orgui/app/`
29
+ GUI components and user workflows.
30
+ - `QUBCalculator.py`: crystal + machine parameter UI, source/detector conversions, config integration
31
+ - `database.py`: config loading, detector/crystal object setup, Nexus/HDF5 handling
32
+ - `QScanSelector.py`, `ROIutils.py`, `orGUI.py`: integration and image workflows
33
+ - `orgui/backend/`
34
+ Scan loading abstractions and beamline-specific adapters.
35
+ - `examples/`
36
+ Best source of current config conventions and user-facing units.
37
+ - `orgui/datautils/xrayutils/test/`
38
+ Regression tests for lattice math, detector conversions, and CTR calculations.
39
+
40
+ Within the CTR stack, the typical dependency direction is:
41
+
42
+ - `CTRcalc.py` -> `CTRuc.py` and `CTRfilm.py`
43
+ - `CTRfilm.py` -> `CTRuc.py`
44
+ - `CTRplotutil.py` consumes CTR objects for analysis, plotting, and test/reference comparisons
45
+
46
+ ## Working principles
47
+
48
+ - Do not change scientific conventions silently.
49
+ - Treat explicit scale factors and coordinate transforms with care until you confirm the source and target meaning.
50
+ - Keep user-facing scientific behavior stable unless the task explicitly asks for a behavior change.
51
+ - When changing geometry or conversion code, preserve backwards compatibility for existing config files and stored calibration data if possible.
52
+ - Prefer adding comments and docstrings that state units at function boundaries over broad rewrites.
53
+ - Follow PEP 8 for new and modified code where practical, but do not force broad style churn in stable scientific code just to satisfy formatting preferences.
54
+
55
+ ## Unit conventions
56
+
57
+ Unit documentation is currently incomplete in the codebase. When adding or modifying code, make units explicit where they help avoid ambiguity, especially at config, UI, file-format, and library boundaries.
58
+
59
+ ### Default unit list
60
+
61
+ Unless a function or file format explicitly requires something else, use these defaults in new documentation and new user-facing labels:
62
+
63
+ - momentum transfer `Q`: `Angstrom^-1`
64
+ - reciprocal lattice vector lengths: `Angstrom^-1`
65
+ - reciprocal lattice coordinates `(h, k, l)`: `r.l.u.`
66
+ - wavelength: `Angstrom`
67
+ - X-ray energy: `keV`
68
+ - direct lattice constants `a, b, c`: `Angstrom`
69
+ - lattice angles `alpha, beta, gamma`: `deg`
70
+ - diffractometer angles (`mu`, `omega`, `delta`, `gamma`, `chi`, `phi`, azimuth, polarization axis): `deg` in config/UI, `rad` in internal geometry/math unless documented otherwise
71
+ - sample-detector distance `SDD`: `m` in config, often converted internally for Fit2D / pyFAI-facing APIs
72
+ - detector pixel size: `m` in config, often converted to `um` for Fit2D-style APIs and display
73
+ - detector center coordinates `cpx`, `cpy`: pixels
74
+ - image / ROI coordinates: pixels
75
+ - electron density: `electrons / Angstrom^3`
76
+ - structure factor / intensity: arbitrary units unless a calibrated scale is explicitly introduced
77
+
78
+ These defaults are guidance, not a mandate to rename established variables or rewrite stable scientific code just to restate units.
79
+
80
+ ### Known conversion hotspots
81
+
82
+ Be especially careful in these files:
83
+
84
+ - `orgui/app/QUBCalculator.py`
85
+ - energy `E` is user-facing in `keV`
86
+ - wavelength is user-facing in `Angstrom`
87
+ - the pyFAI geometry model wavelength is written in meters via `wavelength * 1e-10`
88
+ - `orgui/app/database.py`
89
+ - config `SDD` is read in meters, then passed to Fit2D-style APIs in millimeters
90
+ - config `pixelsize` is read in meters, then passed to Fit2D-style APIs in micrometers
91
+ - detector wavelength is stored in meters, while UB calculator wavelength is in Angstrom
92
+ - `orgui/datautils/xrayutils/HKLVlieg.py`
93
+ - lattice lengths are in Angstrom
94
+ - reciprocal vectors include the `2*pi` factor
95
+ - many angular APIs work in radians internally
96
+ - `orgui/datautils/xrayutils/DetectorCalibration.py`
97
+ - pyFAI geometry fields use pyFAI conventions
98
+ - some helpers export to mm or nm for external tools
99
+
100
+ If you touch one side of a conversion, inspect the matching inverse conversion in the same workflow when one exists.
101
+
102
+ ## Preferred documentation pattern
103
+
104
+ Documentation is planned to use Sphinx with Markedly Structured Text. New docstrings and docstring edits should therefore use explicit Sphinx-friendly Markedly Structured Text formatting instead of NumPy-style sections.
105
+
106
+ Every new public function should now have a docstring. In this repository, every function whose name does not start with `_` is considered public.
107
+
108
+ For any scientific function that crosses a unit boundary, prefer docstrings like:
109
+
110
+ ```python
111
+ def set_Xray_source(source_config):
112
+ """Set the X-ray source.
113
+
114
+ :param dict source_config:
115
+ Either ``{"E": ...}`` in keV or ``{"wavelength": ...}`` in Angstrom.
116
+ :raises ValueError:
117
+ If neither energy nor wavelength is provided.
118
+ """
119
+ ```
120
+
121
+ For GUI-only public functions, keep the normal summary line for Sphinx output and add the GUI-only marker as a nearby code comment. If useful for generated documentation, also add a Sphinx note:
122
+
123
+ ```python
124
+ # GUI-only: user-triggered dialog path. Must not run in CLI or batch mode.
125
+ def open_detector_dialog(self):
126
+ """Open the detector selection dialog.
127
+
128
+ .. note::
129
+ GUI-only. This path may create blocking dialogs and must not be
130
+ called from CLI, batch, or other shared non-interactive code.
131
+ """
132
+ ```
133
+
134
+ Explanation:
135
+
136
+ - use the `# GUI-only: ...` comment as the canonical code-review marker
137
+ - keep the first docstring line as a normal summary so Sphinx renders useful API docs
138
+ - use `.. note::` only when the GUI-only restriction should also appear in generated documentation
139
+
140
+ Good additions:
141
+
142
+ - mention whether angles are `deg` or `rad`
143
+ - mention whether `Q` is `Angstrom^-1` or `r.l.u.`
144
+ - mention whether a value is "user-facing/config/UI" or "internal/pyFAI/Fit2D"
145
+ - use explicit fields such as `:param:`, `:type:`, `:returns:`, `:rtype:`, and `:raises:` where helpful
146
+
147
+ ## Change guidance by area
148
+
149
+ ### Geometry, lattice, reciprocal-space math
150
+
151
+ - Treat `HKLVlieg.py`, `ReciprocalNavigation.py`, and `CTR*` modules as scientific core code.
152
+ - Preserve numerical conventions unless the change is deliberate and tested.
153
+ - Avoid changing sign conventions, axis ordering, or inclusion of `2*pi` without tracing downstream use.
154
+ - Review geometry assumptions, not only units.
155
+ - Add or update regression tests for any change in these files.
156
+
157
+ ### Detector calibration and image geometry
158
+
159
+ - Confirm pyFAI / Fit2D unit expectations before editing conversion code.
160
+ - Preserve round-trip behavior for pixel-to-angle and angle-to-pixel functions.
161
+ - If adding a new exported quantity, document its unit at the point of creation.
162
+
163
+ ### GUI code
164
+
165
+ - UI labels and tooltips should display units whenever a numerical field would be ambiguous.
166
+ - If a GUI action edits scientific parameters, trace through to the backend object to confirm unit consistency.
167
+ - Avoid changing GUI behavior and numerical behavior in the same patch unless necessary.
168
+ - Mark functions, methods, or local branches that are intentionally interactive as `GUI-only`.
169
+ - Unmarked code must be treated as shared code and therefore remain safe for CLI/headless execution.
170
+ - `QMessageBox`, `QProgressDialog`, and other modal blocking UI are allowed only in code explicitly marked `GUI-only`.
171
+ - Prefer a nearby comment such as `# GUI-only: user-triggered dialog path.`
172
+ - If the constraint should also appear in generated documentation, use a Sphinx-friendly docstring note such as `.. note:: GUI-only. Must not be called from CLI or batch mode.`
173
+
174
+ ## Startup and logging model
175
+
176
+ The repository has two startup modes selected in `orgui/main.py`:
177
+
178
+ - GUI mode
179
+ Starts a normal Qt application and calls `logger_utils.set_logging_context("gui")` before launching the main window.
180
+ - CLI / headless mode
181
+ Calls `logger_utils.set_logging_context("cli")`, sets `QT_QPA_PLATFORM=minimal`, and still creates a Qt application plus an `orGUI` main-window object for scripting access.
182
+
183
+ This means CLI mode is not "Qt-free". Shared code can still run inside a Qt application even when no GUI should block the session.
184
+
185
+ ### Logging behavior
186
+
187
+ The special handler logic lives in `orgui/logger_utils.py`.
188
+
189
+ - In GUI context:
190
+ - `MessageBoxHandler` is attached to the `orgui` logger hierarchy.
191
+ - A dialog is shown only when the log record has `extra={"show_dialog": True}`.
192
+ - `dialog_level` controls whether the dialog is shown as information, warning, or error.
193
+ - In CLI context:
194
+ - `CLIExceptionHandler` is attached to the same logger hierarchy.
195
+ - Any `ERROR` or higher record becomes an exception.
196
+ - `show_dialog` is ignored in CLI mode.
197
+ - `WARNING` and `INFO` records stay non-fatal log output.
198
+
199
+ ### Safe logging rules
200
+
201
+ - For shared code that may run in either GUI or CLI mode, do not create direct `QMessageBox` instances or other modal blocking dialogs. In such paths, blocking UI in CLI mode is a bug. Use logging and the context-aware handlers in `logger_utils` instead.
202
+ - Use `extra={"show_dialog": True, "parent": ..., "title": ..., "description": ...}` only when a GUI dialog is explicitly desired.
203
+ - If a condition should remain non-fatal in CLI mode, log it at `WARNING` or lower.
204
+ - If a condition should abort CLI execution, log it at `ERROR` or use `logger.exception(...)`.
205
+ - Do not rely on `dialog_level=logging.WARNING` to make an `ERROR` record non-fatal in CLI mode; CLI behavior is driven by the record level, not the dialog level.
206
+ - Be careful with `logger.exception(...)` in shared code: it logs at `ERROR` and therefore raises in CLI mode.
207
+
208
+ ### Dialog safety
209
+
210
+ Blocking dialogs in headless or automation paths are a fatal risk because CLI mode still has a Qt event environment but must not block on interactive UI.
211
+
212
+ - Avoid direct `qt.QMessageBox` calls in code paths that may run from CLI scripts, batch mode, worker threads, or non-interactive flows.
213
+ - Direct message boxes are acceptable in clearly GUI-only interaction paths where user confirmation is the whole point.
214
+ - When in doubt, route user-visible failure reporting through the logger handler instead of constructing dialogs directly.
215
+ - Never create modal dialogs from worker threads.
216
+
217
+ ### Progress reporting
218
+
219
+ - Prefer `logger_utils.create_progress_logger(...)` for new long-running work.
220
+ - In GUI mode it creates a `QProgressDialog`.
221
+ - In CLI mode it creates a logging-based progress reporter that emits `PROGRESS:...` messages instead of opening UI.
222
+ - Avoid raw `QProgressDialog` in shared or batch-capable paths; it is only appropriate for clearly GUI-only workflows.
223
+ - Update and finish progress objects from the controlling thread, not from worker threads.
224
+
225
+ ### File loading / backends
226
+
227
+ - New beamline loaders should normalize loaded metadata into the project's existing conventions rather than introducing backend-specific units deep in the app.
228
+ - Document any assumptions about angle direction, detector orientation, or energy units near the loader.
229
+
230
+ ## Validation expectations
231
+
232
+ For changes in scientific core code, run the narrowest relevant tests first, then broaden if needed:
233
+
234
+ - `ruff check orgui`
235
+ - `pytest orgui/datautils/xrayutils/test/test_HKLcalc.py`
236
+ - `pytest orgui/datautils/xrayutils/test/test_DetectorCalibration.py`
237
+ - `pytest orgui/datautils/xrayutils/test/test_CTRcalc.py`
238
+
239
+ When changing config-loading or unit-conversion code, also inspect:
240
+
241
+ - `examples/config_minimal`
242
+ - other `examples/config_*` files
243
+
244
+ If a change cannot be covered by an existing test, add at least one regression test or a precise docstring/comment explaining the invariant being preserved.
245
+
246
+ Lint findings should be fixed when they are local to the change, but lint cleanup must not drive risky scientific refactors.
247
+
248
+ ## Commit message convention
249
+
250
+ Use Conventional Commits for commit and merge messages, following the repository convention in issue #38. Prefer concise subjects such as `fix(phys): exclude masked pixels from rocking counters`.
251
+
252
+ - Allowed types are `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `style`, and `test`.
253
+ - Use the `phys` scope for any change that can affect measurement results, including counters, error propagation, physics math, or generated data.
254
+ - Mark breaking changes with `!` and include a `BREAKING CHANGE:` footer when old post-processing scripts or generated data compatibility may be affected.
255
+ - For merge commits, keep the subject conventional and add a short body only when it helps describe additional non-primary changes.
256
+
257
+ ## Safe change strategy
258
+
259
+ When working on a bug or feature:
260
+
261
+ 1. Identify whether the values involved are user-facing, config-facing, internal scientific values, or external library values.
262
+ 2. Write down the relevant conventions at each boundary before changing code: units, coordinate frame, angle convention, and any library-specific expectations.
263
+ 3. Verify both forward and inverse transforms if they exist.
264
+ 4. Prefer localized fixes over repository-wide "cleanup" in numerical code.
265
+ 5. Update docs, labels, or comments when a convention was previously implicit.
266
+
267
+ ## Things to avoid
268
+
269
+ - Do not replace explicit conversion factors with "cleaner" code unless the replacement is unit-audited.
270
+ - Do not rename variables in scientific code if that makes established literature conventions harder to follow.
271
+ - Do not remove old config behavior casually; many users likely depend on existing beamline and config conventions.
272
+ - Do not prioritize lint-only edits over preserving readable scientific intent.
273
+
274
+ ## Good first documentation targets
275
+
276
+ If the task is primarily documentation-oriented, these are high-value places to improve:
277
+
278
+ - config file field units in `examples/config_*`
279
+ - docstrings for geometry conversion methods in `HKLVlieg.py`
280
+ - docstrings for detector conversion methods in `DetectorCalibration.py`
281
+ - user-facing tooltips and labels in `QUBCalculator.py`