essdiffraction 26.5.2__tar.gz → 26.6.1__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 (133) hide show
  1. {essdiffraction-26.5.2/src/essdiffraction.egg-info → essdiffraction-26.6.1}/PKG-INFO +19 -23
  2. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/api-reference/index.md +26 -6
  3. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/conf.py +4 -0
  4. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/dream-make-wavelength-lookup-table.ipynb +5 -5
  5. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/pyproject.toml +18 -22
  6. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/beer/__init__.py +11 -1
  7. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/beer/clustering.py +2 -2
  8. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/beer/conversions.py +7 -26
  9. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/beer/data.py +1 -1
  10. essdiffraction-26.6.1/src/ess/beer/io.py +21 -0
  11. essdiffraction-26.6.1/src/ess/beer/mcstas/__init__.py +42 -0
  12. essdiffraction-26.6.1/src/ess/beer/mcstas/beamline.py +201 -0
  13. essdiffraction-26.5.2/src/ess/beer/io.py → essdiffraction-26.6.1/src/ess/beer/mcstas/load.py +112 -24
  14. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/beer/workflow.py +78 -1
  15. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/diffraction/__init__.py +4 -0
  16. essdiffraction-26.6.1/src/ess/diffraction/pdf.py +276 -0
  17. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/diffraction/peaks.py +1 -1
  18. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/workflows.py +11 -3
  19. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/__init__.py +0 -2
  20. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/types.py +2 -2
  21. {essdiffraction-26.5.2 → essdiffraction-26.6.1/src/essdiffraction.egg-info}/PKG-INFO +19 -23
  22. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/essdiffraction.egg-info/SOURCES.txt +8 -2
  23. essdiffraction-26.6.1/src/essdiffraction.egg-info/requires.txt +32 -0
  24. essdiffraction-26.6.1/src/essdiffraction.egg-info/scm_file_list.json +124 -0
  25. essdiffraction-26.6.1/src/essdiffraction.egg-info/scm_version.json +8 -0
  26. essdiffraction-26.6.1/tests/beer/mcstas_beamline_test.py +89 -0
  27. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/beer/mcstas_reduction_test.py +61 -6
  28. essdiffraction-26.6.1/tests/diffraction/pdf_test.py +164 -0
  29. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/dream/geant4_reduction_test.py +75 -84
  30. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/dream/workflows/dream_generic_workflow_test.py +2 -2
  31. essdiffraction-26.5.2/src/ess/powder/transform.py +0 -89
  32. essdiffraction-26.5.2/src/essdiffraction.egg-info/requires.txt +0 -36
  33. essdiffraction-26.5.2/tests/powder/transform_test.py +0 -86
  34. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/.copier-answers.ess.yml +0 -0
  35. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/.copier-answers.yml +0 -0
  36. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/LICENSE +0 -0
  37. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/README.md +0 -0
  38. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/anaconda-icon.js +0 -0
  39. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/essdiffraction-search-logo.png +0 -0
  40. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/favicon.svg +0 -0
  41. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/logo-dark.svg +0 -0
  42. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/logo.svg +0 -0
  43. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/thumbnails/beer_mcstas_dark.svg +0 -0
  44. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/thumbnails/beer_mcstas_light.svg +0 -0
  45. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/thumbnails/dream_advanced_powder_reduction_dark.svg +0 -0
  46. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/thumbnails/dream_advanced_powder_reduction_light.svg +0 -0
  47. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/thumbnails/dream_basic_powder_reduction_dark.svg +0 -0
  48. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_static/thumbnails/dream_basic_powder_reduction_light.svg +0 -0
  49. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_templates/class-template.rst +0 -0
  50. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_templates/doc_version.html +0 -0
  51. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_templates/layout.html +0 -0
  52. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/_templates/module-template.rst +0 -0
  53. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/about/bibliography.rst +0 -0
  54. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/about/index.md +0 -0
  55. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/bibliography.bib +0 -0
  56. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/developer/coding-conventions.md +0 -0
  57. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/developer/dependency-management.md +0 -0
  58. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/developer/getting-started.md +0 -0
  59. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/developer/index.md +0 -0
  60. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/index.md +0 -0
  61. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/beer/beer_modulation_mcstas.ipynb +0 -0
  62. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/beer/index.md +0 -0
  63. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/common/index.md +0 -0
  64. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/common/vanadium_processing.ipynb +0 -0
  65. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/dream-advanced-powder-reduction.ipynb +0 -0
  66. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/dream-detector-diagnostics.ipynb +0 -0
  67. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/dream-instrument-view.ipynb +0 -0
  68. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/dream-powder-reduction.ipynb +0 -0
  69. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/dream-visualize-absorption.ipynb +0 -0
  70. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/index.md +0 -0
  71. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/dream/workflow-widget-dream.ipynb +0 -0
  72. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/index.md +0 -0
  73. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/installation.md +0 -0
  74. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/magic/index.md +0 -0
  75. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/sns-instruments/POWGEN_data_reduction.ipynb +0 -0
  76. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/docs/user-guide/sns-instruments/index.md +0 -0
  77. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/resources/logo.svg +0 -0
  78. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/setup.cfg +0 -0
  79. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/beer/peakfinding.py +0 -0
  80. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/beer/types.py +0 -0
  81. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/diffraction/py.typed +0 -0
  82. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/__init__.py +0 -0
  83. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/beamline.py +0 -0
  84. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/data.py +0 -0
  85. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/diagnostics.py +0 -0
  86. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/instrument_view.py +0 -0
  87. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/io/__init__.py +0 -0
  88. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/io/cif.py +0 -0
  89. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/io/geant4.py +0 -0
  90. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/parameters.py +0 -0
  91. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/dream/py.typed +0 -0
  92. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/magic/__init__.py +0 -0
  93. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/magic/beamline.py +0 -0
  94. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/magic/data.py +0 -0
  95. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/magic/types.py +0 -0
  96. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/magic/workflow.py +0 -0
  97. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/_util.py +0 -0
  98. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/calibration.py +0 -0
  99. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/conversion.py +0 -0
  100. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/correction.py +0 -0
  101. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/filtering.py +0 -0
  102. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/grouping.py +0 -0
  103. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/logging.py +0 -0
  104. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/masking.py +0 -0
  105. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/py.typed +0 -0
  106. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/smoothing.py +0 -0
  107. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/powder/workflow.py +0 -0
  108. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/snspowder/powgen/__init__.py +0 -0
  109. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/snspowder/powgen/beamline.py +0 -0
  110. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/snspowder/powgen/calibration.py +0 -0
  111. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/snspowder/powgen/data.py +0 -0
  112. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/snspowder/powgen/instrument_view.py +0 -0
  113. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/snspowder/powgen/peaks.py +0 -0
  114. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/ess/snspowder/powgen/workflow.py +0 -0
  115. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/essdiffraction.egg-info/dependency_links.txt +0 -0
  116. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/src/essdiffraction.egg-info/top_level.txt +0 -0
  117. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/conftest.py +0 -0
  118. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/diffraction/peaks_test.py +0 -0
  119. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/dream/diagnostics_test.py +0 -0
  120. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/dream/instrument_view_test.py +0 -0
  121. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/dream/io/cif_test.py +0 -0
  122. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/dream/io/geant4_test.py +0 -0
  123. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/magic/workflow_test.py +0 -0
  124. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/package_test.py +0 -0
  125. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/powder/conversion_test.py +0 -0
  126. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/powder/correction_test.py +0 -0
  127. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/powder/filtering_test.py +0 -0
  128. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/snspowder/powgen/load_test.py +0 -0
  129. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tests/snspowder/powgen/powgen_reduction_test.py +0 -0
  130. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tools/docs/beer-thumbnails.ipynb +0 -0
  131. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tools/docs/dream-thumbnails.ipynb +0 -0
  132. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tools/preprocess_pg3_files.ipynb +0 -0
  133. {essdiffraction-26.5.2 → essdiffraction-26.6.1}/tools/shrink_nexus.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: essdiffraction
3
- Version: 26.5.2
3
+ Version: 26.6.1
4
4
  Summary: Diffraction data reduction for the European Spallation Source
5
5
  Author: Scipp contributors
6
6
  License-Expression: BSD-3-Clause
@@ -21,39 +21,35 @@ Requires-Python: >=3.11
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: dask>=2022.1.0
24
- Requires-Dist: essreduce>=26.4.0
25
- Requires-Dist: graphviz
24
+ Requires-Dist: graphviz>=0.20
25
+ Requires-Dist: essreduce>=26.6.0
26
26
  Requires-Dist: numpy>=2
27
- Requires-Dist: plopp>=26.2.0
27
+ Requires-Dist: plopp>=26.5.0
28
28
  Requires-Dist: pythreejs>=2.4.1
29
- Requires-Dist: sciline>=25.04.1
30
- Requires-Dist: scipp>=25.11.0
31
- Requires-Dist: scippneutron>=26.3.0
32
- Requires-Dist: scippnexus>=23.12.0
33
29
  Requires-Dist: tof>=25.12.0
34
30
  Requires-Dist: ncrystal[cif]>=4.1.0
35
- Requires-Dist: spglib!=2.7
31
+ Requires-Dist: spglib!=2.7,>=2.0.0
36
32
  Provides-Extra: test
37
33
  Requires-Dist: pandas>=2.1.2; extra == "test"
38
34
  Requires-Dist: pooch>=1.5; extra == "test"
39
35
  Requires-Dist: pytest>=7.0; extra == "test"
40
36
  Requires-Dist: ipywidgets>=8.1.7; extra == "test"
41
37
  Provides-Extra: docs
42
- Requires-Dist: autodoc-pydantic; extra == "docs"
43
- Requires-Dist: ipykernel; extra == "docs"
44
- Requires-Dist: ipympl; extra == "docs"
45
- Requires-Dist: ipython!=8.7.0; extra == "docs"
46
- Requires-Dist: myst-parser; extra == "docs"
47
- Requires-Dist: nbsphinx; extra == "docs"
48
- Requires-Dist: pandas; extra == "docs"
49
- Requires-Dist: pooch; extra == "docs"
38
+ Requires-Dist: autodoc-pydantic>=2.0.0; extra == "docs"
39
+ Requires-Dist: ipykernel>=6.20.0; extra == "docs"
40
+ Requires-Dist: ipympl>=0.9.0; extra == "docs"
41
+ Requires-Dist: ipython!=8.7.0,>=8.8.0; extra == "docs"
42
+ Requires-Dist: myst-parser>=2.0.0; extra == "docs"
43
+ Requires-Dist: nbsphinx>=0.9.3; extra == "docs"
44
+ Requires-Dist: pandas>=2.1.2; extra == "docs"
45
+ Requires-Dist: pooch>=1.5; extra == "docs"
50
46
  Requires-Dist: pydata-sphinx-theme>=0.14; extra == "docs"
51
- Requires-Dist: sphinx; extra == "docs"
52
- Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
53
- Requires-Dist: sphinx-copybutton; extra == "docs"
54
- Requires-Dist: sphinx-design; extra == "docs"
55
- Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
56
- Requires-Dist: pyarrow; extra == "docs"
47
+ Requires-Dist: sphinx>=7; extra == "docs"
48
+ Requires-Dist: sphinx-autodoc-typehints>=1.24.0; extra == "docs"
49
+ Requires-Dist: sphinx-copybutton>=0.5.2; extra == "docs"
50
+ Requires-Dist: sphinx-design>=0.5.0; extra == "docs"
51
+ Requires-Dist: sphinxcontrib-bibtex>=2.5.0; extra == "docs"
52
+ Requires-Dist: pyarrow>=12.0.0; extra == "docs"
57
53
  Dynamic: license-file
58
54
 
59
55
  [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
@@ -1,8 +1,25 @@
1
1
  # API Reference
2
2
 
3
+ ## ESSdiffraction
4
+
5
+ ### Submodules
6
+
7
+ ```{eval-rst}
8
+ .. currentmodule:: ess.diffraction
9
+
10
+ .. autosummary::
11
+ :toctree: ../generated/modules
12
+ :template: module-template.rst
13
+ :recursive:
14
+
15
+ pdf
16
+ peaks
17
+ ```
18
+
3
19
  ## ESSpowder
4
20
 
5
21
  ### Module Attributes
22
+
6
23
  ```{eval-rst}
7
24
  .. currentmodule:: ess.powder
8
25
 
@@ -37,9 +54,7 @@
37
54
  grouping
38
55
  logging
39
56
  masking
40
- peaks
41
57
  smoothing
42
- transform
43
58
  types
44
59
  ```
45
60
 
@@ -47,7 +62,6 @@
47
62
 
48
63
  ### Workflows
49
64
 
50
-
51
65
  ```{eval-rst}
52
66
  .. currentmodule:: ess.dream
53
67
 
@@ -103,15 +117,20 @@
103
117
 
104
118
  ### Workflows
105
119
 
106
-
107
120
  ```{eval-rst}
108
121
  .. currentmodule:: ess.beer
109
122
 
110
123
  .. autosummary::
111
124
  :toctree: ../generated/functions
112
125
 
126
+ BeerMcStasWorkflowPulseShaping
127
+ BeerMcStasWorkflowPulseShapingAnalytical
113
128
  BeerModMcStasWorkflowKnownPeaks
114
129
  BeerModMcStasWorkflow
130
+ BeerPowderWorkflow
131
+ BeerPowderWorkflowAnalytical
132
+ BeerPowderMcStasWorkflow
133
+ BeerPowderMcStasWorkflowAnalytical
115
134
  ```
116
135
 
117
136
  ### Top-level functions
@@ -122,7 +141,8 @@
122
141
  .. autosummary::
123
142
  :toctree: ../generated/functions
124
143
 
125
- load_beer_mcstas
144
+ dhkl_peaks_from_cif
145
+ load_beer_mcstas
126
146
  ```
127
147
 
128
148
  ### Submodules
@@ -137,6 +157,7 @@
137
157
  conversions
138
158
  data
139
159
  io
160
+ mcstas
140
161
  workflow
141
162
  ```
142
163
 
@@ -144,7 +165,6 @@
144
165
 
145
166
  ### Workflows
146
167
 
147
-
148
168
  ```{eval-rst}
149
169
  .. currentmodule:: ess.magic
150
170
 
@@ -249,8 +249,12 @@ nbsphinx_execute_arguments = [
249
249
  # build already tests if those plots can be made.
250
250
  # So we simply disable plots in doctests.
251
251
  doctest_global_setup = """
252
+ # Private import because of https://github.com/mctools/ncrystal/issues/361
253
+ from NCrystal._common import set_ncrystal_print_fct
252
254
  import numpy as np
253
255
 
256
+ set_ncrystal_print_fct(lambda *args, **kwargs: None)
257
+
254
258
  try:
255
259
  import scipp as sc
256
260
 
@@ -18,8 +18,9 @@
18
18
  "outputs": [],
19
19
  "source": [
20
20
  "import scipp as sc\n",
21
+ "import scippnexus as snx\n",
21
22
  "from ess.reduce import unwrap\n",
22
- "from ess.reduce.nexus.types import AnyRun\n",
23
+ "from ess.reduce.nexus.types import AnyRun, Position\n",
23
24
  "from ess.dream.beamline import InstrumentConfiguration, choppers"
24
25
  ]
25
26
  },
@@ -62,14 +63,13 @@
62
63
  "source": [
63
64
  "wf = unwrap.LookupTableWorkflow()\n",
64
65
  "\n",
65
- "wf[unwrap.LtotalRange] = sc.scalar(5.0, unit=\"m\"), sc.scalar(80.0, unit=\"m\")\n",
66
+ "wf[unwrap.LtotalRange[AnyRun, snx.NXdetector]] = sc.scalar(5.0, unit=\"m\"), sc.scalar(80.0, unit=\"m\")\n",
66
67
  "wf[unwrap.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
67
- "wf[unwrap.SourcePosition] = sc.vector([0, 0, 0], unit='m')\n",
68
+ "wf[Position[snx.NXsource, AnyRun]] = sc.vector([0, 0, 0], unit='m')\n",
68
69
  "wf[unwrap.DiskChoppers[AnyRun]] = disk_choppers\n",
69
70
  "wf[unwrap.DistanceResolution] = sc.scalar(0.1, unit=\"m\")\n",
70
71
  "wf[unwrap.TimeResolution] = sc.scalar(250.0, unit='us')\n",
71
72
  "wf[unwrap.PulsePeriod] = 1.0 / sc.scalar(14.0, unit=\"Hz\")\n",
72
- "wf[unwrap.PulseStride] = 1\n",
73
73
  "wf[unwrap.PulseStrideOffset] = None"
74
74
  ]
75
75
  },
@@ -88,7 +88,7 @@
88
88
  "metadata": {},
89
89
  "outputs": [],
90
90
  "source": [
91
- "table = wf.compute(unwrap.LookupTable)\n",
91
+ "table = wf.compute(unwrap.LookupTable[AnyRun, snx.NXdetector])\n",
92
92
  "table.array"
93
93
  ]
94
94
  },
@@ -30,18 +30,14 @@ requires-python = ">=3.11"
30
30
  # Make sure to list one dependency per line.
31
31
  dependencies = [
32
32
  "dask>=2022.1.0",
33
- "essreduce>=26.4.0",
34
- "graphviz",
33
+ "graphviz>=0.20",
34
+ "essreduce>=26.6.0",
35
35
  "numpy>=2",
36
- "plopp>=26.2.0",
36
+ "plopp>=26.5.0",
37
37
  "pythreejs>=2.4.1",
38
- "sciline>=25.04.1",
39
- "scipp>=25.11.0",
40
- "scippneutron>=26.3.0",
41
- "scippnexus>=23.12.0",
42
38
  "tof>=25.12.0",
43
39
  "ncrystal[cif]>=4.1.0",
44
- "spglib!=2.7", # https://github.com/mctools/ncrystal/issues/320
40
+ "spglib>=2.0.0,!=2.7", # https://github.com/mctools/ncrystal/issues/320
45
41
  ]
46
42
 
47
43
  dynamic = ["version"]
@@ -54,23 +50,23 @@ test = [
54
50
  "ipywidgets>=8.1.7",
55
51
  ]
56
52
  docs = [
57
- "autodoc-pydantic",
58
- "ipykernel",
59
- "ipympl",
53
+ "autodoc-pydantic>=2.0.0",
54
+ "ipykernel>=6.20.0",
55
+ "ipympl>=0.9.0",
60
56
  # Breaks syntax highlighting in Jupyter code cells.
61
- "ipython!=8.7.0",
62
- "myst-parser",
63
- "nbsphinx",
64
- "pandas",
65
- "pooch",
57
+ "ipython>=8.8.0,!=8.7.0",
58
+ "myst-parser>=2.0.0",
59
+ "nbsphinx>=0.9.3",
60
+ "pandas>=2.1.2",
61
+ "pooch>=1.5",
66
62
  "pydata-sphinx-theme>=0.14",
67
- "sphinx",
68
- "sphinx-autodoc-typehints",
69
- "sphinx-copybutton",
70
- "sphinx-design",
71
- "sphinxcontrib-bibtex",
63
+ "sphinx>=7",
64
+ "sphinx-autodoc-typehints>=1.24.0",
65
+ "sphinx-copybutton>=0.5.2",
66
+ "sphinx-design>=0.5.0",
67
+ "sphinxcontrib-bibtex>=2.5.0",
72
68
  # needed by pandas < 3.0
73
- "pyarrow",
69
+ "pyarrow>=12.0.0",
74
70
  ]
75
71
 
76
72
  [project.urls]
@@ -7,12 +7,17 @@ Components for BEER
7
7
 
8
8
  import importlib.metadata
9
9
 
10
- from .io import load_beer_mcstas
10
+ from .mcstas import load_beer_mcstas
11
11
  from .peakfinding import dhkl_peaks_from_cif
12
12
  from .workflow import (
13
13
  BeerMcStasWorkflowPulseShaping,
14
+ BeerMcStasWorkflowPulseShapingAnalytical,
14
15
  BeerModMcStasWorkflow,
15
16
  BeerModMcStasWorkflowKnownPeaks,
17
+ BeerPowderMcStasWorkflow,
18
+ BeerPowderMcStasWorkflowAnalytical,
19
+ BeerPowderWorkflow,
20
+ BeerPowderWorkflowAnalytical,
16
21
  default_parameters,
17
22
  )
18
23
 
@@ -25,8 +30,13 @@ del importlib
25
30
 
26
31
  __all__ = [
27
32
  'BeerMcStasWorkflowPulseShaping',
33
+ 'BeerMcStasWorkflowPulseShapingAnalytical',
28
34
  'BeerModMcStasWorkflow',
29
35
  'BeerModMcStasWorkflowKnownPeaks',
36
+ 'BeerPowderMcStasWorkflow',
37
+ 'BeerPowderMcStasWorkflowAnalytical',
38
+ 'BeerPowderWorkflow',
39
+ 'BeerPowderWorkflowAnalytical',
30
40
  '__version__',
31
41
  'default_parameters',
32
42
  'dhkl_peaks_from_cif',
@@ -2,7 +2,7 @@ import scipp as sc
2
2
  from ess.powder.types import RunType
3
3
  from scipy.signal import find_peaks, medfilt
4
4
 
5
- from .conversions import tof_from_t0_estimate_graph
5
+ from .conversions import tof_from_nominal_time_at_chopper_graph
6
6
  from .types import (
7
7
  GeometryCoordTransformGraph,
8
8
  RawDetector,
@@ -13,7 +13,7 @@ from .types import (
13
13
  def cluster_events_by_streak(
14
14
  da: RawDetector[RunType], gg: GeometryCoordTransformGraph
15
15
  ) -> StreakClusteredData[RunType]:
16
- graph = tof_from_t0_estimate_graph(da, gg)
16
+ graph = tof_from_nominal_time_at_chopper_graph(da, gg)
17
17
 
18
18
  da = da.transform_coords(['dspacing'], graph=graph)
19
19
  da.bins.coords['coarse_d'] = da.bins.coords.pop('dspacing').to(unit='angstrom')
@@ -19,7 +19,6 @@ def compute_wavelength_in_each_cluster(
19
19
  da: StreakClusteredData[RunType],
20
20
  chopper_delay: WavelengthDefinitionChopperDelay,
21
21
  mod_period: ModulationPeriod,
22
- graph: GeometryCoordTransformGraph,
23
22
  ) -> WavelengthDetector[RunType]:
24
23
  """Fits a line through each cluster, the intercept of the line is t0.
25
24
  The line is fitted using linear regression with an outlier removal procedure.
@@ -38,7 +37,7 @@ def compute_wavelength_in_each_cluster(
38
37
  if isinstance(da, sc.DataGroup):
39
38
  return sc.DataGroup(
40
39
  {
41
- k: compute_wavelength_in_each_cluster(v, mod_period)
40
+ k: compute_wavelength_in_each_cluster(v, chopper_delay, mod_period)
42
41
  for k, v in da.items()
43
42
  }
44
43
  )
@@ -133,7 +132,7 @@ def _compute_d_given_list_of_peaks(
133
132
  / (scipp.constants.h / scipp.constants.m_n)
134
133
  ).to(unit=f'{time_of_arrival.unit}/angstrom')
135
134
  for dhkl in dhkl_list:
136
- dt = sc.abs(t - dhkl * const)
135
+ dt = sc.abs(t - dhkl * const - pulse_length / 2)
137
136
  dt_in_range = dt < pulse_length / 2
138
137
  no_dt_found = sc.isnan(dtfound)
139
138
  dtfound = sc.where(dt_in_range, sc.where(no_dt_found, dt, dtfound), dtfound)
@@ -191,34 +190,16 @@ def _tof_from_dhkl(
191
190
  return out
192
191
 
193
192
 
194
- def t0_estimate(
195
- wavelength_estimate: sc.Variable,
196
- source_to_wavelength_definition_chopper_distance: sc.Variable,
197
- ) -> sc.Variable:
198
- """
199
- Computes the time a neutron reaches a chopper at
200
- ``source_to_wavelength_chopper_distance`` distance from the source
201
- if it has wavelength ``wavelength_estimate``.
202
- """
203
- return (
204
- sc.constants.m_n
205
- / sc.constants.h
206
- * wavelength_estimate
207
- * source_to_wavelength_definition_chopper_distance.to(
208
- unit=wavelength_estimate.unit
209
- )
210
- ).to(unit='s')
211
-
212
-
213
- def tof_from_t0_estimate_graph(
193
+ def tof_from_nominal_time_at_chopper_graph(
214
194
  da: RawDetector[RunType],
215
195
  gg: GeometryCoordTransformGraph,
216
196
  ) -> ElasticCoordTransformGraph[RunType]:
217
197
  """Graph for computing ``wavelength`` in pulse shaping chopper modes."""
218
198
  return {
219
199
  **gg,
220
- 't0': t0_estimate,
221
- 'tof': lambda time_of_arrival, t0: time_of_arrival - t0,
200
+ 'tof': lambda time_of_arrival, nominal_time_at_chopper: (
201
+ time_of_arrival - nominal_time_at_chopper
202
+ ),
222
203
  'time_of_arrival': time_of_arrival,
223
204
  }
224
205
 
@@ -287,7 +268,7 @@ convert_from_known_peaks_providers = (
287
268
  )
288
269
  convert_pulse_shaping = (
289
270
  geometry_graph,
290
- tof_from_t0_estimate_graph,
271
+ tof_from_nominal_time_at_chopper_graph,
291
272
  wavelength_detector,
292
273
  )
293
274
  providers = (compute_wavelength_in_each_cluster, geometry_graph)
@@ -31,7 +31,7 @@ _registry = make_registry(
31
31
  # Simulations from new model with corrected(?) moderator to detector
32
32
  # distance.
33
33
  # For correct reduction you need to use
34
- # beer.io.mcstas_chopper_delay_from_mode_new_simulations
34
+ # beer.mcstas.mcstas_chopper_delay_from_mode_new_simulations
35
35
  # to obtain the correct WavelengthDefinitionChopperDelay for these files.
36
36
  "silicon-mode10-new-model.h5": "md5:98500830f27700fc719634e1acd49944",
37
37
  "silicon-mode16-new-model.h5": "md5:393f9287e7d3f97ceedbe64343918413",
@@ -0,0 +1,21 @@
1
+ # SPDX-License-Identifier: BSD-3-Clause
2
+ # Copyright (c) 2025 Scipp contributors (https://github.com/scipp)
3
+
4
+ """Backward-compatible import location for BEER McStas helpers."""
5
+
6
+ import warnings
7
+
8
+ from . import mcstas as _mcstas
9
+ from .mcstas import * # noqa: F403
10
+ from .mcstas import __all__ # noqa: F401
11
+
12
+ warnings.warn(
13
+ "ess.beer.io is deprecated; use ess.beer.mcstas instead.",
14
+ DeprecationWarning,
15
+ stacklevel=2,
16
+ )
17
+
18
+
19
+ def __getattr__(name: str):
20
+ """Return attributes from the replacement :mod:`ess.beer.mcstas` module."""
21
+ return getattr(_mcstas, name)
@@ -0,0 +1,42 @@
1
+ # SPDX-License-Identifier: BSD-3-Clause
2
+ # Copyright (c) 2026 Scipp contributors (https://github.com/scipp)
3
+
4
+ """BEER McStas simulation helpers."""
5
+
6
+ from .beamline import MCSTAS_T_OFFSET, PulseShapingMode, simulation_choppers
7
+ from .load import (
8
+ MCSTAS_PULSE_SHAPING_MODES,
9
+ load_beer_mcstas,
10
+ load_beer_mcstas_monitor,
11
+ load_beer_mcstas_monitor_provider,
12
+ load_beer_mcstas_provider,
13
+ mcstas_chopper_delay_from_mode,
14
+ mcstas_chopper_delay_from_mode_new_simulations,
15
+ mcstas_detector_ltotal,
16
+ mcstas_modulation_period_from_mode,
17
+ mcstas_providers,
18
+ mcstas_pulse_shaping_choppers,
19
+ mcstas_source_position,
20
+ pulse_shaping_mcstas_providers,
21
+ pulse_shaping_mode_from_mcstas_mode,
22
+ )
23
+
24
+ __all__ = [
25
+ 'MCSTAS_PULSE_SHAPING_MODES',
26
+ 'MCSTAS_T_OFFSET',
27
+ 'PulseShapingMode',
28
+ 'load_beer_mcstas',
29
+ 'load_beer_mcstas_monitor',
30
+ 'load_beer_mcstas_monitor_provider',
31
+ 'load_beer_mcstas_provider',
32
+ 'mcstas_chopper_delay_from_mode',
33
+ 'mcstas_chopper_delay_from_mode_new_simulations',
34
+ 'mcstas_detector_ltotal',
35
+ 'mcstas_modulation_period_from_mode',
36
+ 'mcstas_providers',
37
+ 'mcstas_pulse_shaping_choppers',
38
+ 'mcstas_source_position',
39
+ 'pulse_shaping_mcstas_providers',
40
+ 'pulse_shaping_mode_from_mcstas_mode',
41
+ 'simulation_choppers',
42
+ ]
@@ -0,0 +1,201 @@
1
+ # SPDX-License-Identifier: BSD-3-Clause
2
+ # Copyright (c) 2026 Scipp contributors (https://github.com/scipp)
3
+
4
+ import enum
5
+ from types import MappingProxyType
6
+ from typing import TypedDict
7
+
8
+ import scipp as sc
9
+ from scippneutron.chopper import DiskChopper
10
+
11
+
12
+ class PulseShapingMode(enum.Enum):
13
+ """Pulse-shaping chopper modes for BEER."""
14
+
15
+ ps0 = "PS0"
16
+ ps1 = "PS1"
17
+ ps2 = "PS2"
18
+ ps3 = "PS3"
19
+ ds1 = "DS1"
20
+
21
+
22
+ class _ChopperParameters(TypedDict):
23
+ frequency: float
24
+ phase: float
25
+ distance: float
26
+ open: list[float]
27
+ close: list[float]
28
+
29
+
30
+ Hz = sc.Unit("Hz")
31
+ deg = sc.Unit("deg")
32
+ meter = sc.Unit("m")
33
+
34
+ MCSTAS_T_OFFSET = sc.scalar(1.6, unit="ms")
35
+ """Time offset applied by the BEER McStas simulation source model."""
36
+
37
+ _HIGH_FLUX: dict[str, _ChopperParameters] = {
38
+ "PSC1": {
39
+ "frequency": 168.0,
40
+ "phase": 318.6929881679336,
41
+ "distance": 6.450,
42
+ "open": [0.0],
43
+ "close": [144.0],
44
+ },
45
+ "PSC3": {
46
+ "frequency": -168.0,
47
+ "phase": -318.6929881679336,
48
+ "distance": 7.375,
49
+ "open": [0.0],
50
+ "close": [144.0],
51
+ },
52
+ "FC1A": {
53
+ "frequency": -28.0,
54
+ "phase": -18.44878787209148,
55
+ "distance": 8.283,
56
+ "open": [0.0],
57
+ "close": [72.0],
58
+ },
59
+ "FC2A": {
60
+ "frequency": -14.0,
61
+ "phase": -134.52965314925247,
62
+ "distance": 79.975,
63
+ "open": [0.0],
64
+ "close": [175.0],
65
+ },
66
+ }
67
+
68
+ _parameters: dict[PulseShapingMode, dict[str, _ChopperParameters]] = {
69
+ PulseShapingMode.ps0: _HIGH_FLUX,
70
+ PulseShapingMode.ps1: _HIGH_FLUX,
71
+ PulseShapingMode.ps2: {
72
+ "PSC1": {
73
+ "frequency": 168.0,
74
+ "phase": 310.265456971683,
75
+ "distance": 6.450,
76
+ "open": [0.0],
77
+ "close": [144.0],
78
+ },
79
+ "PSC2": {
80
+ "frequency": -168.0,
81
+ "phase": -310.265456971683,
82
+ "distance": 6.850,
83
+ "open": [0.0],
84
+ "close": [144.0],
85
+ },
86
+ "FC1A": {
87
+ "frequency": -28.0,
88
+ "phase": -18.44878787209148,
89
+ "distance": 8.283,
90
+ "open": [0.0],
91
+ "close": [72.0],
92
+ },
93
+ "FC2A": {
94
+ "frequency": -14.0,
95
+ "phase": -134.52965314925247,
96
+ "distance": 79.975,
97
+ "open": [0.0],
98
+ "close": [175.0],
99
+ },
100
+ },
101
+ PulseShapingMode.ps3: {
102
+ "PSC1": {
103
+ "frequency": 168.0,
104
+ "phase": 307.05496889692084,
105
+ "distance": 6.450,
106
+ "open": [0.0],
107
+ "close": [144.0],
108
+ },
109
+ "PSC2": {
110
+ "frequency": -168.0,
111
+ "phase": -307.05496889692084,
112
+ "distance": 6.650,
113
+ "open": [0.0],
114
+ "close": [144.0],
115
+ },
116
+ "FC1A": {
117
+ "frequency": -28.0,
118
+ "phase": -18.44878787209148,
119
+ "distance": 8.283,
120
+ "open": [0.0],
121
+ "close": [72.0],
122
+ },
123
+ "FC2A": {
124
+ "frequency": -14.0,
125
+ "phase": -134.52965314925247,
126
+ "distance": 79.975,
127
+ "open": [0.0],
128
+ "close": [175.0],
129
+ },
130
+ },
131
+ PulseShapingMode.ds1: {
132
+ "PSC1": {
133
+ "frequency": 168.0,
134
+ "phase": 318.6929881679336,
135
+ "distance": 6.450,
136
+ "open": [0.0],
137
+ "close": [144.0],
138
+ },
139
+ "PSC3": {
140
+ "frequency": -168.0,
141
+ "phase": -318.6929881679336,
142
+ "distance": 7.375,
143
+ "open": [0.0],
144
+ "close": [144.0],
145
+ },
146
+ "FC1A": {
147
+ "frequency": -14.0,
148
+ "phase": -3.22439393604574,
149
+ "distance": 8.283,
150
+ "open": [0.0],
151
+ "close": [72.0],
152
+ },
153
+ "FC1B": {
154
+ "frequency": -63.0,
155
+ "phase": -46.41910994173803,
156
+ "distance": 8.317,
157
+ "open": [0.0],
158
+ "close": [180.0],
159
+ },
160
+ "FC2B": {
161
+ "frequency": -7.0,
162
+ "phase": -68.58171174285046,
163
+ "distance": 80.025,
164
+ "open": [0.0],
165
+ "close": [85.0],
166
+ },
167
+ },
168
+ }
169
+
170
+
171
+ def simulation_choppers(
172
+ mode: PulseShapingMode, source_position: sc.Variable
173
+ ) -> MappingProxyType[str, DiskChopper]:
174
+ """
175
+ Dict of ESS BEER McStas choppers for the selected pulse-shaping mode.
176
+
177
+ We make the chopper information available in this way as loading it directly from
178
+ the NeXus files is currently not available for these simulated BEER data.
179
+
180
+ Parameters
181
+ ----------
182
+ mode:
183
+ BEER pulse-shaping chopper mode.
184
+ source_position:
185
+ Position of the source in the coordinate system of the choppers.
186
+ The raw chopper positions are defined relative to the source position.
187
+ """
188
+ return MappingProxyType(
189
+ {
190
+ key: DiskChopper(
191
+ frequency=ch["frequency"] * Hz,
192
+ beam_position=sc.scalar(0.0, unit="deg"),
193
+ phase=ch["phase"] * deg,
194
+ axle_position=sc.vector(value=[0, 0, ch["distance"]], unit="m")
195
+ + source_position,
196
+ slit_begin=sc.array(dims=["cutout"], values=ch["open"], unit="deg"),
197
+ slit_end=sc.array(dims=["cutout"], values=ch["close"], unit="deg"),
198
+ )
199
+ for key, ch in _parameters[mode].items()
200
+ }
201
+ )