essdiffraction 25.5.2__tar.gz → 25.8.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 (142) hide show
  1. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.copier-answers.ess.yml +1 -1
  2. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.copier-answers.yml +1 -1
  3. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/ISSUE_TEMPLATE/high-level-requirement.yml +8 -0
  4. essdiffraction-25.8.0/.github/workflows/python-version-ci +1 -0
  5. essdiffraction-25.8.0/.python-version +1 -0
  6. {essdiffraction-25.5.2/src/essdiffraction.egg-info → essdiffraction-25.8.0}/PKG-INFO +4 -5
  7. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/api-reference/index.md +42 -1
  8. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/conf.py +10 -1
  9. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/developer/getting-started.md +1 -1
  10. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/common/vanadium_processing.ipynb +35 -44
  11. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/dream/dream-advanced-powder-reduction.ipynb +26 -27
  12. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/dream/dream-instrument-view.ipynb +4 -40
  13. {essdiffraction-25.5.2/tools → essdiffraction-25.8.0/docs/user-guide/dream}/dream-make-tof-lookup-table.ipynb +10 -10
  14. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/dream/index.md +1 -0
  15. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/pyproject.toml +3 -4
  16. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/base.in +2 -2
  17. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/base.txt +29 -29
  18. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/basetest.txt +8 -12
  19. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/ci.txt +8 -14
  20. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/dev.txt +16 -14
  21. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/docs.in +1 -0
  22. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/docs.txt +22 -17
  23. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/mypy.txt +3 -1
  24. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/nightly.txt +30 -34
  25. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/static.txt +2 -2
  26. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/wheels.txt +1 -3
  27. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/__init__.py +14 -4
  28. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/beamline.py +11 -3
  29. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/data.py +52 -36
  30. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/instrument_view.py +1 -1
  31. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/io/__init__.py +1 -2
  32. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/io/geant4.py +13 -23
  33. essdiffraction-25.5.2/src/ess/dream/workflow.py → essdiffraction-25.8.0/src/ess/dream/workflows.py +134 -42
  34. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/__init__.py +1 -0
  35. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/calibration.py +4 -2
  36. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/conversion.py +11 -10
  37. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/correction.py +52 -39
  38. essdiffraction-25.8.0/src/ess/powder/grouping.py +141 -0
  39. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/masking.py +9 -4
  40. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/types.py +21 -12
  41. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/snspowder/powgen/data.py +48 -48
  42. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/snspowder/powgen/workflow.py +13 -2
  43. {essdiffraction-25.5.2 → essdiffraction-25.8.0/src/essdiffraction.egg-info}/PKG-INFO +4 -5
  44. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/essdiffraction.egg-info/SOURCES.txt +3 -4
  45. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/essdiffraction.egg-info/requires.txt +2 -2
  46. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/dream/geant4_reduction_test.py +25 -27
  47. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/dream/io/geant4_test.py +6 -13
  48. essdiffraction-25.5.2/tests/dream/io/nexus_test.py → essdiffraction-25.8.0/tests/dream/workflows/dream_generic_workflow_test.py +12 -12
  49. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/powder/correction_test.py +53 -43
  50. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/snspowder/powgen/powgen_reduction_test.py +11 -4
  51. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tox.ini +1 -1
  52. essdiffraction-25.5.2/.github/workflows/python-version-ci +0 -1
  53. essdiffraction-25.5.2/.python-version +0 -1
  54. essdiffraction-25.5.2/src/ess/dream/io/nexus.py +0 -66
  55. essdiffraction-25.5.2/src/ess/powder/grouping.py +0 -56
  56. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/dependabot.yml +0 -0
  57. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/ci.yml +0 -0
  58. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/docs.yml +0 -0
  59. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/nightly_at_main.yml +0 -0
  60. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/nightly_at_release.yml +0 -0
  61. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/release.yml +0 -0
  62. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/test.yml +0 -0
  63. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/unpinned.yml +0 -0
  64. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.github/workflows/weekly_windows_macos.yml +0 -0
  65. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.gitignore +0 -0
  66. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/.pre-commit-config.yaml +0 -0
  67. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/CODE_OF_CONDUCT.md +0 -0
  68. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/CONTRIBUTING.md +0 -0
  69. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/LICENSE +0 -0
  70. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/MANIFEST.in +0 -0
  71. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/README.md +0 -0
  72. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/conda/meta.yaml +0 -0
  73. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/anaconda-icon.js +0 -0
  74. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/favicon.svg +0 -0
  75. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/logo-dark.svg +0 -0
  76. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/logo.svg +0 -0
  77. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/thumbnails/dream_advanced_powder_reduction_dark.svg +0 -0
  78. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/thumbnails/dream_advanced_powder_reduction_light.svg +0 -0
  79. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/thumbnails/dream_basic_powder_reduction_dark.svg +0 -0
  80. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_static/thumbnails/dream_basic_powder_reduction_light.svg +0 -0
  81. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_templates/class-template.rst +0 -0
  82. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_templates/doc_version.html +0 -0
  83. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/_templates/module-template.rst +0 -0
  84. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/about/bibliography.rst +0 -0
  85. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/about/index.md +0 -0
  86. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/bibliography.bib +0 -0
  87. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/developer/coding-conventions.md +0 -0
  88. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/developer/dependency-management.md +0 -0
  89. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/developer/index.md +0 -0
  90. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/index.md +0 -0
  91. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/common/index.md +0 -0
  92. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/dream/dream-detector-diagnostics.ipynb +0 -0
  93. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/dream/dream-powder-reduction.ipynb +0 -0
  94. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/dream/dream-visualize-absorption.ipynb +0 -0
  95. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/dream/workflow-widget-dream.ipynb +0 -0
  96. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/index.md +0 -0
  97. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/installation.md +0 -0
  98. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/sns-instruments/POWGEN_data_reduction.ipynb +0 -0
  99. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/docs/user-guide/sns-instruments/index.md +0 -0
  100. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/basetest.in +0 -0
  101. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/ci.in +0 -0
  102. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/dev.in +0 -0
  103. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/make_base.py +0 -0
  104. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/mypy.in +0 -0
  105. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/nightly.in +0 -0
  106. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/static.in +0 -0
  107. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/test.in +0 -0
  108. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/test.txt +0 -0
  109. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/requirements/wheels.in +0 -0
  110. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/resources/logo.svg +0 -0
  111. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/setup.cfg +0 -0
  112. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/diffraction/__init__.py +0 -0
  113. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/diffraction/py.typed +0 -0
  114. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/diagnostics.py +0 -0
  115. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/io/cif.py +0 -0
  116. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/parameters.py +0 -0
  117. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/dream/py.typed +0 -0
  118. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/_util.py +0 -0
  119. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/filtering.py +0 -0
  120. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/logging.py +0 -0
  121. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/py.typed +0 -0
  122. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/smoothing.py +0 -0
  123. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/powder/transform.py +0 -0
  124. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/snspowder/powgen/__init__.py +0 -0
  125. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/snspowder/powgen/beamline.py +0 -0
  126. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/snspowder/powgen/calibration.py +0 -0
  127. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/snspowder/powgen/instrument_view.py +0 -0
  128. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/ess/snspowder/powgen/peaks.py +0 -0
  129. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/essdiffraction.egg-info/dependency_links.txt +0 -0
  130. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/src/essdiffraction.egg-info/top_level.txt +0 -0
  131. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/conftest.py +0 -0
  132. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/dream/diagnostics_test.py +0 -0
  133. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/dream/instrument_view_test.py +0 -0
  134. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/dream/io/cif_test.py +0 -0
  135. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/package_test.py +0 -0
  136. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/powder/conversion_test.py +0 -0
  137. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/powder/filtering_test.py +0 -0
  138. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/powder/transform_test.py +0 -0
  139. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tests/snspowder/powgen/load_test.py +0 -0
  140. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tools/docs/dream-thumbnails.ipynb +0 -0
  141. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tools/preprocess_pg3_files.ipynb +0 -0
  142. {essdiffraction-25.5.2 → essdiffraction-25.8.0}/tools/shrink_nexus.py +0 -0
@@ -1,3 +1,3 @@
1
1
  # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
- _commit: d1d5caa
2
+ _commit: 34ca4ba
3
3
  _src_path: https://github.com/scipp/ess_template
@@ -3,7 +3,7 @@ _commit: 3f79959
3
3
  _src_path: gh:scipp/copier_template
4
4
  description: Diffraction data reduction for the European Spallation Source
5
5
  max_python: '3.13'
6
- min_python: '3.10'
6
+ min_python: '3.11'
7
7
  namespace_package: ess
8
8
  nightly_deps: scipp,scippnexus,sciline,plopp,scippneutron,essreduce,tof
9
9
  orgname: scipp
@@ -79,6 +79,14 @@ body:
79
79
  description: How can we test this requirement? Links to tests data and reference data, or other suggestions.
80
80
  validations:
81
81
  required: true
82
+ - type: textarea
83
+ id: existingimplementations
84
+ attributes:
85
+ label: Existing implementations
86
+ description: Are there any existing implementations or proof-of-concept implementations that we can imitate? This field is specifically for linking to source code.
87
+ placeholder: "Example: See this repository ... This script implements the procedure: https://file-storage.server.eu/script.code."
88
+ validations:
89
+ required: false
82
90
  - type: textarea
83
91
  id: comments
84
92
  attributes:
@@ -0,0 +1 @@
1
+ 3.11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: essdiffraction
3
- Version: 25.5.2
3
+ Version: 25.8.0
4
4
  Summary: Diffraction data reduction for the European Spallation Source
5
5
  Author: Scipp contributors
6
6
  License-Expression: BSD-3-Clause
@@ -12,23 +12,22 @@ Classifier: Natural Language :: English
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Classifier: Programming Language :: Python :: 3.13
19
18
  Classifier: Topic :: Scientific/Engineering
20
19
  Classifier: Typing :: Typed
21
- Requires-Python: >=3.10
20
+ Requires-Python: >=3.11
22
21
  Description-Content-Type: text/markdown
23
22
  License-File: LICENSE
24
23
  Requires-Dist: dask
25
- Requires-Dist: essreduce>=25.05.3
24
+ Requires-Dist: essreduce>=25.07.0
26
25
  Requires-Dist: graphviz
27
26
  Requires-Dist: numpy
28
27
  Requires-Dist: plopp>=25.03.0
29
28
  Requires-Dist: pythreejs
30
29
  Requires-Dist: sciline>=25.04.1
31
- Requires-Dist: scipp>=24.09.1
30
+ Requires-Dist: scipp>=25.05.1
32
31
  Requires-Dist: scippneutron>=25.02.0
33
32
  Requires-Dist: scippnexus>=23.12.0
34
33
  Requires-Dist: tof>=25.01.2
@@ -10,6 +10,15 @@
10
10
  :toctree: ../generated/attributes
11
11
 
12
12
  providers
13
+
14
+ .. autosummary::
15
+ :toctree: ../generated/classes
16
+
17
+ RunNormalization
18
+
19
+ .. autosummary::
20
+ :toctree: ../generated/functions
21
+
13
22
  with_pixel_mask_filenames
14
23
  ```
15
24
 
@@ -21,10 +30,13 @@
21
30
  :template: module-template.rst
22
31
  :recursive:
23
32
 
33
+ calibration
24
34
  conversion
25
35
  correction
26
36
  filtering
27
37
  grouping
38
+ logging
39
+ masking
28
40
  smoothing
29
41
  transform
30
42
  types
@@ -32,6 +44,23 @@
32
44
 
33
45
  ## ESSdream
34
46
 
47
+ ### Workflows
48
+
49
+
50
+ ```{eval-rst}
51
+ .. currentmodule:: ess.dream
52
+
53
+ .. autosummary::
54
+ :toctree: ../generated/functions
55
+
56
+ DreamGeant4MonitorHistogramWorkflow
57
+ DreamGeant4MonitorIntegratedWorkflow
58
+ DreamGeant4ProtonChargeWorkflow
59
+ DreamGeant4Workflow
60
+ DreamPowderWorkflow
61
+ DreamWorkflow
62
+ ```
63
+
35
64
  ### Top-level functions
36
65
 
37
66
  ```{eval-rst}
@@ -41,7 +70,18 @@
41
70
  :toctree: ../generated/functions
42
71
 
43
72
  instrument_view
44
- DreamGeant4Workflow
73
+ load_geant4_csv
74
+ ```
75
+
76
+ ### Top-level classes
77
+
78
+ ```{eval-rst}
79
+ .. currentmodule:: ess.dream
80
+
81
+ .. autosummary::
82
+ :toctree: ../generated/classes
83
+
84
+ InstrumentConfiguration
45
85
  ```
46
86
 
47
87
  ### Submodules
@@ -52,6 +92,7 @@
52
92
  :template: module-template.rst
53
93
  :recursive:
54
94
 
95
+ beamline
55
96
  data
56
97
  diagnostics
57
98
  io
@@ -32,6 +32,7 @@ extensions = [
32
32
  "sphinx_autodoc_typehints",
33
33
  "sphinx_copybutton",
34
34
  "sphinx_design",
35
+ "sphinxcontrib.autodoc_pydantic",
35
36
  "sphinxcontrib.bibtex",
36
37
  "nbsphinx",
37
38
  "myst_parser",
@@ -69,9 +70,17 @@ autodoc_type_aliases = {
69
70
  }
70
71
 
71
72
  intersphinx_mapping = {
72
- "python": ("https://docs.python.org/3", None),
73
73
  "numpy": ("https://numpy.org/doc/stable/", None),
74
+ "pydantic": ("https://docs.pydantic.dev/latest", None),
75
+ "python": ("https://docs.python.org/3", None),
76
+ # Scipp:
77
+ "essreduce": ("https://scipp.github.io/essreduce", None),
78
+ "plopp": ("https://scipp.github.io/plopp", None),
79
+ "sciline": ("https://scipp.github.io/sciline", None),
74
80
  "scipp": ("https://scipp.github.io/", None),
81
+ "scippneutron": ("https://scipp.github.io/scippneutron", None),
82
+ "scippnexus": ("https://scipp.github.io/scippnexus", None),
83
+ "tof": ("https://scipp.github.io/tof", None),
75
84
  }
76
85
 
77
86
  # autodocs includes everything, even irrelevant API internals. autosummary
@@ -40,7 +40,7 @@ Alternatively, if you want a different workflow, take a look at ``tox.ini`` or `
40
40
  Run the tests using
41
41
 
42
42
  ```sh
43
- tox -e py310
43
+ tox -e py311
44
44
  ```
45
45
 
46
46
  (or just `tox` if you want to run all environments).
@@ -72,7 +72,9 @@
72
72
  "\n",
73
73
  "workflow[UncertaintyBroadcastMode] = UncertaintyBroadcastMode.drop\n",
74
74
  "\n",
75
- "workflow[TofMask] = lambda x: (x < sc.scalar(0.0, unit=\"us\")) | (x > sc.scalar(16666.67, unit=\"us\"))\n",
75
+ "workflow[TofMask] = lambda x: (x < sc.scalar(0.0, unit=\"us\")) | (\n",
76
+ " x > sc.scalar(16666.67, unit=\"us\")\n",
77
+ ")\n",
76
78
  "workflow[TwoThetaMask] = None\n",
77
79
  "workflow[WavelengthMask] = None\n",
78
80
  "\n",
@@ -114,7 +116,7 @@
114
116
  "metadata": {},
115
117
  "outputs": [],
116
118
  "source": [
117
- "peaked_data.hist().plot()"
119
+ "peaked_data.plot()"
118
120
  ]
119
121
  },
120
122
  {
@@ -150,24 +152,6 @@
150
152
  "cell_type": "markdown",
151
153
  "id": "10",
152
154
  "metadata": {},
153
- "source": [
154
- "We need to histogram the data to perform fits:"
155
- ]
156
- },
157
- {
158
- "cell_type": "code",
159
- "execution_count": null,
160
- "id": "11",
161
- "metadata": {},
162
- "outputs": [],
163
- "source": [
164
- "peak_histogram = peaked_data.hist()"
165
- ]
166
- },
167
- {
168
- "cell_type": "markdown",
169
- "id": "12",
170
- "metadata": {},
171
155
  "source": [
172
156
  "The fits require a bin-center coordinate, so convert from bin-edges:"
173
157
  ]
@@ -175,17 +159,17 @@
175
159
  {
176
160
  "cell_type": "code",
177
161
  "execution_count": null,
178
- "id": "13",
162
+ "id": "11",
179
163
  "metadata": {},
180
164
  "outputs": [],
181
165
  "source": [
182
- "to_fit = peak_histogram.copy(deep=False)\n",
166
+ "to_fit = peaked_data.copy(deep=False)\n",
183
167
  "to_fit.coords['dspacing'] = sc.midpoints(to_fit.coords['dspacing'])"
184
168
  ]
185
169
  },
186
170
  {
187
171
  "cell_type": "markdown",
188
- "id": "14",
172
+ "id": "12",
189
173
  "metadata": {},
190
174
  "source": [
191
175
  "Perform the fits:"
@@ -194,7 +178,7 @@
194
178
  {
195
179
  "cell_type": "code",
196
180
  "execution_count": null,
197
- "id": "15",
181
+ "id": "13",
198
182
  "metadata": {},
199
183
  "outputs": [],
200
184
  "source": [
@@ -203,7 +187,7 @@
203
187
  },
204
188
  {
205
189
  "cell_type": "markdown",
206
- "id": "16",
190
+ "id": "14",
207
191
  "metadata": {},
208
192
  "source": [
209
193
  "Remove the fitted peaks to obtain the incoherent scattering.\n",
@@ -218,18 +202,18 @@
218
202
  {
219
203
  "cell_type": "code",
220
204
  "execution_count": null,
221
- "id": "17",
205
+ "id": "15",
222
206
  "metadata": {},
223
207
  "outputs": [],
224
208
  "source": [
225
209
  "incoherent = scn.peaks.remove_peaks(sc.values(to_fit), fit_results)\n",
226
- "incoherent.coords['dspacing'] = peak_histogram.coords['dspacing']\n",
210
+ "incoherent.coords['dspacing'] = peaked_data.coords['dspacing']\n",
227
211
  "incoherent.plot()"
228
212
  ]
229
213
  },
230
214
  {
231
215
  "cell_type": "markdown",
232
- "id": "18",
216
+ "id": "16",
233
217
  "metadata": {},
234
218
  "source": [
235
219
  "We can further inspect the results.\n",
@@ -262,7 +246,7 @@
262
246
  {
263
247
  "cell_type": "code",
264
248
  "execution_count": null,
265
- "id": "19",
249
+ "id": "17",
266
250
  "metadata": {},
267
251
  "outputs": [],
268
252
  "source": [
@@ -272,29 +256,36 @@
272
256
  " fit_results: list[scn.peaks.FitResult],\n",
273
257
  " peak_estimates: sc.Variable,\n",
274
258
  " *,\n",
275
- " xlim: tuple[sc.Variable, sc.Variable] | None=None,\n",
259
+ " xlim: tuple[sc.Variable, sc.Variable] | None = None,\n",
276
260
  "):\n",
277
261
  " if xlim is not None:\n",
262
+ "\n",
278
263
  " def in_range(x: sc.Variable) -> bool:\n",
279
264
  " return sc.isfinite(x) and (xlim[0] <= x) and (x < xlim[1])\n",
280
- " data = data[data.dim, xlim[0]:xlim[1]]\n",
281
- " removed = removed[removed.dim, xlim[0]:xlim[1]]\n",
282
- " fit_results, peak_estimates = zip(*(\n",
283
- " (r, e)\n",
284
- " for r, e in zip(fit_results, peak_estimates, strict=True)\n",
285
- " if in_range(r.window[0]) and in_range(r.window[1])\n",
286
- " ), strict=True)\n",
265
+ "\n",
266
+ " data = data[data.dim, xlim[0] : xlim[1]]\n",
267
+ " removed = removed[removed.dim, xlim[0] : xlim[1]]\n",
268
+ " fit_results, peak_estimates = zip(\n",
269
+ " *(\n",
270
+ " (r, e)\n",
271
+ " for r, e in zip(fit_results, peak_estimates, strict=True)\n",
272
+ " if in_range(r.window[0]) and in_range(r.window[1])\n",
273
+ " ),\n",
274
+ " strict=True,\n",
275
+ " )\n",
287
276
  "\n",
288
277
  " # The actual data\n",
289
278
  " plot_data = {'data': data, 'removed': removed}\n",
290
279
  " linestyles = {}\n",
291
280
  " markers = {}\n",
292
- " colors = {'data': 'C0','removed': 'C2'}\n",
281
+ " colors = {'data': 'C0', 'removed': 'C2'}\n",
293
282
  "\n",
294
283
  " # Overlay with fit models evaluated at optimized parameters\n",
295
284
  " for i, result in enumerate(fit_results):\n",
296
285
  " if all(not sc.isnan(param).value for param in result.popt.values()):\n",
297
- " best_fit = data[data.dim, result.window[0] : result.window[1]].copy(deep=False)\n",
286
+ " best_fit = data[data.dim, result.window[0] : result.window[1]].copy(\n",
287
+ " deep=False\n",
288
+ " )\n",
298
289
  " best_fit.coords[best_fit.dim] = sc.midpoints(best_fit.coords[best_fit.dim])\n",
299
290
  " best_fit.data = result.eval_model(best_fit.coords[best_fit.dim])\n",
300
291
  "\n",
@@ -340,12 +331,12 @@
340
331
  {
341
332
  "cell_type": "code",
342
333
  "execution_count": null,
343
- "id": "20",
334
+ "id": "18",
344
335
  "metadata": {},
345
336
  "outputs": [],
346
337
  "source": [
347
338
  "peak_removal_diagnostic(\n",
348
- " peak_histogram,\n",
339
+ " peaked_data,\n",
349
340
  " incoherent,\n",
350
341
  " fit_results,\n",
351
342
  " peak_estimates,\n",
@@ -355,12 +346,12 @@
355
346
  {
356
347
  "cell_type": "code",
357
348
  "execution_count": null,
358
- "id": "21",
349
+ "id": "19",
359
350
  "metadata": {},
360
351
  "outputs": [],
361
352
  "source": [
362
353
  "peak_removal_diagnostic(\n",
363
- " peak_histogram,\n",
354
+ " peaked_data,\n",
364
355
  " incoherent,\n",
365
356
  " fit_results,\n",
366
357
  " peak_estimates,\n",
@@ -370,7 +361,7 @@
370
361
  },
371
362
  {
372
363
  "cell_type": "markdown",
373
- "id": "22",
364
+ "id": "20",
374
365
  "metadata": {},
375
366
  "source": [
376
367
  "The resulting data array `incoherent` can be saved and used in the main workflow [POWGEN_data_reduction](../sns-instruments/POWGEN_data_reduction.rst) to replace `FocussedDataDspacing[VanadiumRun]`."
@@ -42,7 +42,7 @@
42
42
  "The basic notebook sums over all detector voxels and produces a 1D curve.\n",
43
43
  "Here, we instead bin by scattering angle $2\\theta$.\n",
44
44
  "\n",
45
- "First, define the same workflow as in the [basic example](./dream-powder-reduction.rst#create_and_configure_the_workfow):"
45
+ "First, define the same workflow as in the [basic example](./dream-powder-reduction.rst):"
46
46
  ]
47
47
  },
48
48
  {
@@ -140,8 +140,9 @@
140
140
  "metadata": {},
141
141
  "outputs": [],
142
142
  "source": [
143
- "grouped_dspacing.hist().plot(title=grouped_dspacing.coords['detector'].value.capitalize(),\n",
144
- " norm=\"log\")"
143
+ "grouped_dspacing.hist().plot(\n",
144
+ " title=grouped_dspacing.coords['detector'].value.capitalize(), norm=\"log\"\n",
145
+ ")"
145
146
  ]
146
147
  },
147
148
  {
@@ -170,7 +171,9 @@
170
171
  "metadata": {},
171
172
  "outputs": [],
172
173
  "source": [
173
- "workflow = dream.DreamGeant4Workflow(run_norm=powder.RunNormalization.monitor_integrated)\n",
174
+ "workflow = dream.DreamGeant4Workflow(\n",
175
+ " run_norm=powder.RunNormalization.monitor_integrated\n",
176
+ ")\n",
174
177
  "\n",
175
178
  "workflow[Filename[SampleRun]] = dream.data.simulated_diamond_sample()\n",
176
179
  "workflow[Filename[VanadiumRun]] = dream.data.simulated_vanadium_sample()\n",
@@ -326,14 +329,8 @@
326
329
  "metadata": {},
327
330
  "outputs": [],
328
331
  "source": [
329
- "intermediates = workflow.compute(\n",
330
- " (\n",
331
- " DataWithScatteringCoordinates[SampleRun],\n",
332
- " MaskedData[SampleRun],\n",
333
- " )\n",
334
- ")\n",
335
- "\n",
336
- "intermediates[DataWithScatteringCoordinates[SampleRun]]"
332
+ "intermediates = workflow.compute((CountsWavelength[SampleRun], MaskedData[SampleRun]))\n",
333
+ "intermediates[CountsWavelength[SampleRun]]"
337
334
  ]
338
335
  },
339
336
  {
@@ -344,9 +341,9 @@
344
341
  "outputs": [],
345
342
  "source": [
346
343
  "two_theta = sc.linspace(\"two_theta\", 0.8, 2.4, 301, unit=\"rad\")\n",
347
- "intermediates[MaskedData[SampleRun]].hist(\n",
348
- " two_theta=two_theta, wavelength=300\n",
349
- ").plot(norm=\"log\")"
344
+ "intermediates[MaskedData[SampleRun]].hist(two_theta=two_theta, wavelength=300).plot(\n",
345
+ " norm=\"log\"\n",
346
+ ")"
350
347
  ]
351
348
  },
352
349
  {
@@ -419,12 +416,13 @@
419
416
  "source": [
420
417
  "detector_names = [\"mantle\", \"endcap_forward\", \"endcap_backward\", \"high_resolution\"]\n",
421
418
  "parameter_table = pd.DataFrame(\n",
422
- " {NeXusDetectorName: detector_names},\n",
423
- " index=detector_names\n",
419
+ " {NeXusDetectorName: detector_names}, index=detector_names\n",
424
420
  ").rename_axis(index='detector')\n",
425
421
  "\n",
426
422
  "all_detector_workflow = workflow.copy()\n",
427
- "mapped = all_detector_workflow[EmptyCanSubtractedIofDspacing[SampleRun]].map(parameter_table)\n",
423
+ "mapped = all_detector_workflow[EmptyCanSubtractedIofDspacing[SampleRun]].map(\n",
424
+ " parameter_table\n",
425
+ ")\n",
428
426
  "all_detector_workflow[EmptyCanSubtractedIofDspacing[SampleRun]] = mapped.reduce(\n",
429
427
  " func=powder.grouping.collect_detectors\n",
430
428
  ")"
@@ -446,9 +444,7 @@
446
444
  "outputs": [],
447
445
  "source": [
448
446
  "all_detector_workflow.visualize(\n",
449
- " EmptyCanSubtractedIofDspacing[SampleRun],\n",
450
- " graph_attr={\"rankdir\": \"LR\"},\n",
451
- " compact=True\n",
447
+ " EmptyCanSubtractedIofDspacing[SampleRun], graph_attr={\"rankdir\": \"LR\"}, compact=True\n",
452
448
  ")"
453
449
  ]
454
450
  },
@@ -533,14 +529,17 @@
533
529
  " sc.linspace(dim=\"two_theta\", unit=\"rad\", start=2.91, stop=3.11, num=51),\n",
534
530
  "]\n",
535
531
  "parameter_table = pd.DataFrame(\n",
536
- " {NeXusDetectorName: detector_names,\n",
537
- " TwoThetaBins: two_theta_bins,\n",
538
- " },\n",
539
- " index=detector_names\n",
532
+ " {\n",
533
+ " NeXusDetectorName: detector_names,\n",
534
+ " TwoThetaBins: two_theta_bins,\n",
535
+ " },\n",
536
+ " index=detector_names,\n",
540
537
  ").rename_axis(index='detector')\n",
541
538
  "\n",
542
539
  "all_detector_workflow = workflow.copy()\n",
543
- "mapped = all_detector_workflow[EmptyCanSubtractedIofDspacingTwoTheta[SampleRun]].map(parameter_table)\n",
540
+ "mapped = all_detector_workflow[EmptyCanSubtractedIofDspacingTwoTheta[SampleRun]].map(\n",
541
+ " parameter_table\n",
542
+ ")\n",
544
543
  "all_detector_workflow[EmptyCanSubtractedIofDspacingTwoTheta[SampleRun]] = mapped.reduce(\n",
545
544
  " func=powder.grouping.collect_detectors\n",
546
545
  ")"
@@ -556,7 +555,7 @@
556
555
  "all_detector_workflow.visualize(\n",
557
556
  " EmptyCanSubtractedIofDspacingTwoTheta[SampleRun],\n",
558
557
  " graph_attr={\"rankdir\": \"LR\"},\n",
559
- " compact=True\n",
558
+ " compact=True,\n",
560
559
  ")"
561
560
  ]
562
561
  },
@@ -140,27 +140,9 @@
140
140
  "full_view"
141
141
  ]
142
142
  },
143
- {
144
- "cell_type": "code",
145
- "execution_count": null,
146
- "id": "9",
147
- "metadata": {
148
- "editable": true,
149
- "nbsphinx": "hidden",
150
- "slideshow": {
151
- "slide_type": ""
152
- },
153
- "tags": []
154
- },
155
- "outputs": [],
156
- "source": [
157
- "full_view[2].controls[\"tof\"][\"slider\"].value = 35\n",
158
- "full_view[1].toolbar.tools[\"autoscale\"].click()"
159
- ]
160
- },
161
143
  {
162
144
  "cell_type": "markdown",
163
- "id": "10",
145
+ "id": "9",
164
146
  "metadata": {
165
147
  "editable": true,
166
148
  "slideshow": {
@@ -179,7 +161,7 @@
179
161
  {
180
162
  "cell_type": "code",
181
163
  "execution_count": null,
182
- "id": "11",
164
+ "id": "10",
183
165
  "metadata": {
184
166
  "editable": true,
185
167
  "slideshow": {
@@ -193,27 +175,9 @@
193
175
  "mantle_view"
194
176
  ]
195
177
  },
196
- {
197
- "cell_type": "code",
198
- "execution_count": null,
199
- "id": "12",
200
- "metadata": {
201
- "editable": true,
202
- "nbsphinx": "hidden",
203
- "slideshow": {
204
- "slide_type": ""
205
- },
206
- "tags": []
207
- },
208
- "outputs": [],
209
- "source": [
210
- "mantle_view[1].controls[\"tof\"][\"slider\"].value = 43\n",
211
- "mantle_view[0].toolbar.tools[\"autoscale\"].click()"
212
- ]
213
- },
214
178
  {
215
179
  "cell_type": "markdown",
216
- "id": "13",
180
+ "id": "11",
217
181
  "metadata": {},
218
182
  "source": [
219
183
  "The instrument view is designed to be flexible in terms of what it accepts as input.\n",
@@ -225,7 +189,7 @@
225
189
  {
226
190
  "cell_type": "code",
227
191
  "execution_count": null,
228
- "id": "14",
192
+ "id": "12",
229
193
  "metadata": {},
230
194
  "outputs": [],
231
195
  "source": [
@@ -5,7 +5,9 @@
5
5
  "id": "0",
6
6
  "metadata": {},
7
7
  "source": [
8
- "# Create a time-of-flight lookup table for DREAM"
8
+ "# Create a time-of-flight lookup table for DREAM\n",
9
+ "\n",
10
+ "This notebook shows how to create a time-of-flight lookup table for the DREAM instrument."
9
11
  ]
10
12
  },
11
13
  {
@@ -16,7 +18,6 @@
16
18
  "outputs": [],
17
19
  "source": [
18
20
  "import scipp as sc\n",
19
- "import sciline as sl\n",
20
21
  "from ess.reduce import time_of_flight\n",
21
22
  "from ess.dream.beamline import InstrumentConfiguration, choppers"
22
23
  ]
@@ -26,7 +27,9 @@
26
27
  "id": "2",
27
28
  "metadata": {},
28
29
  "source": [
29
- "## Select the choppers"
30
+ "## Select the choppers\n",
31
+ "\n",
32
+ "We select the choppers for the 'high-flux' configuration."
30
33
  ]
31
34
  },
32
35
  {
@@ -54,15 +57,12 @@
54
57
  "metadata": {},
55
58
  "outputs": [],
56
59
  "source": [
57
- "wf = sl.Pipeline(\n",
58
- " time_of_flight.providers(), params=time_of_flight.default_parameters()\n",
59
- ")\n",
60
+ "wf = time_of_flight.TofLookupTableWorkflow()\n",
60
61
  "\n",
61
62
  "wf[time_of_flight.LtotalRange] = sc.scalar(60.0, unit=\"m\"), sc.scalar(80.0, unit=\"m\")\n",
62
- "wf[time_of_flight.SimulationResults] = time_of_flight.simulate_beamline(\n",
63
- " choppers=disk_choppers, neutrons=5_000_000, source_position=sc.vector([0, 0, 0], unit='m'),\n",
64
- ")\n",
65
- "\n",
63
+ "wf[time_of_flight.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
64
+ "wf[time_of_flight.SourcePosition] = sc.vector([0, 0, 0], unit='m')\n",
65
+ "wf[time_of_flight.DiskChoppers] = disk_choppers\n",
66
66
  "wf[time_of_flight.DistanceResolution] = sc.scalar(0.1, unit=\"m\")\n",
67
67
  "wf[time_of_flight.TimeResolution] = sc.scalar(250.0, unit='us')\n",
68
68
  "wf[time_of_flight.LookupTableRelativeErrorThreshold] = 0.02\n",
@@ -54,4 +54,5 @@ dream-instrument-view
54
54
  workflow-widget-dream
55
55
  dream-detector-diagnostics
56
56
  dream-visualize-absorption
57
+ dream-make-tof-lookup-table
57
58
  ```
@@ -18,27 +18,26 @@ classifiers = [
18
18
  "Operating System :: OS Independent",
19
19
  "Programming Language :: Python :: 3",
20
20
  "Programming Language :: Python :: 3 :: Only",
21
- "Programming Language :: Python :: 3.10",
22
21
  "Programming Language :: Python :: 3.11",
23
22
  "Programming Language :: Python :: 3.12",
24
23
  "Programming Language :: Python :: 3.13",
25
24
  "Topic :: Scientific/Engineering",
26
25
  "Typing :: Typed",
27
26
  ]
28
- requires-python = ">=3.10"
27
+ requires-python = ">=3.11"
29
28
 
30
29
  # IMPORTANT:
31
30
  # Run 'tox -e deps' after making changes here. This will update requirement files.
32
31
  # Make sure to list one dependency per line.
33
32
  dependencies = [
34
33
  "dask",
35
- "essreduce>=25.05.3",
34
+ "essreduce>=25.07.0",
36
35
  "graphviz",
37
36
  "numpy",
38
37
  "plopp>=25.03.0",
39
38
  "pythreejs",
40
39
  "sciline>=25.04.1",
41
- "scipp>=24.09.1",
40
+ "scipp>=25.05.1",
42
41
  "scippneutron>=25.02.0",
43
42
  "scippnexus>=23.12.0",
44
43
  "tof>=25.01.2",