easydiffraction 0.5.5__tar.gz → 0.5.7__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 (227) hide show
  1. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/release-drafter.yml +11 -5
  2. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/build-docs.yml +31 -24
  3. easydiffraction-0.5.7/.github/workflows/draft-release-notes.yml +54 -0
  4. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/test-tutorials.yaml +2 -1
  5. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/DEVELOPMENT.md +18 -9
  6. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/PKG-INFO +1 -1
  7. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/introduction/index.md +1 -1
  8. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/plotting/plotters/plotter_plotly.py +8 -9
  9. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/utils/utils.py +11 -0
  10. easydiffraction-0.5.7/tools/prepare_notebooks.py +118 -0
  11. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/advanced_joint-fit_pd-neut-xray-cwl_PbSO4.py +0 -12
  12. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/basic_single-fit_pd-neut-cwl_LBCO-HRPT.py +0 -12
  13. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/cryst-struct_pd-neut-cwl_CoSiO4-D20.py +0 -12
  14. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/cryst-struct_pd-neut-cwl_HS-HRPT.py +0 -12
  15. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/cryst-struct_pd-neut-tof_Si-SEPD.py +0 -12
  16. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/cryst-struct_pd-neut-tof_multidata_NCAF-WISH.py +0 -12
  17. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/cryst-struct_pd-neut-tof_multiphase-LBCO-Si_McStas.py +0 -12
  18. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/dmsc-summer-school-2025_analysis-powder-diffraction.py +254 -184
  19. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/pdf_pd-neut-cwl_Ni.py +1 -13
  20. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/pdf_pd-neut-tof_Si-NOMAD.py +0 -12
  21. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/pdf_pd-xray_NaCl.py +0 -12
  22. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/quick_single-fit_pd-neut-cwl_LBCO-HRPT.py +0 -12
  23. easydiffraction-0.5.5/.github/workflows/update-release-draft.yml +0 -22
  24. easydiffraction-0.5.5/tools/nb_uncomment_pip.py +0 -108
  25. easydiffraction-0.5.5/tutorials/advanced_joint-fit_pd-neut-xray-cwl_PbSO4.ipynb +0 -693
  26. easydiffraction-0.5.5/tutorials/basic_single-fit_pd-neut-cwl_LBCO-HRPT.ipynb +0 -1821
  27. easydiffraction-0.5.5/tutorials/cryst-struct_pd-neut-cwl_CoSiO4-D20.ipynb +0 -682
  28. easydiffraction-0.5.5/tutorials/cryst-struct_pd-neut-cwl_HS-HRPT.ipynb +0 -860
  29. easydiffraction-0.5.5/tutorials/cryst-struct_pd-neut-tof_Si-SEPD.ipynb +0 -785
  30. easydiffraction-0.5.5/tutorials/cryst-struct_pd-neut-tof_multidata_NCAF-WISH.ipynb +0 -735
  31. easydiffraction-0.5.5/tutorials/cryst-struct_pd-neut-tof_multiphase-LBCO-Si_McStas.ipynb +0 -752
  32. easydiffraction-0.5.5/tutorials/dmsc-summer-school-2025_analysis-powder-diffraction.ipynb +0 -1945
  33. easydiffraction-0.5.5/tutorials/pdf_pd-neut-cwl_Ni.ipynb +0 -257
  34. easydiffraction-0.5.5/tutorials/pdf_pd-neut-tof_Si-NOMAD.ipynb +0 -257
  35. easydiffraction-0.5.5/tutorials/pdf_pd-xray_NaCl.ipynb +0 -301
  36. easydiffraction-0.5.5/tutorials/quick_single-fit_pd-neut-cwl_LBCO-HRPT.ipynb +0 -326
  37. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/delete-old-runs.yml +0 -0
  38. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/publish-pypi.yml +0 -0
  39. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/scan-security.yml +0 -0
  40. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/test-code.yaml +0 -0
  41. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/test-tutorials-colab.yaml +0 -0
  42. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.github/workflows/verify-pr-labels.yml +0 -0
  43. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.gitignore +0 -0
  44. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/.prettierignore +0 -0
  45. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/CONTRIBUTING.md +0 -0
  46. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/LICENSE +0 -0
  47. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/README.md +0 -0
  48. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/deps/pycrysfml-0.1.6-py312-none-macosx_14_0_arm64.whl +0 -0
  49. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/deps/pycrysfml-0.1.6-py312-none-win_amd64.whl +0 -0
  50. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/analysis.md +0 -0
  51. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/core.md +0 -0
  52. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/crystallography.md +0 -0
  53. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/experiments.md +0 -0
  54. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/index.md +0 -0
  55. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/plotting.md +0 -0
  56. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/project.md +0 -0
  57. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/sample_models.md +0 -0
  58. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/summary.md +0 -0
  59. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/api-reference/utils.md +0 -0
  60. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/assets/images/user-guide/data-acquisition_2d-raw-data.jpg +0 -0
  61. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/assets/images/user-guide/data-acquisition_instrument.png +0 -0
  62. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/assets/images/user-guide/data-analysis_model.png +0 -0
  63. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/assets/images/user-guide/data-analysis_refinement.png +0 -0
  64. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/assets/images/user-guide/data-reduction_1d-pattern.png +0 -0
  65. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/index.md +0 -0
  66. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/installation-and-setup/index.md +0 -0
  67. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/mkdocs.yml +0 -0
  68. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/tutorials/index.md +0 -0
  69. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/analysis-workflow/analysis.md +0 -0
  70. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/analysis-workflow/experiment.md +0 -0
  71. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/analysis-workflow/index.md +0 -0
  72. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/analysis-workflow/model.md +0 -0
  73. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/analysis-workflow/project.md +0 -0
  74. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/analysis-workflow/summary.md +0 -0
  75. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/concept.md +0 -0
  76. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/data-format.md +0 -0
  77. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/first-steps.md +0 -0
  78. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/glossary.md +0 -0
  79. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/index.md +0 -0
  80. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/_diffrn_radiation.md +0 -0
  81. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/_diffrn_radiation_wavelength.md +0 -0
  82. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/_exptl_crystal.md +0 -0
  83. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/_extinction.md +0 -0
  84. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/_pd_calib.md +0 -0
  85. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/atom_site.md +0 -0
  86. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/background.md +0 -0
  87. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/cell.md +0 -0
  88. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/expt_type.md +0 -0
  89. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/instrument.md +0 -0
  90. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/linked_phases.md +0 -0
  91. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/pd_meas.md +0 -0
  92. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/peak.md +0 -0
  93. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters/space_group.md +0 -0
  94. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/docs/user-guide/parameters.md +0 -0
  95. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/prettierrc.toml +0 -0
  96. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/pyproject.toml +0 -0
  97. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/__init__.py +0 -0
  98. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/__init__.py +0 -0
  99. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/analysis.py +0 -0
  100. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/calculation.py +0 -0
  101. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/calculators/__init__.py +0 -0
  102. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/calculators/calculator_base.py +0 -0
  103. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/calculators/calculator_crysfml.py +0 -0
  104. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/calculators/calculator_cryspy.py +0 -0
  105. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/calculators/calculator_factory.py +0 -0
  106. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/calculators/calculator_pdffit.py +0 -0
  107. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/collections/__init__.py +0 -0
  108. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/collections/aliases.py +0 -0
  109. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/collections/constraints.py +0 -0
  110. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/collections/joint_fit_experiments.py +0 -0
  111. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/minimization.py +0 -0
  112. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/minimizers/__init__.py +0 -0
  113. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/minimizers/fitting_progress_tracker.py +0 -0
  114. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/minimizers/minimizer_base.py +0 -0
  115. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/minimizers/minimizer_dfols.py +0 -0
  116. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/minimizers/minimizer_factory.py +0 -0
  117. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/minimizers/minimizer_lmfit.py +0 -0
  118. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/analysis/reliability_factors.py +0 -0
  119. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/core/__init__.py +0 -0
  120. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/core/constants.py +0 -0
  121. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/core/objects.py +0 -0
  122. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/core/singletons.py +0 -0
  123. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/crystallography/__init__.py +0 -0
  124. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/crystallography/crystallography.py +0 -0
  125. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/crystallography/space_group_lookup_table.py +0 -0
  126. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/__init__.py +0 -0
  127. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/collections/__init__.py +0 -0
  128. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/collections/background.py +0 -0
  129. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/collections/datastore.py +0 -0
  130. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/collections/excluded_regions.py +0 -0
  131. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/collections/linked_phases.py +0 -0
  132. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/components/__init__.py +0 -0
  133. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/components/experiment_type.py +0 -0
  134. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/components/instrument.py +0 -0
  135. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/components/peak.py +0 -0
  136. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/experiment.py +0 -0
  137. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/experiments/experiments.py +0 -0
  138. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/plotting/__init__.py +0 -0
  139. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/plotting/plotters/__init__.py +0 -0
  140. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/plotting/plotters/plotter_ascii.py +0 -0
  141. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/plotting/plotters/plotter_base.py +0 -0
  142. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/plotting/plotting.py +0 -0
  143. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/project.py +0 -0
  144. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/__init__.py +0 -0
  145. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/collections/__init__.py +0 -0
  146. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/collections/atom_sites.py +0 -0
  147. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/components/__init__.py +0 -0
  148. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/components/cell.py +0 -0
  149. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/components/space_group.py +0 -0
  150. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/sample_model.py +0 -0
  151. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/sample_models/sample_models.py +0 -0
  152. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/summary.py +0 -0
  153. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/utils/__init__.py +0 -0
  154. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/utils/decorators.py +0 -0
  155. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/src/easydiffraction/utils/formatting.py +0 -0
  156. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/functional_tests/fitting/test_pair-distribution-function.py +0 -0
  157. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/functional_tests/fitting/test_powder-diffraction_constant-wavelength.py +0 -0
  158. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/functional_tests/fitting/test_powder-diffraction_joint-fit.py +0 -0
  159. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/functional_tests/fitting/test_powder-diffraction_multiphase.py +0 -0
  160. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/functional_tests/fitting/test_powder-diffraction_time-of-flight.py +0 -0
  161. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/calculators/test_calculator_base.py +0 -0
  162. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/calculators/test_calculator_cryspy.py +0 -0
  163. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/calculators/test_calculator_factory.py +0 -0
  164. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/collections/test_joint_fit_experiment.py +0 -0
  165. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/minimizers/test_fitting_progress_tracker.py +0 -0
  166. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/minimizers/test_minimizer_base.py +0 -0
  167. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/minimizers/test_minimizer_dfols.py +0 -0
  168. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/minimizers/test_minimizer_factory.py +0 -0
  169. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/minimizers/test_minimizer_lmfit.py +0 -0
  170. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/test_analysis.py +0 -0
  171. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/test_minimization.py +0 -0
  172. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/analysis/test_reliability_factors.py +0 -0
  173. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/core/test_objects.py +0 -0
  174. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/core/test_singletons.py +0 -0
  175. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/collections/test_background.py +0 -0
  176. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/collections/test_datastore.py +0 -0
  177. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/collections/test_linked_phases.py +0 -0
  178. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/components/test_experiment_type.py +0 -0
  179. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/components/test_instrument.py +0 -0
  180. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/components/test_peak.py +0 -0
  181. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/test_experiment.py +0 -0
  182. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/experiments/test_experiments.py +0 -0
  183. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/sample_models/collections/test_atom_sites.py +0 -0
  184. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/sample_models/components/test_cell.py +0 -0
  185. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/sample_models/components/test_space_group.py +0 -0
  186. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/sample_models/test_sample_models.py +0 -0
  187. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/test_project.py +0 -0
  188. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tests/unit_tests/test_symmetry_lookup_table.py +0 -0
  189. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tools/build_docs.sh +0 -0
  190. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tools/cleanup_docs.sh +0 -0
  191. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tools/create_mkdocs-yml.py +0 -0
  192. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tools/install_deps.sh +0 -0
  193. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tools/prepare_docs.sh +0 -0
  194. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tools/run_notebooks.sh +0 -0
  195. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tools/update_spdx-headers.py +0 -0
  196. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/NOM_9999_Si_640g_PAC_50_ff_ftfrgr_up-to-50.gr +0 -0
  197. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/NaCl.gr +0 -0
  198. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/co2sio4_d20.xye +0 -0
  199. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/d1a_pbso4.dat +0 -0
  200. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/d1a_pbso4_first-half.dat +0 -0
  201. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/d1a_pbso4_second-half.dat +0 -0
  202. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/hrpt_hs.xye +0 -0
  203. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/hrpt_lbco.xye +0 -0
  204. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/lab_pbso4.dat +0 -0
  205. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/mcstas_lbco-si.xye +0 -0
  206. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/mcstas_lbco-si.xys +0 -0
  207. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/mcstas_lbco-si_up-to-108k.xys +0 -0
  208. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/ni-q27r100-neutron_from-2.gr +0 -0
  209. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/powder_reduced_Si_2large_bank.xye +0 -0
  210. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/reduced_LBCO.xye +0 -0
  211. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/reduced_Si.xye +0 -0
  212. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/sepd_si.xye +0 -0
  213. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/wish_ncaf.xye +0 -0
  214. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/wish_ncaf_2_9.xye +0 -0
  215. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/wish_ncaf_4_7.xye +0 -0
  216. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/wish_ncaf_4_7.xys +0 -0
  217. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/wish_ncaf_5_6.xye +0 -0
  218. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/wish_ncaf_5_6.xys +0 -0
  219. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials/data/wish_ybcfo_5_6.xye +0 -0
  220. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/cryst-struct_pd-neut-tof_multiphase-BSFTO-HRPT.py +0 -0
  221. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/data/DREAM_mantle_bc240_nist_cif.xye +0 -0
  222. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/data/DREAM_mantle_bc240_nist_cif_2.xye +0 -0
  223. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/data/DREAM_mantle_bc240_nist_nc.xye +0 -0
  224. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/data/DREAM_mantle_bc240_nist_nc_2.xye +0 -0
  225. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/data/Si_mp-149_symmetrized_mcstas.cif +0 -0
  226. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/hrpt_n_Bi0p88Sm0p12Fe0p94Ti0p06O3_DW_V_9x8x52_1p49_HI.xye +0 -0
  227. {easydiffraction-0.5.5 → easydiffraction-0.5.7}/tutorials-drafts/test_single-fit_pd-neut-tof_Si-DREAM_nc.py +0 -0
@@ -3,20 +3,25 @@
3
3
 
4
4
  name-template: 'easydiffraction $RESOLVED_VERSION'
5
5
  tag-template: 'v$RESOLVED_VERSION'
6
+
6
7
  categories:
7
8
  - title: 'Added'
8
- labels: # Labels to use to categorize a pull request as a feature
9
+ labels:
9
10
  - '[scope] significant'
10
11
  - '[scope] enhancement'
11
- - '[scope] documentation'
12
12
  - title: 'Fixed'
13
- labels: # Labels to use to categorize a pull request as a bug fix
13
+ labels:
14
14
  - '[scope] bug'
15
15
  - title: 'Changed'
16
- labels: # Labels to use to categorize a pull request as a maintenance task
16
+ labels:
17
17
  - '[scope] maintenance'
18
+ - title: 'Documentation'
19
+ labels:
20
+ - '[scope] documentation'
21
+
18
22
  change-template: '- $TITLE (#$NUMBER)'
19
- change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
23
+ change-title-escapes: '\<*_&'
24
+
20
25
  version-resolver:
21
26
  major:
22
27
  labels:
@@ -30,5 +35,6 @@ version-resolver:
30
35
  - '[scope] maintenance'
31
36
  - '[scope] documentation'
32
37
  default: patch
38
+
33
39
  template: |
34
40
  $CHANGES
@@ -5,6 +5,9 @@ on:
5
5
  push:
6
6
  # Selected branches
7
7
  branches: [develop, master, docs, patch]
8
+ # Runs on creating a new tag starting with 'v', e.g. 'v1.0.3'
9
+ tags:
10
+ - 'v*'
8
11
  # Allows you to run this workflow manually from the Actions tab
9
12
  workflow_dispatch:
10
13
 
@@ -33,18 +36,22 @@ jobs:
33
36
  runs-on: ${{ matrix.os }}
34
37
 
35
38
  steps:
36
- # Without this step, GITHUB_REPOSITORY is not accessible from mkdocs.yml
37
- - name: Get GitHub repository
38
- run: echo "GITHUB_REPOSITORY=$GITHUB_REPOSITORY" >> $GITHUB_ENV
39
+ - name: Check-out repository
40
+ uses: actions/checkout@v4
41
+ with:
42
+ fetch-depth: 0 # full history + tags. needed to get the latest release version
39
43
 
40
44
  # Save the latest release version of easyscience/diffraction-lib to RELEASE_VERSION
41
45
  # RELEASE_VERSION is used in the mkdocs.yml file to set release_version.
42
46
  # The release_version is then needed to display the latest release version in the index.md file
43
- - name: Get the latest release version of easydiffraction library
47
+ - name: Set RELEASE_VERSION env variable (latest easydiffraction release)
44
48
  run: |
45
- git clone --depth 1 https://github.com/easyscience/${{ github.event.repository.name }} .
46
- git fetch --tags
47
- echo "RELEASE_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
49
+ git fetch --tags --force
50
+ echo "RELEASE_VERSION=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
51
+
52
+ # Without this step, GITHUB_REPOSITORY is not accessible from mkdocs.yml
53
+ - name: Set GITHUB_REPOSITORY env variable
54
+ run: echo "GITHUB_REPOSITORY=$GITHUB_REPOSITORY" >> "$GITHUB_ENV"
48
55
 
49
56
  # Activate dark mode to create documentation with Plotly charts in dark mode
50
57
  # Need a better solution to automatically switch the chart colour theme based on the mkdocs material switcher
@@ -57,9 +64,6 @@ jobs:
57
64
  # dark-mode on
58
65
  # dark-mode status
59
66
 
60
- - name: Check-out repository
61
- uses: actions/checkout@v4
62
-
63
67
  - name: Set up Python ${{ matrix.python-version }}
64
68
  uses: actions/setup-python@v5
65
69
  with:
@@ -113,7 +117,7 @@ jobs:
113
117
  cp -R ${{ env.NOTEBOOKS_DIR }}/data docs/${{ env.NOTEBOOKS_DIR }}/
114
118
  jupytext ${{ env.NOTEBOOKS_DIR }}/*.py --from py:percent --to ipynb
115
119
  nbstripout ${{ env.NOTEBOOKS_DIR }}/*.ipynb
116
- python tools/nb_uncomment_pip.py ${{ env.NOTEBOOKS_DIR }}/
120
+ python tools/prepare_notebooks.py ${{ env.NOTEBOOKS_DIR }}/
117
121
  mv ${{ env.NOTEBOOKS_DIR }}/*.ipynb docs/${{ env.NOTEBOOKS_DIR }}/
118
122
 
119
123
  # The following step is needed to avoid the following message during the build:
@@ -159,10 +163,10 @@ jobs:
159
163
  path: site/
160
164
 
161
165
  # Upload the static files from the site/ directory to be used in the next job
162
- # This extra step is needed to allow the download of the artifact in the next job
163
- # for pushing its content to the branch named 'gh_pages'
164
- - name: Upload built site as artifact for gh_pages (master branch)
165
- if: ${{ env.CI_BRANCH == 'master' }}
166
+ # This artifact is only uploaded on tagged releases (tags starting with 'v', e.g., v1.0.3)
167
+ # and is used to push content to gh_pages for custom domain deployment.
168
+ - name: Upload built site as artifact for gh_pages (tagged release)
169
+ if: startsWith(github.ref, 'refs/tags/v')
166
170
  uses: actions/upload-artifact@v4
167
171
  with:
168
172
  name: artifact # name of the artifact (without the extension zip)
@@ -198,33 +202,36 @@ jobs:
198
202
  # To allow the deployment of the static files to GitHub Pages, no
199
203
  # restrictions on the branch name need to be set for desired branches on
200
204
  # https://github.com/easyscience/diffraction-lib/settings/environments
201
- # Currently, only develop and master branches are allowed to deploy to GitHub Pages
202
205
  # Deployed pages are available at https://easyscience.github.io/diffraction-lib
203
206
  - name:
204
207
  Deploy to easyscience.github.io/${{ github.event.repository.name }}
205
208
  (all branches)
206
209
  uses: actions/deploy-pages@v4
207
210
 
208
- # Download built site as artifact from a previous job for gh_pages (master branch)
209
- - name: Download built site from previous job (master branch)
210
- if: ${{ env.CI_BRANCH == 'master' }}
211
+ # Download built site as artifact from a previous job for gh_pages (tagged release)
212
+ # This artifact is only downloaded on tagged releases (tags starting with 'v', e.g., v1.0.3)
213
+ # and is used to push content to gh_pages for custom domain deployment.
214
+ - name: Download built site from previous job (tagged release)
215
+ if: startsWith(github.ref, 'refs/tags/v')
211
216
  uses: actions/download-artifact@v4
212
217
  with: # name or path are taken from the upload step of the previous job
213
218
  name: artifact
214
219
  path: site/ # directory to extract downloaded zipped artifacts
215
220
 
216
221
  # Push the site files created in the previous job to the gh_pages branch
222
+ # This push happens only for tagged releases (tags starting with 'v'),
223
+ # which triggers deployment to the custom domain via webhook.
224
+ #
217
225
  # To be able to push to the gh_pages branch, the personal GitHub API access
218
226
  # token GH_API_PERSONAL_ACCSESS_TOKEN must be set for this repository via
219
227
  # https://github.com/easyscience/diffraction-lib/settings/secrets/actions
220
- # This branch is used to deploy the site to the custom domain.
221
- # Deploying is done with a webhook:
228
+ # Then the gh_pages branch is used to deploy the site to the custom domain.
229
+ # Deploying is done with a webhook added via:
222
230
  # https://github.com/easyscience/diffraction-lib/settings/hooks
223
- # This is done for the gh_pages branch when the site is tested with a step above
224
231
  - name:
225
232
  Deploy to gh_pages branch to trigger deployment to custom domain
226
- (master branch)
227
- if: ${{ env.CI_BRANCH == 'master' }}
233
+ (tagged release)
234
+ if: startsWith(github.ref, 'refs/tags/v')
228
235
  uses: s0/git-publish-subdir-action@develop
229
236
  env:
230
237
  GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACCSESS_TOKEN }}
@@ -0,0 +1,54 @@
1
+ # Drafts your next Release notes as pull requests are merged into
2
+ # default branch
3
+
4
+ name: Update release draft
5
+
6
+ on:
7
+ # Runs on pushes targeting the default branch (updates the real draft release)
8
+ push:
9
+ branches:
10
+ - main
11
+ - master
12
+
13
+ # Runs on PRs targeting the default branch (dry-run testing; does NOT update the real draft)
14
+ pull_request:
15
+ branches:
16
+ - main
17
+ - master
18
+
19
+ jobs:
20
+ draft-release-notes:
21
+ if: ${{ github.event_name == 'push' }}
22
+
23
+ permissions:
24
+ # write permission is required to create a github release
25
+ contents: write
26
+
27
+ runs-on: ubuntu-latest
28
+
29
+ steps:
30
+ - name: Drafts the next Release notes
31
+ uses: release-drafter/release-drafter@v6
32
+ with:
33
+ disable-autolabeler: true
34
+ env:
35
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36
+
37
+ # Test the Release Drafter config on PRs without modifying the real draft release
38
+ draft-release-notes-dry-run:
39
+ if: ${{ github.event_name == 'pull_request' }}
40
+
41
+ permissions:
42
+ contents: read
43
+ pull-requests: read
44
+
45
+ runs-on: ubuntu-latest
46
+
47
+ steps:
48
+ - name: Drafts the next Release notes (dry-run)
49
+ uses: release-drafter/release-drafter@v6
50
+ with:
51
+ disable-autolabeler: true
52
+ disable-releaser: true # prevents creating/updating the draft
53
+ env:
54
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -69,6 +69,7 @@ jobs:
69
69
  run: |
70
70
  jupytext ${{ env.NOTEBOOKS_DIR }}/*.py --from py:percent --to ipynb
71
71
  nbstripout ${{ env.NOTEBOOKS_DIR }}/*.ipynb
72
+ python tools/prepare_notebooks.py ${{ env.NOTEBOOKS_DIR }}/
72
73
 
73
74
  - name: Check Jupyter notebooks formatting
74
75
  id: check_notebooks
@@ -151,7 +152,7 @@ jobs:
151
152
  run: |
152
153
  jupytext ${{ env.NOTEBOOKS_DIR }}/*.py --from py:percent --to ipynb
153
154
  nbstripout ${{ env.NOTEBOOKS_DIR }}/*.ipynb
154
- python tools/nb_uncomment_pip.py ${{ env.NOTEBOOKS_DIR }}/
155
+ python tools/prepare_notebooks.py ${{ env.NOTEBOOKS_DIR }}/
155
156
 
156
157
  - name: Run tutorials as Jupyter Notebooks (using src/ as the source dir)
157
158
  shell: bash
@@ -106,22 +106,31 @@ This is an example of a workflow that describes the development process.
106
106
  ```
107
107
  - Add extra files to build documentation (from `../assets-docs/` and
108
108
  `../assets-branding/` directories)
109
+
109
110
  ```bash
110
111
  cp -R ../assets-docs/docs/assets/ docs/assets/
111
112
  cp -R ../assets-docs/includes/ includes/
112
113
  cp -R ../assets-docs/overrides/ overrides/
114
+
113
115
  mkdir -p docs/assets/images/
114
- cp ../assets-branding/EasyDiffraction/logos/ed-logo_dark.svg docs/assets/images/
115
- cp ../assets-branding/EasyDiffraction/logos/ed-logo_light.svg docs/assets/images/
116
- cp ../assets-branding/EasyDiffraction/logos/edl-logo_dark.svg docs/assets/images/logo_dark.svg
117
- cp ../assets-branding/EasyDiffraction/logos/edl-logo_light.svg docs/assets/images/logo_light.svg
118
- cp ../assets-branding/EasyDiffraction/icons/ed-icon_256x256.png docs/assets/images/favicon.png
116
+ cp ../assets-branding/easydiffraction/hero/dark.png docs/assets/images/hero_dark.png
117
+ cp ../assets-branding/easydiffraction/hero/light.png docs/assets/images/hero_light.png
118
+ cp ../assets-branding/easydiffraction/logos/dark.svg docs/assets/images/logo_dark.svg
119
+ cp ../assets-branding/easydiffraction/logos/light.svg docs/assets/images/logo_light.svg
120
+ cp ../assets-branding/easydiffraction/icons/color.png docs/assets/images/favicon.png
121
+
119
122
  mkdir -p overrides/.icons/
120
- cp ../assets-branding/EasyDiffraction/icons/ed-icon_bw.svg overrides/.icons/easydiffraction.svg
121
- cp ../assets-branding/EasyScienceOrg/icons/eso-icon_bw.svg overrides/.icons/easyscience.svg
122
- cp -R examples/ docs/examples/
123
- cat ../assets-docs/mkdocs.yml docs/mkdocs.yml > mkdocs.yml
123
+ cp ../assets-branding/easydiffraction/icons/bw.svg overrides/.icons/easydiffraction.svg
124
+ cp ../assets-branding/easyscience-org/icons/eso-icon_bw.svg overrides/.icons/easyscience.svg
125
+
126
+ jupytext tutorials/*.py --from py:percent --to ipynb
127
+ nbstripout tutorials/*.ipynb
128
+ cp tutorials/*.ipynb docs/tutorials/
129
+ cp -R tutorials/data docs/tutorials/
130
+
131
+ python tools/create_mkdocs-yml.py
124
132
  ```
133
+
125
134
  - Build documentation with MkDocs - static site generator
126
135
  ```bash
127
136
  export JUPYTER_PLATFORM_DIRS=1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easydiffraction
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Diffraction data analysis
5
5
  Project-URL: homepage, https://easydiffraction.org
6
6
  Project-URL: documentation, https://docs.easydiffraction.org/lib
@@ -49,7 +49,7 @@ Zenodo, each with a version-specific Digital Object Identifier (DOI).
49
49
  Citation details in various styles (e.g., APA, MLA) and formats (e.g., BibTeX,
50
50
  JSON)
51
51
  are available on the
52
- [Zenodo archive page](https://doi.org/10.5281/zenodo.16806522).
52
+ [Zenodo archive page](https://doi.org/10.5281/zenodo.16806521).
53
53
 
54
54
  ## Contributing
55
55
 
@@ -12,7 +12,7 @@ except ImportError:
12
12
  display = None
13
13
  HTML = None
14
14
 
15
- from easydiffraction.utils.utils import is_pycharm
15
+ from easydiffraction.utils.utils import is_github_ci
16
16
 
17
17
  from .plotter_base import SERIES_CONFIG
18
18
  from .plotter_base import PlotterBase
@@ -106,14 +106,13 @@ class PlotlyPlotter(PlotterBase):
106
106
 
107
107
  # Show the figure
108
108
 
109
- # The standard `fig.show()` method method triggers the following
110
- # warning during the DMSC Summer School 2025 book build process:
111
- # WARNING: skipping unknown output mime type:
112
- # application/vnd.plotly.v1+json [mystnb.unknown_mime_type]
113
- # So, instead, we will use `pio.to_html()` to convert the figure
114
- # to HTML and keep `fig.show()` in PyCharm only.
115
-
116
- if is_pycharm() or display is None or HTML is None:
109
+ # In GitHub CI builds (e.g., during Jupyter Book generation), avoid
110
+ #
111
+ # calling `fig.show()`
112
+ # because it can emit `application/vnd.plotly.v1+json` outputs that some toolchains warn about.
113
+ # Instead, convert the figure to HTML and display it directly.
114
+ # Use a regular Figure and show it
115
+ if not is_github_ci() or display is None or HTML is None:
117
116
  fig.show(config=config)
118
117
  else:
119
118
  html_fig = pio.to_html(
@@ -101,6 +101,17 @@ def is_pycharm() -> bool:
101
101
  return os.environ.get('PYCHARM_HOSTED') == '1'
102
102
 
103
103
 
104
+ def is_github_ci() -> bool:
105
+ """
106
+ Determines if the current process is running in GitHub Actions CI.
107
+
108
+ Returns:
109
+ bool: True if the environment variable ``GITHUB_ACTIONS`` is set
110
+ (Always "true" on GitHub Actions), False otherwise.
111
+ """
112
+ return os.environ.get('GITHUB_ACTIONS') is not None
113
+
114
+
104
115
  def render_table(
105
116
  columns_data,
106
117
  columns_alignment,
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Add a single bootstrap code cell as the very first cell to every .ipynb file
4
+ found under the given path(s).
5
+
6
+ Usage:
7
+ python tools/prepare_notebooks.py tutorials/ [more_paths ...]
8
+
9
+ What it does:
10
+ - Inserts a new *code* cell at index 0 that checks whether the `easydiffraction`
11
+ package is available in the current Jupyter environment and installs it with
12
+ the `visualization` extra if missing.
13
+ - The inserted cell is tagged with "hide-in-docs".
14
+ - If a notebook already has this exact bootstrap cell as its first cell, it will
15
+ not be inserted again (idempotent).
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ import sys
21
+ from pathlib import Path
22
+
23
+ import nbformat
24
+ from nbformat.v4 import new_code_cell
25
+ from nbformat.validator import normalize
26
+
27
+ BOOTSTRAP_SOURCE = (
28
+ '# Check if the easydiffraction library is installed.\n'
29
+ "# If not, install it including the 'visualization' extras.\n"
30
+ '# This is needed, e.g., when running this as a notebook via Google Colab or\n'
31
+ '# Jupyter Notebook in an environment where the library is not pre-installed.\n'
32
+ 'import builtins\n'
33
+ 'import importlib.util\n'
34
+ '\n'
35
+ "if hasattr(builtins, '__IPYTHON__'):\n"
36
+ " if importlib.util.find_spec('easydiffraction') is None:\n"
37
+ " !pip install 'easydiffraction[visualization]'\n"
38
+ )
39
+
40
+ BOOTSTRAP_TAG = 'hide-in-docs'
41
+
42
+
43
+ def iter_notebooks(paths: list[Path]):
44
+ for p in paths:
45
+ if p.is_dir():
46
+ yield from (q for q in p.rglob('*.ipynb') if q.is_file())
47
+ elif p.is_file() and p.suffix == '.ipynb':
48
+ yield p
49
+
50
+
51
+ def has_bootstrap_first_cell(nb) -> bool:
52
+ """Return True if the first cell exactly matches our bootstrap cell."""
53
+ if not nb.cells:
54
+ return False
55
+ first = nb.cells[0]
56
+ if first.cell_type != 'code':
57
+ return False
58
+ if (first.source or '') != BOOTSTRAP_SOURCE:
59
+ return False
60
+ tags = (first.metadata or {}).get('tags', [])
61
+ return BOOTSTRAP_TAG in tags
62
+
63
+
64
+ def ensure_bootstrap(nb) -> bool:
65
+ """
66
+ Ensure the bootstrap cell exists as the very first cell.
67
+ Returns True if a modification was made.
68
+ """
69
+ if has_bootstrap_first_cell(nb):
70
+ return False
71
+
72
+ cell = new_code_cell(
73
+ source=BOOTSTRAP_SOURCE,
74
+ metadata={'tags': [BOOTSTRAP_TAG]},
75
+ )
76
+ nb.cells.insert(0, cell)
77
+ return True
78
+
79
+
80
+ def process_notebook(path: Path) -> int:
81
+ nb = nbformat.read(path, as_version=4)
82
+ changed = 0
83
+ if ensure_bootstrap(nb):
84
+ changed += 1
85
+
86
+ # Normalize to ensure cell ids exist and structure is valid
87
+ if changed or any('id' not in c for c in nb.cells):
88
+ normalize(nb)
89
+ nbformat.write(nb, path)
90
+ return changed
91
+
92
+
93
+ def main(argv: list[str]) -> int:
94
+ if not argv:
95
+ print('Usage: python tools/prepare_notebooks.py <paths...>', file=sys.stderr)
96
+ return 2
97
+
98
+ targets = list(iter_notebooks([Path(p) for p in argv]))
99
+ if not targets:
100
+ print('No .ipynb files found.', file=sys.stderr)
101
+ return 1
102
+
103
+ updated = 0
104
+ for nb_path in targets:
105
+ changes = process_notebook(nb_path)
106
+ if changes:
107
+ print(f'UPDATED: {nb_path} (inserted bootstrap cell)')
108
+ updated += 1
109
+
110
+ if updated == 0:
111
+ print('No changes needed.')
112
+ else:
113
+ print(f'Done. Files changed: {updated}')
114
+ return 0
115
+
116
+
117
+ if __name__ == '__main__':
118
+ raise SystemExit(main(sys.argv[1:]))
@@ -13,18 +13,6 @@
13
13
  # %% [markdown]
14
14
  # ## Import Library
15
15
 
16
- # %% tags=["hide_in_docs"]
17
- # Check if the easydiffraction library is installed.
18
- # If not, install it including the 'visualization' extras.
19
- # This is needed, e.g., when running this as a notebook via Google Colab.
20
- import builtins
21
- import importlib.util
22
-
23
- if hasattr(builtins, '__IPYTHON__'):
24
- if importlib.util.find_spec('easydiffraction') is None:
25
- print('Installing the easydiffraction library...')
26
- # !pip install 'easydiffraction[visualization]'
27
-
28
16
  # %%
29
17
  from easydiffraction import Experiment
30
18
  from easydiffraction import Project
@@ -19,18 +19,6 @@
19
19
  # %% [markdown]
20
20
  # ## Import Library
21
21
 
22
- # %% tags=["hide_in_docs"]
23
- # Check if the easydiffraction library is installed.
24
- # If not, install it including the 'visualization' extras.
25
- # This is needed, e.g., when running this as a notebook via Google Colab.
26
- import builtins
27
- import importlib.util
28
-
29
- if hasattr(builtins, '__IPYTHON__'):
30
- if importlib.util.find_spec('easydiffraction') is None:
31
- print('Installing the easydiffraction library...')
32
- # !pip install 'easydiffraction[visualization]'
33
-
34
22
  # %%
35
23
  import easydiffraction as ed
36
24
 
@@ -7,18 +7,6 @@
7
7
  # %% [markdown]
8
8
  # ## Import Library
9
9
 
10
- # %% tags=["hide_in_docs"]
11
- # Check if the easydiffraction library is installed.
12
- # If not, install it including the 'visualization' extras.
13
- # This is needed, e.g., when running this as a notebook via Google Colab.
14
- import builtins
15
- import importlib.util
16
-
17
- if hasattr(builtins, '__IPYTHON__'):
18
- if importlib.util.find_spec('easydiffraction') is None:
19
- print('Installing the easydiffraction library...')
20
- # !pip install 'easydiffraction[visualization]'
21
-
22
10
  # %%
23
11
  from easydiffraction import Experiment
24
12
  from easydiffraction import Project
@@ -7,18 +7,6 @@
7
7
  # %% [markdown]
8
8
  # ## Import Library
9
9
 
10
- # %% tags=["hide_in_docs"]
11
- # Check if the easydiffraction library is installed.
12
- # If not, install it including the 'visualization' extras.
13
- # This is needed, e.g., when running this as a notebook via Google Colab.
14
- import builtins
15
- import importlib.util
16
-
17
- if hasattr(builtins, '__IPYTHON__'):
18
- if importlib.util.find_spec('easydiffraction') is None:
19
- print('Installing the easydiffraction library...')
20
- # !pip install 'easydiffraction[visualization]'
21
-
22
10
  # %%
23
11
  from easydiffraction import Experiment
24
12
  from easydiffraction import Project
@@ -7,18 +7,6 @@
7
7
  # %% [markdown]
8
8
  # ## Import Library
9
9
 
10
- # %% tags=["hide_in_docs"]
11
- # Check if the easydiffraction library is installed.
12
- # If not, install it including the 'visualization' extras.
13
- # This is needed, e.g., when running this as a notebook via Google Colab.
14
- import builtins
15
- import importlib.util
16
-
17
- if hasattr(builtins, '__IPYTHON__'):
18
- if importlib.util.find_spec('easydiffraction') is None:
19
- print('Installing the easydiffraction library...')
20
- # !pip install 'easydiffraction[visualization]'
21
-
22
10
  # %%
23
11
  from easydiffraction import Experiment
24
12
  from easydiffraction import Project
@@ -10,18 +10,6 @@
10
10
  # %% [markdown]
11
11
  # ## Import Library
12
12
 
13
- # %% tags=["hide_in_docs"]
14
- # Check if the easydiffraction library is installed.
15
- # If not, install it including the 'visualization' extras.
16
- # This is needed, e.g., when running this as a notebook via Google Colab.
17
- import builtins
18
- import importlib.util
19
-
20
- if hasattr(builtins, '__IPYTHON__'):
21
- if importlib.util.find_spec('easydiffraction') is None:
22
- print('Installing the easydiffraction library...')
23
- # !pip install 'easydiffraction[visualization]'
24
-
25
13
  # %%
26
14
  from easydiffraction import Experiment
27
15
  from easydiffraction import Project
@@ -8,18 +8,6 @@
8
8
  # %% [markdown]
9
9
  # ## Import Library
10
10
 
11
- # %% tags=["hide_in_docs"]
12
- # Check if the easydiffraction library is installed.
13
- # If not, install it including the 'visualization' extras.
14
- # This is needed, e.g., when running this as a notebook via Google Colab.
15
- import builtins
16
- import importlib.util
17
-
18
- if hasattr(builtins, '__IPYTHON__'):
19
- if importlib.util.find_spec('easydiffraction') is None:
20
- print('Installing the easydiffraction library...')
21
- # !pip install 'easydiffraction[visualization]'
22
-
23
11
  # %%
24
12
  from easydiffraction import Experiment
25
13
  from easydiffraction import Project