gratinglab 0.3.6__tar.gz → 0.3.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 (222) hide show
  1. {gratinglab-0.3.6/src/gratinglab.egg-info → gratinglab-0.3.7}/PKG-INFO +32 -3
  2. {gratinglab-0.3.6 → gratinglab-0.3.7}/README.md +31 -2
  3. {gratinglab-0.3.6 → gratinglab-0.3.7}/pyproject.toml +9 -0
  4. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/__init__.py +12 -1
  5. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/provenance.py +30 -4
  6. gratinglab-0.3.7/src/gratinglab/gui/qt/help_menu.py +93 -0
  7. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/launcher.py +135 -6
  8. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/main_window.py +13 -30
  9. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/main_window.py +15 -4
  10. {gratinglab-0.3.6 → gratinglab-0.3.7/src/gratinglab.egg-info}/PKG-INFO +32 -3
  11. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab.egg-info/SOURCES.txt +2 -0
  12. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_changelog.py +33 -0
  13. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_cmethod_tab.py +4 -0
  14. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_compare_tab.py +5 -0
  15. gratinglab-0.3.7/tests/test_gui_help_menu.py +125 -0
  16. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_launcher.py +217 -0
  17. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_provenance.py +65 -0
  18. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_qt.py +23 -10
  19. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_theme.py +1 -0
  20. {gratinglab-0.3.6 → gratinglab-0.3.7}/LICENSE +0 -0
  21. {gratinglab-0.3.6 → gratinglab-0.3.7}/MANIFEST.in +0 -0
  22. {gratinglab-0.3.6 → gratinglab-0.3.7}/docs/conventions.md +0 -0
  23. {gratinglab-0.3.6 → gratinglab-0.3.7}/docs/theory/cmethod.md +0 -0
  24. {gratinglab-0.3.6 → gratinglab-0.3.7}/docs/theory/integral.md +0 -0
  25. {gratinglab-0.3.6 → gratinglab-0.3.7}/docs/theory/metrology.md +0 -0
  26. {gratinglab-0.3.6 → gratinglab-0.3.7}/docs/theory/rcwa.md +0 -0
  27. {gratinglab-0.3.6 → gratinglab-0.3.7}/docs/theory/scalar.md +0 -0
  28. {gratinglab-0.3.6 → gratinglab-0.3.7}/setup.cfg +0 -0
  29. {gratinglab-0.3.6 → gratinglab-0.3.7}/setup.py +0 -0
  30. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/checks.py +0 -0
  31. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/compare.py +0 -0
  32. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/convergence.py +0 -0
  33. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/geometry.py +0 -0
  34. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/__init__.py +0 -0
  35. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/app.py +0 -0
  36. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/cmethod_options.py +0 -0
  37. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/comparison.py +0 -0
  38. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/diagram.py +0 -0
  39. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/diagram3d.py +0 -0
  40. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/docs.py +0 -0
  41. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/efficiency_plot.py +0 -0
  42. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/icon.py +0 -0
  43. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/integral_options.py +0 -0
  44. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/launcher.py +0 -0
  45. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/mathtext.py +0 -0
  46. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/orders.py +0 -0
  47. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/__init__.py +0 -0
  48. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/cmethod_tab.py +0 -0
  49. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/compare_tab.py +0 -0
  50. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/geometry_panel.py +0 -0
  51. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/geometry_tab.py +0 -0
  52. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/integral_tab.py +0 -0
  53. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/profile_plot_panel.py +0 -0
  54. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/rcwa_tab.py +0 -0
  55. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/scalar_tab.py +0 -0
  56. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/scene3d_panel.py +0 -0
  57. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/setup_tab.py +0 -0
  58. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/sizing.py +0 -0
  59. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/theming.py +0 -0
  60. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/theory_viewer.py +0 -0
  61. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/qt/worker.py +0 -0
  62. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/rcwa_options.py +0 -0
  63. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/richtext.py +0 -0
  64. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/scalar_options.py +0 -0
  65. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/state.py +0 -0
  66. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/gui/theme.py +0 -0
  67. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/illumination.py +0 -0
  68. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/io/__init__.py +0 -0
  69. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/io/boundary.py +0 -0
  70. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/io/efficiency_table.py +0 -0
  71. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/io/ggp.py +0 -0
  72. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/io/txl.py +0 -0
  73. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/materials/__init__.py +0 -0
  74. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/materials/data/SOURCES.md +0 -0
  75. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/materials/fresnel.py +0 -0
  76. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/materials/optical.py +0 -0
  77. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/materials/refractiveindex.py +0 -0
  78. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/materials/typical.py +0 -0
  79. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/measured.py +0 -0
  80. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/__init__.py +0 -0
  81. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/_analyzer_summary.py +0 -0
  82. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/analyzer.py +0 -0
  83. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/boundary/__init__.py +0 -0
  84. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/boundary/average.py +0 -0
  85. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/boundary/cross_section.py +0 -0
  86. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/boundary/pipeline.py +0 -0
  87. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/boundary/swaths.py +0 -0
  88. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/cli.py +0 -0
  89. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/config.py +0 -0
  90. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/__init__.py +0 -0
  91. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/analysis.py +0 -0
  92. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/image_flatten.py +0 -0
  93. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/orientation.py +0 -0
  94. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/processing.py +0 -0
  95. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/region_mask.py +0 -0
  96. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/scars.py +0 -0
  97. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/core/tip.py +0 -0
  98. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/data/__init__.py +0 -0
  99. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/data/aggregation.py +0 -0
  100. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/__init__.py +0 -0
  101. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/icon.py +0 -0
  102. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/__init__.py +0 -0
  103. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/app.py +0 -0
  104. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/boundary_view.py +0 -0
  105. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/canvas.py +0 -0
  106. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/efficiency_dialog.py +0 -0
  107. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/import_view.py +0 -0
  108. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/layout.py +0 -0
  109. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/swath_dialog.py +0 -0
  110. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/wiki_view.py +0 -0
  111. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/qt/worker.py +0 -0
  112. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/gui/state.py +0 -0
  113. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/io/__init__.py +0 -0
  114. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/io/file_io.py +0 -0
  115. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/io/ibw.py +0 -0
  116. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/io/metrics.py +0 -0
  117. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/io/sem.py +0 -0
  118. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/io/spm.py +0 -0
  119. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/settings.py +0 -0
  120. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/stats/__init__.py +0 -0
  121. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/stats/analysis.py +0 -0
  122. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/stats/icc.py +0 -0
  123. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/visualization/__init__.py +0 -0
  124. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/visualization/diagnostics.py +0 -0
  125. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/visualization/profiles.py +0 -0
  126. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/visualization/statistics.py +0 -0
  127. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/__init__.py +0 -0
  128. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/facet-fitting.md +0 -0
  129. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/file-formats.md +0 -0
  130. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/flattening.md +0 -0
  131. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/groove-orientation.md +0 -0
  132. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/icc-correction.md +0 -0
  133. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/overview.md +0 -0
  134. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/reading-outputs.md +0 -0
  135. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/row-groups.md +0 -0
  136. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/scars-and-masking.md +0 -0
  137. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/swath-statistics.md +0 -0
  138. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/wiki/tip-correction.md +0 -0
  139. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/metrology/workflows.py +0 -0
  140. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/problem.py +0 -0
  141. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/profiles/__init__.py +0 -0
  142. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/profiles/_base.py +0 -0
  143. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/profiles/_polyline.py +0 -0
  144. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/profiles/_shapes.py +0 -0
  145. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/profiles/_trapezoid.py +0 -0
  146. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/profiles/_types.py +0 -0
  147. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/resolution.py +0 -0
  148. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/result.py +0 -0
  149. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/__init__.py +0 -0
  150. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/_conditioning.py +0 -0
  151. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/_execution.py +0 -0
  152. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/_scalar_groove.py +0 -0
  153. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/base.py +0 -0
  154. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/cmethod/__init__.py +0 -0
  155. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/cmethod/_core.py +0 -0
  156. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/cmethod/_series.py +0 -0
  157. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/integral/__init__.py +0 -0
  158. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/integral/_boundary.py +0 -0
  159. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/integral/_core.py +0 -0
  160. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/integral/_finite.py +0 -0
  161. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/integral/_greens.py +0 -0
  162. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/integral/_kernels.py +0 -0
  163. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/integral/_nystrom.py +0 -0
  164. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/rcwa/__init__.py +0 -0
  165. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/rcwa/_core.py +0 -0
  166. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/rcwa/_stack.py +0 -0
  167. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab/solvers/scalar.py +0 -0
  168. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab.egg-info/dependency_links.txt +0 -0
  169. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab.egg-info/entry_points.txt +0 -0
  170. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab.egg-info/requires.txt +0 -0
  171. {gratinglab-0.3.6 → gratinglab-0.3.7}/src/gratinglab.egg-info/top_level.txt +0 -0
  172. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_checks.py +0 -0
  173. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_cmethod.py +0 -0
  174. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_compare.py +0 -0
  175. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_conditioning.py +0 -0
  176. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_convergence.py +0 -0
  177. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_cross_method.py +0 -0
  178. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_efficiency_table.py +0 -0
  179. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_four_way.py +0 -0
  180. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_fresnel.py +0 -0
  181. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_geometry.py +0 -0
  182. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_ggp.py +0 -0
  183. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_cmethod_options.py +0 -0
  184. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_diagram.py +0 -0
  185. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_diagram3d.py +0 -0
  186. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_docs.py +0 -0
  187. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_integral_options.py +0 -0
  188. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_mathtext.py +0 -0
  189. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_orders.py +0 -0
  190. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_rcwa_options.py +0 -0
  191. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_richtext.py +0 -0
  192. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_scalar_options.py +0 -0
  193. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_gui_state.py +0 -0
  194. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_illumination.py +0 -0
  195. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_core.py +0 -0
  196. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_corpus.py +0 -0
  197. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_finite.py +0 -0
  198. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_graded.py +0 -0
  199. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_greens.py +0 -0
  200. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_kernels.py +0 -0
  201. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_measured_polygon.py +0 -0
  202. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_operators.py +0 -0
  203. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_integral_solver.py +0 -0
  204. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_io_boundary.py +0 -0
  205. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_littrow.py +0 -0
  206. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_materials.py +0 -0
  207. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_measured.py +0 -0
  208. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_perturbation.py +0 -0
  209. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_profiles.py +0 -0
  210. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_rayleigh_anomaly.py +0 -0
  211. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_rcwa.py +0 -0
  212. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_rcwa_benchmarks.py +0 -0
  213. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_refractiveindex.py +0 -0
  214. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_resolution.py +0 -0
  215. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_result.py +0 -0
  216. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_scalar.py +0 -0
  217. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_solver_conformance.py +0 -0
  218. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_solver_execution.py +0 -0
  219. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_solver_progress.py +0 -0
  220. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_trapezoidal_solvers.py +0 -0
  221. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_txl.py +0 -0
  222. {gratinglab-0.3.6 → gratinglab-0.3.7}/tests/test_typical.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gratinglab
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Open platform for diffraction grating groove metrology and efficiency analysis
5
5
  Author: Jake McCoy, Aditi Gangadharan
6
6
  License-Expression: BSD-3-Clause
@@ -315,7 +315,12 @@ gratinglab-metrology-gui # straight to AFM import, blaze angles, boundary
315
315
  There are two windows, and `gratinglab-app` is the front door that asks which one
316
316
  you want. Neither is a dead end: each carries a **Go** menu that switches to the other
317
317
  and returns to the chooser (`Ctrl+Shift+M`), and switching reuses a window that is
318
- already open rather than starting a second empty copy of it. Both halves are this one package — the metrology measures a groove and the
318
+ already open rather than starting a second empty copy of it. The chooser itself carries
319
+ the same **View → Theme** and **Help** menus the two windows do, so the theme — a
320
+ setting for the whole application — and the theory pages are reachable without opening
321
+ a window first. While it is on screen it imports both windows on a background thread,
322
+ so the first open is a fifth of a second rather than the several seconds of matplotlib
323
+ and scipy imports it used to be. Both halves are this one package — the metrology measures a groove and the
319
324
  solvers compute an efficiency from the result — but the desktop layer used to ship
320
325
  them as two commands and two application bundles, the AFM one still named after the
321
326
  repository it was merged from, which made the half in regular use the half that was
@@ -372,7 +377,12 @@ hides it), and the window has one tab for each task:
372
377
  Each registered solver receives a tab generated from the solver registry, so a
373
378
  new backend appears in the window once it is registered.
374
379
 
375
- The Help menu contains the theory pages, rendered with typeset equations and tables.
380
+ The **Help** menu contains the theory pages, rendered with typeset equations and
381
+ tables. It is on every window: the conventions page fixes the angles a measured
382
+ profile is reported in, and `theory/metrology.md` describes the metrology window's
383
+ own analysis, so the AFM window needs those pages at least as much as this one does.
384
+ **Help → About GratingLab** names the authors and states which version is running and
385
+ when it was released, so a bug report can say which copy it came from.
376
386
  **View → Theme** switches between System (following the operating system), Light,
377
387
  Dark, Solarized Light, Solarized Dark and High contrast; the choice is remembered and
378
388
  applies to the metrology window too. Diffraction orders are coloured by sign, cool for
@@ -430,6 +440,25 @@ git clone https://github.com/jamccoy/gratinglab.wiki.git ../gratinglab.wiki
430
440
  .venv/bin/ruff check .
431
441
  ```
432
442
 
443
+ A full run is about 2750 tests and some minutes of every core, most of it
444
+ thousands of small solves rather than a few long ones. For the loop before a
445
+ push there is a quicker pass, which leaves out the tests that build a real Qt
446
+ window, caps the BLAS pools at one thread and runs at a lower priority:
447
+
448
+ ```bash
449
+ .venv/bin/python tools/test_fast.py
450
+ ```
451
+
452
+ It takes pytest's own arguments (`-k`, `-x`, a path), and `--gui` puts the Qt
453
+ tests back. The deselection is a marker, so plain pytest can do it too:
454
+
455
+ ```bash
456
+ .venv/bin/python -m pytest -m "not gui"
457
+ ```
458
+
459
+ Neither replaces the full suite, which CI runs on four platform and version
460
+ legs; they are for keeping an older machine usable between pushes.
461
+
433
462
  The test suite relies on three practices in particular:
434
463
 
435
464
  - **Physical self-checks.** `checks.check_reciprocity` and `checks.check_energy_balance`
@@ -271,7 +271,12 @@ gratinglab-metrology-gui # straight to AFM import, blaze angles, boundary
271
271
  There are two windows, and `gratinglab-app` is the front door that asks which one
272
272
  you want. Neither is a dead end: each carries a **Go** menu that switches to the other
273
273
  and returns to the chooser (`Ctrl+Shift+M`), and switching reuses a window that is
274
- already open rather than starting a second empty copy of it. Both halves are this one package — the metrology measures a groove and the
274
+ already open rather than starting a second empty copy of it. The chooser itself carries
275
+ the same **View → Theme** and **Help** menus the two windows do, so the theme — a
276
+ setting for the whole application — and the theory pages are reachable without opening
277
+ a window first. While it is on screen it imports both windows on a background thread,
278
+ so the first open is a fifth of a second rather than the several seconds of matplotlib
279
+ and scipy imports it used to be. Both halves are this one package — the metrology measures a groove and the
275
280
  solvers compute an efficiency from the result — but the desktop layer used to ship
276
281
  them as two commands and two application bundles, the AFM one still named after the
277
282
  repository it was merged from, which made the half in regular use the half that was
@@ -328,7 +333,12 @@ hides it), and the window has one tab for each task:
328
333
  Each registered solver receives a tab generated from the solver registry, so a
329
334
  new backend appears in the window once it is registered.
330
335
 
331
- The Help menu contains the theory pages, rendered with typeset equations and tables.
336
+ The **Help** menu contains the theory pages, rendered with typeset equations and
337
+ tables. It is on every window: the conventions page fixes the angles a measured
338
+ profile is reported in, and `theory/metrology.md` describes the metrology window's
339
+ own analysis, so the AFM window needs those pages at least as much as this one does.
340
+ **Help → About GratingLab** names the authors and states which version is running and
341
+ when it was released, so a bug report can say which copy it came from.
332
342
  **View → Theme** switches between System (following the operating system), Light,
333
343
  Dark, Solarized Light, Solarized Dark and High contrast; the choice is remembered and
334
344
  applies to the metrology window too. Diffraction orders are coloured by sign, cool for
@@ -386,6 +396,25 @@ git clone https://github.com/jamccoy/gratinglab.wiki.git ../gratinglab.wiki
386
396
  .venv/bin/ruff check .
387
397
  ```
388
398
 
399
+ A full run is about 2750 tests and some minutes of every core, most of it
400
+ thousands of small solves rather than a few long ones. For the loop before a
401
+ push there is a quicker pass, which leaves out the tests that build a real Qt
402
+ window, caps the BLAS pools at one thread and runs at a lower priority:
403
+
404
+ ```bash
405
+ .venv/bin/python tools/test_fast.py
406
+ ```
407
+
408
+ It takes pytest's own arguments (`-k`, `-x`, a path), and `--gui` puts the Qt
409
+ tests back. The deselection is a marker, so plain pytest can do it too:
410
+
411
+ ```bash
412
+ .venv/bin/python -m pytest -m "not gui"
413
+ ```
414
+
415
+ Neither replaces the full suite, which CI runs on four platform and version
416
+ legs; they are for keeping an older machine usable between pushes.
417
+
389
418
  The test suite relies on three practices in particular:
390
419
 
391
420
  - **Physical self-checks.** `checks.check_reciprocity` and `checks.check_energy_balance`
@@ -183,6 +183,15 @@ select = ["E4", "E7", "E9", "F"]
183
183
 
184
184
  [tool.pytest.ini_options]
185
185
  testpaths = ["tests"]
186
+ # Registered so `--strict-markers` stays meaningful and `-m` has something to
187
+ # select on. `gui` is the Qt half: every test under it builds a real window,
188
+ # which is both the slowest part of a run and the part an older or a
189
+ # thermally-limited machine feels first. `pytest -m "not gui"` is the quick
190
+ # pass; `tools/test_fast.py` is that plus a cap on the BLAS pools. CI runs
191
+ # everything, so nothing here is a reason to skip the Qt tests before a push.
192
+ markers = [
193
+ "gui: builds a real Qt window (deselect with -m 'not gui')",
194
+ ]
186
195
  # Relative to rootdir, so a run driven from a copied tree imports *that*
187
196
  # tree's package. Without it, mutation testing silently imports the real
188
197
  # source and reports every mutant as surviving -- a useless green run rather
@@ -22,7 +22,17 @@ from .measured import MeasuredEfficiency, MeasurementProvenance
22
22
  from .resolution import ResolvingPower, resolving_power
23
23
  from .result import EfficiencyScan, OrderEfficiency, Provenance
24
24
 
25
- __version__ = "0.3.6"
25
+ __version__ = "0.3.7"
26
+
27
+ #: The day this version was released, ISO 8601. It sits beside the version
28
+ #: rather than being read from CHANGELOG.md at run time because the changelog
29
+ #: is not in the wheel -- only `docs/` is -- so an installed copy would have
30
+ #: nothing to read and the About box would be blank for everyone but a
31
+ #: developer. `tests/test_changelog.py` asserts that it matches the date on
32
+ #: the `## <version>` heading, so the release commit that forgets to move it
33
+ #: fails at the point where it is cheapest to fix, the same arrangement as
34
+ #: the version's own section.
35
+ __version_date__ = "2026-11-13"
26
36
 
27
37
  __all__ = [
28
38
  "Illumination",
@@ -35,4 +45,5 @@ __all__ = [
35
45
  "ResolvingPower",
36
46
  "resolving_power",
37
47
  "__version__",
48
+ "__version_date__",
38
49
  ]
@@ -33,6 +33,7 @@ __all__ = [
33
33
  "provenance_lines",
34
34
  "error_lines",
35
35
  "to_html",
36
+ "AUTHORS",
36
37
  "about_text",
37
38
  ]
38
39
 
@@ -270,18 +271,43 @@ def alarming_text(lines: Sequence[Line]) -> str:
270
271
  return "".join(line.text for line in lines if line.tag in ALARM_TAGS)
271
272
 
272
273
 
273
- def about_text(version: str) -> str:
274
- """The About box, as a string so it can be asserted without a dialog."""
274
+ #: Who wrote it, in the order CITATION.cff and pyproject.toml give. Named
275
+ #: here rather than in the widget so that the three places a reader can learn
276
+ #: this -- the citation file, the package metadata and the About box -- cannot
277
+ #: say three different things without a test noticing.
278
+ AUTHORS = ("Jake McCoy", "Aditi Gangadharan")
279
+
280
+
281
+ def about_text(version: str, released: str | None = None) -> str:
282
+ """The About box, as a string so it can be asserted without a dialog.
283
+
284
+ ``released`` is the version's release date, which the caller passes as
285
+ :data:`gratinglab.__version_date__`. It is optional because the date is
286
+ about the release and this function is about the text, and a caller with
287
+ no date to hand (a test of the wording, a future entry point) should get
288
+ the box rather than a TypeError. Omitting it drops the clause; it never
289
+ invents one, since a wrong date is worse than no date.
290
+ """
291
+ when = f", released {released}" if released else ""
275
292
  return (
276
293
  "GratingLab\n"
277
- f"Version {version}\n\n"
294
+ f"Version {version}{when}\n\n"
278
295
  "An open comparison platform for grating efficiency analysis: "
279
296
  "scalar, RCWA, C-method and integral-method solvers driven from "
280
- "one problem spec.\n\n"
297
+ "one problem spec, with AFM groove metrology in the same package.\n\n"
298
+ f"{_and_list(AUTHORS)}.\n\n"
281
299
  "BSD-3-Clause."
282
300
  )
283
301
 
284
302
 
303
+ def _and_list(names: Sequence[str]) -> str:
304
+ """``"A"``, ``"A and B"``, ``"A, B and C"``: the credits, as a sentence."""
305
+ names = list(names)
306
+ if len(names) < 2:
307
+ return "".join(names)
308
+ return f"{', '.join(names[:-1])} and {names[-1]}"
309
+
310
+
285
311
  def _milliseconds(wall_time_s: Any) -> str:
286
312
  """Wall time for the header, tolerant of a solver that recorded none."""
287
313
  if wall_time_s is None:
@@ -0,0 +1,93 @@
1
+ """The Help menu, built in one place and installed in every window.
2
+
3
+ The menu was written into the efficiency window, which is where the theory
4
+ pages came from, so the AFM window -- merged in later, from a project that
5
+ had no such pages -- offered no route to them at all. That is the wrong way
6
+ round for two of them: ``conventions.md`` fixes the angle conventions a
7
+ measured profile is reported in, and ``theory/metrology.md`` is about the AFM
8
+ half itself. A user measuring a scan was the one user who could not read
9
+ either.
10
+
11
+ So the menu lives here and each window installs it, the same arrangement as
12
+ the Go menu in :mod:`gratinglab.gui.qt.launcher`: neither window knows the
13
+ other has it, and a page added to :mod:`gratinglab.gui.docs` appears in both
14
+ at once.
15
+
16
+ ``menu_bar`` exists because the chooser is a plain ``QWidget`` and has no
17
+ ``menuBar()`` of its own; it hands in the one it put in its layout. The
18
+ windows pass nothing and get theirs.
19
+ """
20
+
21
+ from __future__ import annotations
22
+
23
+ from PySide6.QtWidgets import QMessageBox
24
+
25
+ __all__ = ["HELP_MENU_TITLE", "install_help_menu", "show_about", "show_theory"]
26
+
27
+ #: Title of the menu. One constant, so a test and both windows agree.
28
+ HELP_MENU_TITLE = "&Help"
29
+
30
+
31
+ def show_about(parent=None) -> None:
32
+ """The About box. Its text is :func:`gratinglab.gui.provenance.about_text`,
33
+ which is a plain string so it can be asserted without a dialog."""
34
+ from ... import __version__, __version_date__
35
+ from .. import provenance
36
+
37
+ QMessageBox.about(
38
+ parent,
39
+ "About GratingLab",
40
+ provenance.about_text(__version__, __version_date__),
41
+ )
42
+
43
+
44
+ def show_theory(page, parent=None):
45
+ """Open the read-only viewer for one theory or reference page.
46
+
47
+ ``parent`` is what keeps the viewer alive: a top-level Qt window with no
48
+ reference on either side is collected and vanishes a moment after it
49
+ appears.
50
+ """
51
+ from .theory_viewer import TheoryViewer
52
+
53
+ viewer = TheoryViewer(page, parent=parent)
54
+ viewer.show()
55
+ return viewer
56
+
57
+
58
+ def install_help_menu(window, menu_bar=None):
59
+ """Add the Help menu to ``window`` and return it.
60
+
61
+ The caller holds the returned QMenu. Under PySide6 6.11 a QMenu reached
62
+ back through ``menuBar().actions()[i].menu()`` is not reliably usable --
63
+ it raises "Internal C++ object already deleted" while the menu the window
64
+ built is alive and correct -- so whatever builds a menu must keep it. It
65
+ is also stored on the window, so a caller that forgets still cannot lose
66
+ it.
67
+ """
68
+ from ..docs import general_pages, theory_pages
69
+ from ..richtext import menu_label
70
+
71
+ bar = window.menuBar() if menu_bar is None else menu_bar
72
+ menu = bar.addMenu(HELP_MENU_TITLE)
73
+ menu.addAction("About GratingLab", lambda: show_about(window))
74
+ menu.addSeparator()
75
+
76
+ # Foundational, solver-independent reference first -- the generalized
77
+ # grating equation and the angle conventions -- then one page per method.
78
+ for page in general_pages():
79
+ suffix = "" if page.available else " (not written yet)"
80
+ menu.addAction(
81
+ menu_label(page.title, suffix),
82
+ lambda p=page: show_theory(p, window),
83
+ )
84
+ menu.addSeparator()
85
+ for page in theory_pages():
86
+ suffix = " Theory" + ("" if page.available else " (not written yet)")
87
+ menu.addAction(
88
+ menu_label(page.title, suffix),
89
+ lambda p=page: show_theory(p, window),
90
+ )
91
+
92
+ window._gratinglab_help_menu = menu
93
+ return menu
@@ -1,21 +1,33 @@
1
1
  """The chooser's widget. Which windows exist is :mod:`gratinglab.gui.launcher`.
2
2
 
3
3
  Thin, by the rule for this package: it draws a button per mode and imports the
4
- chosen window. The one piece of real behaviour is keeping a reference to each
5
- window it opens -- see :data:`_OPEN_WINDOWS`.
4
+ chosen window. Two pieces of real behaviour: keeping a reference to each
5
+ window it opens (see :data:`_OPEN_WINDOWS`), and importing both windows off
6
+ the GUI thread while the chooser is on screen (see :func:`prewarm`, which
7
+ exists because the first open used to freeze the application).
8
+
9
+ It also carries the View and Help menus the two windows carry, built by the
10
+ same code. The chooser is where a session starts and where it returns, and it
11
+ was the one place from which the theme -- an application-wide setting -- could
12
+ not be changed and no page could be read.
6
13
  """
7
14
 
8
15
  from __future__ import annotations
9
16
 
17
+ import atexit
18
+ import sys
19
+ import threading
10
20
  from functools import partial
11
21
  from importlib import import_module
12
22
 
13
23
  from PySide6.QtCore import Qt
14
24
  from PySide6.QtGui import QKeySequence
15
25
  from PySide6.QtWidgets import (
26
+ QApplication,
16
27
  QFrame,
17
28
  QHBoxLayout,
18
29
  QLabel,
30
+ QMenuBar,
19
31
  QPushButton,
20
32
  QSizePolicy,
21
33
  QVBoxLayout,
@@ -23,12 +35,14 @@ from PySide6.QtWidgets import (
23
35
  )
24
36
 
25
37
  from ..launcher import MODES
38
+ from . import theming
26
39
 
27
40
  __all__ = [
28
41
  "LauncherWindow",
29
42
  "SWITCH_MENU_TITLE",
30
43
  "install_switch_menu",
31
44
  "open_window",
45
+ "prewarm",
32
46
  "show_chooser",
33
47
  "window_for",
34
48
  ]
@@ -52,6 +66,14 @@ _OPEN_WINDOWS: list[QWidget] = []
52
66
  #: held, so this one can be shown again after it closed itself.
53
67
  _CHOOSER: list = []
54
68
 
69
+ #: The background import started by :func:`prewarm`, at most one per process.
70
+ _PREWARM: list[threading.Thread] = []
71
+
72
+ #: How long exit waits for that import to finish. It is seconds of work, and
73
+ #: waiting is only to keep the interpreter from finalising mid-import; a
74
+ #: thread that is somehow stuck must not hold the application open.
75
+ _PREWARM_JOIN_S = 10.0
76
+
55
77
 
56
78
  def window_for(chosen):
57
79
  """The window already open for a mode, or None.
@@ -113,24 +135,106 @@ def open_window(chosen):
113
135
  return _raise(existing)
114
136
 
115
137
  module_name, _, attribute = chosen.window.partition(":")
116
- window_class = getattr(import_module(module_name), attribute)
117
138
 
118
- window = window_class()
139
+ # A wait cursor around the part that cannot leave this thread. `prewarm`
140
+ # should have made the import free, but it has not necessarily finished
141
+ # when the user clicks, and the window itself still has to be built here.
142
+ QApplication.setOverrideCursor(Qt.WaitCursor)
143
+ try:
144
+ window_class = getattr(import_module(module_name), attribute)
145
+ window = window_class()
146
+ finally:
147
+ QApplication.restoreOverrideCursor()
148
+
119
149
  window._gratinglab_mode = chosen.key
120
150
  install_switch_menu(window, chosen)
121
151
  _OPEN_WINDOWS.append(window)
122
152
  return _raise(window)
123
153
 
124
154
 
155
+ def prewarm():
156
+ """Import the window modules off the GUI thread, while the chooser waits.
157
+
158
+ Opening a window for the first time used to freeze the application, badly
159
+ enough on Windows to be reported as "almost non-responsive". The work is
160
+ all import: measured on macOS, opening the metrology window blocks the GUI
161
+ thread for 1.7 s with everything cached and 8.8 s on a machine that has
162
+ not built matplotlib's font cache yet -- which is once per machine, and so
163
+ is exactly the first open. The efficiency window costs 6.6 s on that same
164
+ cold cache. Windows adds a multiplier these numbers do not show, because
165
+ Defender scans each of scipy's and matplotlib's binaries the first time it
166
+ is touched, and it paints "Not Responding" over any window that stops
167
+ pumping events for about five seconds.
168
+
169
+ None of that work needs the GUI thread. Importing a module binds classes
170
+ and creates no QObject, so it runs here instead, in the seconds the user
171
+ spends reading the chooser. The same measurement with this in place: the
172
+ background import takes 7.6 s with the GUI live throughout, and the click
173
+ that follows costs 0.2 s where it cost 8.8 s.
174
+
175
+ A click part-way through is no worse than before: the GUI thread blocks on
176
+ Python's per-module import lock, which is the same wait it used to do
177
+ itself. The thread is joined at exit rather than merely left daemonic, so
178
+ the interpreter cannot begin finalising in the middle of an import.
179
+
180
+ Returns the thread, so a test can wait for it, or None when there is
181
+ nothing left to import.
182
+ """
183
+ if _PREWARM:
184
+ return None
185
+ pending = [
186
+ name
187
+ for name in (chosen.window.partition(":")[0] for chosen in MODES)
188
+ if name not in sys.modules
189
+ ]
190
+ if not pending:
191
+ return None
192
+
193
+ def warm():
194
+ for module_name in pending:
195
+ try:
196
+ import_module(module_name)
197
+ except Exception:
198
+ # This is an optimisation and nothing more. A module that
199
+ # cannot be imported has to raise where the user asked for
200
+ # it -- from the click -- and not from a thread nobody
201
+ # started, as a traceback on a console they may not have.
202
+ # `continue`, not `return`: one broken window is no reason to
203
+ # leave the other one cold.
204
+ continue
205
+
206
+ thread = threading.Thread(target=warm, name="gratinglab-prewarm", daemon=True)
207
+ _PREWARM.append(thread)
208
+ thread.start()
209
+ atexit.register(thread.join, _PREWARM_JOIN_S)
210
+ return thread
211
+
212
+
125
213
  def show_chooser():
126
214
  """Bring the chooser back, the same one if it has been up before."""
127
215
  if not _CHOOSER:
128
216
  _CHOOSER.append(LauncherWindow())
129
- return _raise(_CHOOSER[0])
217
+ shown = _raise(_CHOOSER[0])
218
+ # After the chooser is up, never before: the point is to use the time the
219
+ # user spends reading it, and an import started first would delay it.
220
+ prewarm()
221
+ return shown
130
222
 
131
223
 
132
224
  class LauncherWindow(QWidget):
133
- """Two buttons and a sentence each, so neither half can be missed."""
225
+ """Two buttons and a sentence each, so neither half can be missed.
226
+
227
+ It carries the same View and Help menus the two windows do. The chooser
228
+ is where a session starts and, after "Main Menu", where it pauses, so it
229
+ was the one place from which the theme could not be changed and no page
230
+ could be read -- both of which had to be done by opening a window first
231
+ and then coming back. The theme in particular is a setting for the whole
232
+ application, not for whichever window happens to be open.
233
+
234
+ A plain ``QWidget`` has no ``menuBar()``, so the bar is built here and put
235
+ at the top of the layout. `install_help_menu` takes one for exactly this
236
+ reason.
237
+ """
134
238
 
135
239
  def __init__(self, parent=None):
136
240
  super().__init__(parent)
@@ -139,6 +243,7 @@ class LauncherWindow(QWidget):
139
243
  layout = QVBoxLayout(self)
140
244
  layout.setContentsMargins(28, 24, 28, 24)
141
245
  layout.setSpacing(18)
246
+ layout.setMenuBar(self._build_menu())
142
247
 
143
248
  heading = QLabel("GratingLab")
144
249
  font = heading.font()
@@ -175,6 +280,30 @@ class LauncherWindow(QWidget):
175
280
 
176
281
  self.setMinimumWidth(460)
177
282
 
283
+ def _build_menu(self):
284
+ """View > Theme and Help, held on the instance and returned.
285
+
286
+ Held for the reason the windows hold theirs: under PySide6 a QMenu
287
+ reached back through the menu bar is not reliably usable, so whatever
288
+ builds one keeps it. Returned because the caller has to hand the bar
289
+ to the layout, which is how a QWidget gets a menu bar at all.
290
+ """
291
+ from .help_menu import install_help_menu
292
+
293
+ # Install the manager here as well as in `gui.launcher.main`, for the
294
+ # same reason the efficiency window does: a chooser built any other
295
+ # way -- a test, an embedding, a future entry point -- would otherwise
296
+ # show a Theme menu that silently did nothing. It is idempotent, so
297
+ # the normal path still installs exactly one.
298
+ self._themes = theming.install(QApplication.instance())
299
+
300
+ self._menu_bar = QMenuBar(self)
301
+ self._view_menu = self._menu_bar.addMenu("&View")
302
+ self._theme_menu = theming.ThemeMenu(self)
303
+ self._view_menu.addMenu(self._theme_menu)
304
+ self._help_menu = install_help_menu(self, self._menu_bar)
305
+ return self._menu_bar
306
+
178
307
  def _card(self, chosen):
179
308
  """One mode: its button, and the sentence saying what it is for."""
180
309
  frame = QFrame()
@@ -33,13 +33,11 @@ from PySide6.QtGui import QKeySequence
33
33
  from PySide6.QtWidgets import (
34
34
  QDockWidget,
35
35
  QMainWindow,
36
- QMessageBox,
37
36
  QScrollArea,
38
37
  QTabWidget,
39
38
  QWidget,
40
39
  )
41
40
 
42
- from .. import provenance
43
41
  from ..state import FieldError, FormErrors, build, validate
44
42
  from . import theming
45
43
  from .cmethod_tab import CMethodTab
@@ -286,7 +284,10 @@ class MainWindow(QMainWindow):
286
284
  Help is the original menu and remains the main one. This is not a
287
285
  general-purpose application with File/Edit concerns, and the one thing
288
286
  that merits a menu is the explanation of the mathematics, which the
289
- window itself never gives.
287
+ window itself never gives. It is built by
288
+ :func:`gratinglab.gui.qt.help_menu.install_help_menu`, which the AFM
289
+ window and the chooser call too, so the pages are reachable from
290
+ wherever the user happens to be.
290
291
 
291
292
  View began with a single purpose and a single action, and now holds
292
293
  a second: the Theme submenu, which is about how the window looks and
@@ -301,8 +302,7 @@ class MainWindow(QMainWindow):
301
302
  synchronisation as soon as the user clicks the dock's own close
302
303
  button.
303
304
  """
304
- from ..docs import general_pages, theory_pages
305
- from ..richtext import menu_label
305
+ from .help_menu import install_help_menu
306
306
 
307
307
  # Both the bar and the menus are held on the instance rather than
308
308
  # merely added. Under PySide6 6.11 a QMenu reached back through
@@ -330,24 +330,7 @@ class MainWindow(QMainWindow):
330
330
  self._view_menu.addMenu(self._theme_menu)
331
331
  self._theme_actions = self._theme_menu._group
332
332
 
333
- menu = self._help_menu = self._menu_bar.addMenu("&Help")
334
- menu.addAction("About GratingLab", self.show_about)
335
- menu.addSeparator()
336
-
337
- # Foundational, solver-independent reference first -- the generalized
338
- # grating equation and the angle conventions -- then one page per
339
- # method.
340
- for page in general_pages():
341
- suffix = "" if page.available else " (not written yet)"
342
- menu.addAction(
343
- menu_label(page.title, suffix), lambda p=page: self.show_theory(p)
344
- )
345
- menu.addSeparator()
346
- for page in theory_pages():
347
- suffix = " Theory" + ("" if page.available else " (not written yet)")
348
- menu.addAction(
349
- menu_label(page.title, suffix), lambda p=page: self.show_theory(p)
350
- )
333
+ self._help_menu = install_help_menu(self, self._menu_bar)
351
334
 
352
335
  def set_theme(self, choice: str) -> None:
353
336
  """Switch theme by key, or ``"system"``; the menu calls this."""
@@ -645,17 +628,17 @@ class MainWindow(QMainWindow):
645
628
  tab.show_progress()
646
629
 
647
630
  def show_about(self) -> None:
648
- from ... import __version__
631
+ """The About box. The menu calls `help_menu.show_about` directly; this
632
+ stays as the window's own way in, which is what a test drives."""
633
+ from .help_menu import show_about
649
634
 
650
- QMessageBox.about(self, "About GratingLab", provenance.about_text(__version__))
635
+ show_about(self)
651
636
 
652
- def show_theory(self, page) -> None:
637
+ def show_theory(self, page):
653
638
  """Open the read-only viewer for one theory or reference page."""
654
- from .theory_viewer import TheoryViewer
639
+ from .help_menu import show_theory
655
640
 
656
- viewer = TheoryViewer(page, parent=self)
657
- viewer.show()
658
- return viewer
641
+ return show_theory(page, self)
659
642
 
660
643
  # -- shutdown --------------------------------------------------------
661
644
 
@@ -135,14 +135,25 @@ class MainWindow(QMainWindow):
135
135
  self.setStatusBar(self.status)
136
136
  self._set_status("Ready. Open an AFM file to begin.")
137
137
 
138
- # View > Theme, the same menu the efficiency window carries. Held on
139
- # the instance: a QMenu reached back through the menu bar is not
140
- # reliably alive under PySide6 (see the efficiency window's note).
138
+ # View > Theme and Help, the same two menus the efficiency window
139
+ # carries, built by the same code so neither window has to know the
140
+ # other exists. Help matters more here than the page count suggests:
141
+ # `docs/conventions.md` fixes the angle conventions a measured profile
142
+ # is reported in, and `docs/theory/metrology.md` is about this window's
143
+ # own analysis, yet until now this was the one window from which
144
+ # neither could be opened.
145
+ #
146
+ # Both menus are held on the instance: a QMenu reached back through the
147
+ # menu bar is not reliably alive under PySide6 (see the efficiency
148
+ # window's note).
149
+ from gratinglab.gui.qt.help_menu import install_help_menu
141
150
  from gratinglab.gui.qt.theming import ThemeMenu
142
151
 
143
- self._view_menu = self.menuBar().addMenu("&View")
152
+ self._menu_bar = self.menuBar()
153
+ self._view_menu = self._menu_bar.addMenu("&View")
144
154
  self._theme_menu = ThemeMenu(self)
145
155
  self._view_menu.addMenu(self._theme_menu)
156
+ self._help_menu = install_help_menu(self, self._menu_bar)
146
157
 
147
158
  def _build_analysis_group(self):
148
159
  group = QGroupBox("Analysis parameters")