essdiffraction 26.8.1__tar.gz → 26.10.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 (139) hide show
  1. {essdiffraction-26.8.1/src/essdiffraction.egg-info → essdiffraction-26.10.0}/PKG-INFO +5 -2
  2. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/api-reference/index.md +18 -3
  3. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/beer/beer_modulation_mcstas.ipynb +12 -12
  4. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/beer/beer_powder_mcstas_analytical.ipynb +7 -6
  5. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/pyproject.toml +3 -1
  6. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/__init__.py +4 -0
  7. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/mcstas/__init__.py +2 -4
  8. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/mcstas/load.py +101 -55
  9. essdiffraction-26.10.0/src/ess/beer/workflow.py +221 -0
  10. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/beamline.py +109 -113
  11. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/workflows.py +2 -0
  12. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/__init__.py +2 -0
  13. essdiffraction-26.10.0/src/ess/powder/binning.py +70 -0
  14. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/calibration.py +19 -4
  15. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/conversion.py +14 -0
  16. essdiffraction-26.10.0/src/ess/powder/grouping.py +264 -0
  17. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/types.py +17 -1
  18. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/snspowder/powgen/workflow.py +2 -0
  19. {essdiffraction-26.8.1 → essdiffraction-26.10.0/src/essdiffraction.egg-info}/PKG-INFO +5 -2
  20. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/essdiffraction.egg-info/SOURCES.txt +3 -0
  21. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/essdiffraction.egg-info/requires.txt +5 -1
  22. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/essdiffraction.egg-info/scm_file_list.json +3 -0
  23. essdiffraction-26.10.0/src/essdiffraction.egg-info/scm_version.json +8 -0
  24. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/beer/mcstas_reduction_test.py +139 -23
  25. essdiffraction-26.10.0/tests/powder/binning_test.py +79 -0
  26. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/powder/conversion_test.py +32 -1
  27. essdiffraction-26.10.0/tests/powder/grouping_test.py +150 -0
  28. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/snspowder/powgen/powgen_reduction_test.py +1 -0
  29. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tools/docs/beer-thumbnails.ipynb +2 -2
  30. essdiffraction-26.8.1/src/ess/beer/workflow.py +0 -162
  31. essdiffraction-26.8.1/src/ess/powder/grouping.py +0 -141
  32. essdiffraction-26.8.1/src/essdiffraction.egg-info/scm_version.json +0 -8
  33. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/LICENSE +0 -0
  34. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/README.md +0 -0
  35. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/anaconda-icon.js +0 -0
  36. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/essdiffraction-search-logo.png +0 -0
  37. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/favicon.svg +0 -0
  38. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/logo-dark.svg +0 -0
  39. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/logo.svg +0 -0
  40. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/beer_mcstas_dark.svg +0 -0
  41. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/beer_mcstas_light.svg +0 -0
  42. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/beer_powder_reduction_dark.svg +0 -0
  43. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/beer_powder_reduction_light.svg +0 -0
  44. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/dream_advanced_powder_reduction_dark.svg +0 -0
  45. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/dream_advanced_powder_reduction_light.svg +0 -0
  46. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/dream_basic_powder_reduction_dark.svg +0 -0
  47. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_static/thumbnails/dream_basic_powder_reduction_light.svg +0 -0
  48. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_templates/class-template.rst +0 -0
  49. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_templates/doc_version.html +0 -0
  50. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_templates/layout.html +0 -0
  51. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/_templates/module-template.rst +0 -0
  52. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/about/bibliography.rst +0 -0
  53. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/about/index.md +0 -0
  54. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/bibliography.bib +0 -0
  55. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/conf.py +0 -0
  56. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/developer/coding-conventions.md +0 -0
  57. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/developer/dependency-management.md +0 -0
  58. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/developer/getting-started.md +0 -0
  59. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/developer/index.md +0 -0
  60. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/index.md +0 -0
  61. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/beer/index.md +0 -0
  62. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/common/index.md +0 -0
  63. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/common/vanadium_processing.ipynb +0 -0
  64. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/dream-advanced-powder-reduction.ipynb +0 -0
  65. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/dream-detector-diagnostics.ipynb +0 -0
  66. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/dream-instrument-view.ipynb +0 -0
  67. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/dream-make-wavelength-lookup-table.ipynb +0 -0
  68. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/dream-powder-reduction.ipynb +0 -0
  69. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/dream-visualize-absorption.ipynb +0 -0
  70. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/index.md +0 -0
  71. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/dream/workflow-widget-dream.ipynb +0 -0
  72. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/index.md +0 -0
  73. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/installation.md +0 -0
  74. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/magic/index.md +0 -0
  75. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/sns-instruments/POWGEN_data_reduction.ipynb +0 -0
  76. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/docs/user-guide/sns-instruments/index.md +0 -0
  77. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/resources/logo.svg +0 -0
  78. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/setup.cfg +0 -0
  79. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/clustering.py +0 -0
  80. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/conversions.py +0 -0
  81. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/data.py +0 -0
  82. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/io.py +0 -0
  83. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/mcstas/beamline.py +0 -0
  84. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/peakfinding.py +0 -0
  85. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/beer/types.py +0 -0
  86. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/diffraction/__init__.py +0 -0
  87. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/diffraction/pdf.py +0 -0
  88. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/diffraction/peaks.py +0 -0
  89. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/diffraction/py.typed +0 -0
  90. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/__init__.py +0 -0
  91. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/data.py +0 -0
  92. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/diagnostics.py +0 -0
  93. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/instrument_view.py +0 -0
  94. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/io/__init__.py +0 -0
  95. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/io/_common.py +0 -0
  96. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/io/cif.py +0 -0
  97. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/io/geant4.py +0 -0
  98. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/io/xye.py +0 -0
  99. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/parameters.py +0 -0
  100. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/dream/py.typed +0 -0
  101. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/magic/__init__.py +0 -0
  102. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/magic/beamline.py +0 -0
  103. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/magic/data.py +0 -0
  104. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/magic/types.py +0 -0
  105. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/magic/workflow.py +0 -0
  106. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/_util.py +0 -0
  107. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/correction.py +0 -0
  108. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/filtering.py +0 -0
  109. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/logging.py +0 -0
  110. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/masking.py +0 -0
  111. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/py.typed +0 -0
  112. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/smoothing.py +0 -0
  113. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/powder/workflow.py +0 -0
  114. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/snspowder/powgen/__init__.py +0 -0
  115. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/snspowder/powgen/beamline.py +0 -0
  116. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/snspowder/powgen/calibration.py +0 -0
  117. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/snspowder/powgen/data.py +0 -0
  118. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/snspowder/powgen/instrument_view.py +0 -0
  119. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/ess/snspowder/powgen/peaks.py +0 -0
  120. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/essdiffraction.egg-info/dependency_links.txt +0 -0
  121. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/src/essdiffraction.egg-info/top_level.txt +0 -0
  122. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/beer/mcstas_beamline_test.py +0 -0
  123. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/conftest.py +0 -0
  124. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/diffraction/pdf_test.py +0 -0
  125. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/diffraction/peaks_test.py +0 -0
  126. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/dream/diagnostics_test.py +0 -0
  127. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/dream/geant4_reduction_test.py +0 -0
  128. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/dream/instrument_view_test.py +0 -0
  129. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/dream/io/cif_test.py +0 -0
  130. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/dream/io/geant4_test.py +0 -0
  131. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/dream/workflows/dream_generic_workflow_test.py +0 -0
  132. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/magic/workflow_test.py +0 -0
  133. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/package_test.py +0 -0
  134. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/powder/correction_test.py +0 -0
  135. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/powder/filtering_test.py +0 -0
  136. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tests/snspowder/powgen/load_test.py +0 -0
  137. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tools/docs/dream-thumbnails.ipynb +0 -0
  138. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tools/preprocess_pg3_files.ipynb +0 -0
  139. {essdiffraction-26.8.1 → essdiffraction-26.10.0}/tools/shrink_nexus.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: essdiffraction
3
- Version: 26.8.1
3
+ Version: 26.10.0
4
4
  Summary: Diffraction data reduction for the European Spallation Source
5
5
  Author: Scipp contributors
6
6
  License-Expression: BSD-3-Clause
@@ -22,7 +22,7 @@ Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: dask>=2022.1.0
24
24
  Requires-Dist: graphviz>=0.20
25
- Requires-Dist: essreduce>=26.6.0
25
+ Requires-Dist: essreduce>=26.6.1
26
26
  Requires-Dist: mcstastox>=0.0.11
27
27
  Requires-Dist: numpy>=2
28
28
  Requires-Dist: plopp>=26.5.0
@@ -30,6 +30,7 @@ Requires-Dist: tof>=25.12.0
30
30
  Requires-Dist: ncrystal[cif]>=4.1.0
31
31
  Requires-Dist: spglib!=2.7,>=2.0.0
32
32
  Provides-Extra: test
33
+ Requires-Dist: numba>=0.63; extra == "test"
33
34
  Requires-Dist: pandas>=2.1.2; extra == "test"
34
35
  Requires-Dist: pooch>=1.5; extra == "test"
35
36
  Requires-Dist: pytest>=9.0; extra == "test"
@@ -53,6 +54,8 @@ Requires-Dist: sphinx-design>=0.5.0; extra == "docs"
53
54
  Requires-Dist: sphinxcontrib-bibtex>=2.5.0; extra == "docs"
54
55
  Requires-Dist: pyarrow>=12.0.0; extra == "docs"
55
56
  Requires-Dist: pythreejs>=2.4.1; extra == "docs"
57
+ Provides-Extra: all
58
+ Requires-Dist: essdiffraction[docs,test]; extra == "all"
56
59
  Dynamic: license-file
57
60
 
58
61
  [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
@@ -120,15 +120,30 @@
120
120
  ```{eval-rst}
121
121
  .. currentmodule:: ess.beer
122
122
 
123
+ .. autosummary::
124
+ :toctree: ../generated/functions
125
+
126
+ BeerModulationAutoMcStasWorkflow
127
+ BeerModulationKnownPeaksMcStasWorkflow
128
+ BeerPowderWorkflow
129
+ BeerPowderMcStasWorkflow
130
+ ```
131
+
132
+ ### Deprecated workflows
133
+
134
+ These names remain available for existing code. Use the replacement named in each
135
+ function's documentation and deprecation warning.
136
+
137
+ ```{eval-rst}
138
+ .. currentmodule:: ess.beer
139
+
123
140
  .. autosummary::
124
141
  :toctree: ../generated/functions
125
142
 
126
143
  BeerMcStasWorkflowPulseShaping
127
- BeerModMcStasWorkflowKnownPeaks
128
144
  BeerModMcStasWorkflow
129
- BeerPowderWorkflow
145
+ BeerModMcStasWorkflowKnownPeaks
130
146
  BeerPowderWorkflowAnalytical
131
- BeerPowderMcStasWorkflow
132
147
  ```
133
148
 
134
149
  ### Top-level functions
@@ -18,7 +18,7 @@
18
18
  "%matplotlib ipympl\n",
19
19
  "import plopp as pp\n",
20
20
  "\n",
21
- "from ess.beer import BeerModMcStasWorkflow, BeerModMcStasWorkflowKnownPeaks\n",
21
+ "from ess.beer import BeerModulationAutoMcStasWorkflow, BeerModulationKnownPeaksMcStasWorkflow\n",
22
22
  "from ess.beer.data import mcstas_silicon_new_model, silicon_peaks_array\n",
23
23
  "from ess.beer.types import *\n",
24
24
  "from ess.powder.types import *\n",
@@ -165,7 +165,7 @@
165
165
  "metadata": {},
166
166
  "outputs": [],
167
167
  "source": [
168
- "wf = BeerModMcStasWorkflowKnownPeaks()\n",
168
+ "wf = BeerModulationKnownPeaksMcStasWorkflow()\n",
169
169
  "wf[DetectorBank] = DetectorBank.north\n",
170
170
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(7)\n",
171
171
  "wf[DHKLList] = silicon_peaks_array()\n",
@@ -218,7 +218,7 @@
218
218
  "metadata": {},
219
219
  "outputs": [],
220
220
  "source": [
221
- "wf = BeerModMcStasWorkflow()\n",
221
+ "wf = BeerModulationAutoMcStasWorkflow()\n",
222
222
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(7)\n",
223
223
  "\n",
224
224
  "results = {}\n",
@@ -279,7 +279,7 @@
279
279
  "metadata": {},
280
280
  "outputs": [],
281
281
  "source": [
282
- "wf = BeerModMcStasWorkflowKnownPeaks()\n",
282
+ "wf = BeerModulationKnownPeaksMcStasWorkflow()\n",
283
283
  "wf[DetectorBank] = DetectorBank.south\n",
284
284
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(8)\n",
285
285
  "wf[DHKLList] = silicon_peaks_array()\n",
@@ -328,7 +328,7 @@
328
328
  "metadata": {},
329
329
  "outputs": [],
330
330
  "source": [
331
- "wf = BeerModMcStasWorkflow()\n",
331
+ "wf = BeerModulationAutoMcStasWorkflow()\n",
332
332
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(8)\n",
333
333
  "\n",
334
334
  "results = {}\n",
@@ -389,7 +389,7 @@
389
389
  "metadata": {},
390
390
  "outputs": [],
391
391
  "source": [
392
- "wf = BeerModMcStasWorkflowKnownPeaks()\n",
392
+ "wf = BeerModulationKnownPeaksMcStasWorkflow()\n",
393
393
  "wf[DetectorBank] = DetectorBank.south\n",
394
394
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(9)\n",
395
395
  "wf[DHKLList] = silicon_peaks_array()\n",
@@ -438,7 +438,7 @@
438
438
  "metadata": {},
439
439
  "outputs": [],
440
440
  "source": [
441
- "wf = BeerModMcStasWorkflow()\n",
441
+ "wf = BeerModulationAutoMcStasWorkflow()\n",
442
442
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(9)\n",
443
443
  "\n",
444
444
  "results = {}\n",
@@ -499,7 +499,7 @@
499
499
  "metadata": {},
500
500
  "outputs": [],
501
501
  "source": [
502
- "wf = BeerModMcStasWorkflowKnownPeaks()\n",
502
+ "wf = BeerModulationKnownPeaksMcStasWorkflow()\n",
503
503
  "wf[DetectorBank] = DetectorBank.south\n",
504
504
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(10)\n",
505
505
  "wf[DHKLList] = silicon_peaks_array()\n",
@@ -548,7 +548,7 @@
548
548
  "metadata": {},
549
549
  "outputs": [],
550
550
  "source": [
551
- "wf = BeerModMcStasWorkflow()\n",
551
+ "wf = BeerModulationAutoMcStasWorkflow()\n",
552
552
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(10)\n",
553
553
  "\n",
554
554
  "results = {}\n",
@@ -609,7 +609,7 @@
609
609
  "metadata": {},
610
610
  "outputs": [],
611
611
  "source": [
612
- "wf = BeerModMcStasWorkflowKnownPeaks()\n",
612
+ "wf = BeerModulationKnownPeaksMcStasWorkflow()\n",
613
613
  "wf[DetectorBank] = DetectorBank.south\n",
614
614
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(16)\n",
615
615
  "wf[DHKLList] = silicon_peaks_array()\n",
@@ -658,7 +658,7 @@
658
658
  "metadata": {},
659
659
  "outputs": [],
660
660
  "source": [
661
- "wf = BeerModMcStasWorkflow()\n",
661
+ "wf = BeerModulationAutoMcStasWorkflow()\n",
662
662
  "wf[Filename[SampleRun]] = mcstas_silicon_new_model(16)\n",
663
663
  "\n",
664
664
  "results = {}\n",
@@ -713,7 +713,7 @@
713
713
  "name": "python",
714
714
  "nbconvert_exporter": "python",
715
715
  "pygments_lexer": "ipython3",
716
- "version": "3.11.13"
716
+ "version": "3.12.13"
717
717
  }
718
718
  },
719
719
  "nbformat": 4,
@@ -80,7 +80,12 @@
80
80
  "outputs": [],
81
81
  "source": [
82
82
  "workflow[DetectorBank] = DetectorBank.north\n",
83
- "workflow[DspacingBins] = sc.linspace(\"dspacing\", 0.6, 2.0, 701, unit=\"angstrom\")"
83
+ "\n",
84
+ "# Select the number of dspacing bins.\n",
85
+ "# By default the range of `DspacingBins` (the binning in dspacing) is\n",
86
+ "# selected to be the dspacing range covered by the instrument.\n",
87
+ "workflow[DspacingNBins] = 1000\n",
88
+ "workflow.compute(DspacingBins)"
84
89
  ]
85
90
  },
86
91
  {
@@ -198,8 +203,6 @@
198
203
  " title=\"Intensity over dspacing\",\n",
199
204
  " xlabel=r\"$d$-spacing [$\\AA$]\",\n",
200
205
  " ylabel=f\"Intensity [{histogram.unit}]\",\n",
201
- " xmin=sc.scalar(0.6, unit=\"angstrom\"),\n",
202
- " xmax=sc.scalar(2.0, unit=\"angstrom\"),\n",
203
206
  ")\n",
204
207
  "\n",
205
208
  "ymin, ymax = fig.ax.get_ylim()\n",
@@ -308,8 +311,6 @@
308
311
  " },\n",
309
312
  " xlabel=r\"$d$-spacing [$\\AA$]\",\n",
310
313
  " ylabel=f\"Intensity [{histogram.unit}]\",\n",
311
- " xmin=sc.scalar(0.6, unit=\"angstrom\"),\n",
312
- " xmax=sc.scalar(2.0, unit=\"angstrom\"),\n",
313
314
  ")\n",
314
315
  "\n",
315
316
  "ymin, ymax = fig.ax.get_ylim()\n",
@@ -337,7 +338,7 @@
337
338
  "name": "python",
338
339
  "nbconvert_exporter": "python",
339
340
  "pygments_lexer": "ipython3",
340
- "version": "3.11.13"
341
+ "version": "3.12.13"
341
342
  }
342
343
  },
343
344
  "nbformat": 4,
@@ -31,7 +31,7 @@ requires-python = ">=3.12"
31
31
  dependencies = [
32
32
  "dask>=2022.1.0",
33
33
  "graphviz>=0.20",
34
- "essreduce>=26.6.0",
34
+ "essreduce>=26.6.1",
35
35
  "mcstastox>=0.0.11",
36
36
  "numpy>=2",
37
37
  "plopp>=26.5.0",
@@ -44,6 +44,7 @@ dynamic = ["version"]
44
44
 
45
45
  [project.optional-dependencies]
46
46
  test = [
47
+ "numba>=0.63",
47
48
  "pandas>=2.1.2",
48
49
  "pooch>=1.5",
49
50
  "pytest>=9.0",
@@ -71,6 +72,7 @@ docs = [
71
72
  "pyarrow>=12.0.0",
72
73
  "pythreejs>=2.4.1",
73
74
  ]
75
+ all = ["essdiffraction[test,docs]"]
74
76
 
75
77
  [project.urls]
76
78
  "Bug Tracker" = "https://github.com/scipp/ess/issues"
@@ -13,6 +13,8 @@ from .workflow import (
13
13
  BeerMcStasWorkflowPulseShaping,
14
14
  BeerModMcStasWorkflow,
15
15
  BeerModMcStasWorkflowKnownPeaks,
16
+ BeerModulationAutoMcStasWorkflow,
17
+ BeerModulationKnownPeaksMcStasWorkflow,
16
18
  BeerPowderMcStasWorkflow,
17
19
  BeerPowderWorkflow,
18
20
  BeerPowderWorkflowAnalytical,
@@ -30,6 +32,8 @@ __all__ = [
30
32
  'BeerMcStasWorkflowPulseShaping',
31
33
  'BeerModMcStasWorkflow',
32
34
  'BeerModMcStasWorkflowKnownPeaks',
35
+ 'BeerModulationAutoMcStasWorkflow',
36
+ 'BeerModulationKnownPeaksMcStasWorkflow',
33
37
  'BeerPowderMcStasWorkflow',
34
38
  'BeerPowderWorkflow',
35
39
  'BeerPowderWorkflowAnalytical',
@@ -11,9 +11,8 @@ from .beamline import (
11
11
  from .load import (
12
12
  chopper_mode_from_mcstas_mode,
13
13
  load_beer_mcstas,
14
+ load_beer_mcstas_geometry,
14
15
  load_beer_mcstas_monitor,
15
- load_beer_mcstas_monitor_provider,
16
- load_beer_mcstas_provider,
17
16
  mcstas_choppers,
18
17
  mcstas_detector_ltotal,
19
18
  mcstas_providers,
@@ -26,9 +25,8 @@ __all__ = [
26
25
  'PulseShapingMode',
27
26
  'chopper_mode_from_mcstas_mode',
28
27
  'load_beer_mcstas',
28
+ 'load_beer_mcstas_geometry',
29
29
  'load_beer_mcstas_monitor',
30
- 'load_beer_mcstas_monitor_provider',
31
- 'load_beer_mcstas_provider',
32
30
  'mcstas_choppers',
33
31
  'mcstas_detector_ltotal',
34
32
  'mcstas_providers',
@@ -7,7 +7,7 @@ from pathlib import Path
7
7
  import mcstastox
8
8
  import scipp as sc
9
9
  import scippnexus as snx
10
- from ess.powder.types import CaveMonitor, RunType, WavelengthMonitor
10
+ from ess.powder.types import CaveMonitor, EmptyDetector, RunType, WavelengthMonitor
11
11
 
12
12
  from ess.reduce.nexus.types import DiskChoppers, Position
13
13
  from ess.reduce.unwrap.types import DetectorLtotal
@@ -24,9 +24,8 @@ _MCSTAS_T_OFFSET = sc.scalar(1.6, unit='ms')
24
24
  __all__ = [
25
25
  'chopper_mode_from_mcstas_mode',
26
26
  'load_beer_mcstas',
27
+ 'load_beer_mcstas_geometry',
27
28
  'load_beer_mcstas_monitor',
28
- 'load_beer_mcstas_monitor_provider',
29
- 'load_beer_mcstas_provider',
30
29
  'mcstas_choppers',
31
30
  'mcstas_detector_ltotal',
32
31
  'mcstas_providers',
@@ -62,6 +61,25 @@ def _detector_components(data: mcstastox.Read, bank: DetectorBank) -> list[str]:
62
61
  )
63
62
 
64
63
 
64
+ def _load_position_table(data: mcstastox.Read, components: list[str]) -> sc.DataArray:
65
+ """Load pixel positions for selected detector components."""
66
+ position_tables = []
67
+ for component in components:
68
+ positions = data.get_component_global(component)
69
+ begin, end = data.pixel_range[component]
70
+ position_tables.append(
71
+ sc.DataArray(
72
+ sc.vectors(dims=['pixel_id'], values=positions, unit='m'),
73
+ coords={
74
+ 'pixel_id': sc.arange(
75
+ 'pixel_id', int(begin), int(end) + 1, dtype='int32'
76
+ )
77
+ },
78
+ )
79
+ )
80
+ return sc.sort(sc.concat(position_tables, dim='pixel_id'), key='pixel_id')
81
+
82
+
65
83
  def _load_events(data: mcstastox.Read, components: list[str]) -> sc.DataArray:
66
84
  """Load weighted events and pixel positions for selected components only.
67
85
 
@@ -86,34 +104,23 @@ def _load_events(data: mcstastox.Read, components: list[str]) -> sc.DataArray:
86
104
  ),
87
105
  't': sc.array(dims=['events'], values=event_data['t'], unit='s'),
88
106
  },
89
- ).group('pixel_id')
90
-
91
- position_tables = []
92
- for component in components:
93
- positions = data.get_component_global(component)
94
- begin, end = data.pixel_range[component]
95
- position_tables.append(
96
- sc.DataArray(
97
- sc.vectors(dims=['pixel_id'], values=positions, unit='m'),
98
- coords={
99
- 'pixel_id': sc.arange(
100
- 'pixel_id', int(begin), int(end) + 1, dtype='int32'
101
- )
102
- },
103
- )
104
- )
107
+ )
105
108
 
106
- position_table = sc.sort(sc.concat(position_tables, dim='pixel_id'), key='pixel_id')
107
- events.coords['position'] = sc.lookup(
108
- position_table, dim='pixel_id', mode='previous'
109
- )[events.coords['pixel_id']]
109
+ position_table = _load_position_table(data, components)
110
+ events = events.group(position_table.coords['pixel_id'])
111
+ events.coords['position'] = position_table.data
110
112
  return events
111
113
 
112
114
 
115
+ def _load_mode(data: mcstastox.Read) -> str:
116
+ mode = data.file['entry1/simulation/Param/mode'][0]
117
+ return mode.decode() if isinstance(mode, bytes) else str(mode)
118
+
119
+
113
120
  def load_beer_mcstas(
114
- filename: str | Path,
121
+ filename: Filename[RunType],
115
122
  bank: DetectorBank,
116
- ) -> sc.DataArray:
123
+ ) -> RawDetector[RunType]:
117
124
  """Load a detector bank from a BEER McStas file."""
118
125
  if not isinstance(bank, DetectorBank):
119
126
  raise ValueError(
@@ -122,25 +129,64 @@ def load_beer_mcstas(
122
129
  )
123
130
 
124
131
  if bank == DetectorBank.both:
125
- return sc.concat(
126
- [
127
- load_beer_mcstas(filename, bank)
128
- for bank in (DetectorBank.south, DetectorBank.north)
129
- ],
130
- dim='pixel_id',
132
+ return RawDetector[RunType](
133
+ sc.concat(
134
+ [
135
+ load_beer_mcstas(filename, bank)
136
+ for bank in (DetectorBank.south, DetectorBank.north)
137
+ ],
138
+ dim='pixel_id',
139
+ )
131
140
  )
132
141
 
133
142
  filename = Path(filename)
134
143
  with mcstastox.Read(filename.parent, filename.name) as data:
135
- mode = data.file['entry1/simulation/Param/mode'][0]
136
- mode = mode.decode() if isinstance(mode, bytes) else str(mode)
144
+ mode = _load_mode(data)
137
145
  events = _load_events(data, _detector_components(data, bank))
138
146
 
139
147
  events.coords['mode'] = sc.scalar(mode)
140
148
  events.bins.coords['event_time_offset'] = (
141
149
  events.bins.coords.pop('t') + _MCSTAS_T_OFFSET.to(unit='s')
142
150
  ) % sc.scalar(1 / 14, unit='s')
143
- return events
151
+ return RawDetector[RunType](events)
152
+
153
+
154
+ def load_beer_mcstas_geometry(
155
+ filename: Filename[RunType],
156
+ bank: DetectorBank,
157
+ ) -> EmptyDetector[RunType]:
158
+ """Load detector geometry from a BEER McStas file without loading events."""
159
+ if not isinstance(bank, DetectorBank):
160
+ raise ValueError(
161
+ 'bank must be ``DetectorBank.north``, '
162
+ '``DetectorBank.south``, or ``DetectorBank.both``'
163
+ )
164
+
165
+ if bank == DetectorBank.both:
166
+ return EmptyDetector[RunType](
167
+ sc.concat(
168
+ [
169
+ load_beer_mcstas_geometry(filename, bank)
170
+ for bank in (DetectorBank.south, DetectorBank.north)
171
+ ],
172
+ dim='pixel_id',
173
+ )
174
+ )
175
+
176
+ filename = Path(filename)
177
+ with mcstastox.Read(filename.parent, filename.name) as data:
178
+ positions = _load_position_table(data, _detector_components(data, bank))
179
+
180
+ pixel_id = positions.coords['pixel_id']
181
+ return EmptyDetector[RunType](
182
+ sc.DataArray(
183
+ pixel_id,
184
+ coords={
185
+ 'pixel_id': pixel_id,
186
+ 'position': positions.data,
187
+ },
188
+ )
189
+ )
144
190
 
145
191
 
146
192
  def _to_edges(centers: sc.Variable) -> sc.Variable:
@@ -155,7 +201,9 @@ def _to_edges(centers: sc.Variable) -> sc.Variable:
155
201
  )
156
202
 
157
203
 
158
- def load_beer_mcstas_monitor(filename: str | Path) -> sc.DataArray:
204
+ def load_beer_mcstas_monitor(
205
+ filename: Filename[RunType],
206
+ ) -> WavelengthMonitor[RunType, CaveMonitor]:
159
207
  """Load the BEER McStas wavelength monitor."""
160
208
  filename = Path(filename)
161
209
  with mcstastox.Read(filename.parent, filename.name) as data:
@@ -191,21 +239,7 @@ def load_beer_mcstas_monitor(filename: str | Path) -> sc.DataArray:
191
239
  ),
192
240
  },
193
241
  )
194
- return da
195
-
196
-
197
- def load_beer_mcstas_provider(
198
- fname: Filename[RunType], bank: DetectorBank
199
- ) -> RawDetector[RunType]:
200
- """Sciline provider for loading BEER McStas detector data."""
201
- return load_beer_mcstas(fname, bank)
202
-
203
-
204
- def load_beer_mcstas_monitor_provider(
205
- fname: Filename[RunType],
206
- ) -> WavelengthMonitor[RunType, CaveMonitor]:
207
- """Sciline provider for loading the BEER McStas wavelength monitor."""
208
- return load_beer_mcstas_monitor(fname)
242
+ return WavelengthMonitor[RunType, CaveMonitor](da)
209
243
 
210
244
 
211
245
  _MCSTAS_CHOPPER_MODES = {
@@ -287,22 +321,34 @@ def mcstas_choppers(
287
321
  return simulation_choppers(mode, source_position)
288
322
 
289
323
 
324
+ def _mcstas_choppers_from_file(
325
+ fname: Filename[RunType],
326
+ source_position: Position[snx.NXsource, RunType],
327
+ ) -> DiskChoppers[RunType]:
328
+ """Return BEER choppers without loading detector events."""
329
+ fname = Path(fname)
330
+ with mcstastox.Read(fname.parent, fname.name) as data:
331
+ mode = chopper_mode_from_mcstas_mode(_load_mode(data))
332
+ return simulation_choppers(mode, source_position)
333
+
334
+
290
335
  def mcstas_detector_ltotal(
291
- da: RawDetector[RunType],
336
+ detector: EmptyDetector[RunType],
292
337
  source_position: Position[snx.NXsource, RunType],
293
338
  sample_position: Position[snx.NXsample, RunType],
294
339
  ) -> DetectorLtotal[RunType]:
295
340
  """Return moderator-to-detector flight path lengths for BEER McStas data."""
296
341
  source_to_sample = sc.norm(sample_position - source_position)
297
- sample_to_detector = sc.norm(da.coords['position'] - sample_position)
342
+ sample_to_detector = sc.norm(detector.coords['position'] - sample_position)
298
343
  return source_to_sample + sample_to_detector
299
344
 
300
345
 
301
346
  mcstas_providers = (
302
- load_beer_mcstas_provider,
303
- load_beer_mcstas_monitor_provider,
347
+ load_beer_mcstas,
348
+ load_beer_mcstas_geometry,
349
+ load_beer_mcstas_monitor,
304
350
  mcstas_source_position,
305
351
  mcstas_sample_position,
306
- mcstas_choppers,
352
+ _mcstas_choppers_from_file,
307
353
  mcstas_detector_ltotal,
308
354
  )