gratinglab 0.3.11__tar.gz → 0.3.13__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 (231) hide show
  1. {gratinglab-0.3.11/src/gratinglab.egg-info → gratinglab-0.3.13}/PKG-INFO +19 -11
  2. {gratinglab-0.3.11 → gratinglab-0.3.13}/README.md +16 -8
  3. {gratinglab-0.3.11 → gratinglab-0.3.13}/pyproject.toml +3 -2
  4. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/__init__.py +1 -1
  5. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/app.py +23 -0
  6. gratinglab-0.3.13/src/gratinglab/gui/camera3d.py +209 -0
  7. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/diagram3d.py +12 -7
  8. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/launcher.py +16 -0
  9. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/cmethod_tab.py +12 -13
  10. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/compare_tab.py +12 -13
  11. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/geometry_panel.py +22 -0
  12. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/geometry_tab.py +5 -1
  13. gratinglab-0.3.13/src/gratinglab/gui/qt/geometry_window.py +193 -0
  14. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/integral_tab.py +12 -13
  15. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/main_window.py +14 -29
  16. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/profile_plot_panel.py +5 -1
  17. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/rcwa_tab.py +12 -13
  18. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/scalar_tab.py +19 -21
  19. gratinglab-0.3.13/src/gratinglab/gui/qt/scene3d_panel.py +537 -0
  20. {gratinglab-0.3.11 → gratinglab-0.3.13/src/gratinglab.egg-info}/PKG-INFO +19 -11
  21. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab.egg-info/SOURCES.txt +4 -0
  22. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab.egg-info/entry_points.txt +1 -0
  23. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab.egg-info/requires.txt +2 -2
  24. gratinglab-0.3.13/tests/test_gui_camera3d.py +147 -0
  25. gratinglab-0.3.13/tests/test_gui_geometry_window.py +151 -0
  26. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_help_menu.py +4 -2
  27. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_launcher.py +9 -7
  28. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_qt.py +128 -84
  29. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_theme.py +40 -0
  30. gratinglab-0.3.11/src/gratinglab/gui/qt/scene3d_panel.py +0 -406
  31. {gratinglab-0.3.11 → gratinglab-0.3.13}/LICENSE +0 -0
  32. {gratinglab-0.3.11 → gratinglab-0.3.13}/MANIFEST.in +0 -0
  33. {gratinglab-0.3.11 → gratinglab-0.3.13}/docs/conventions.md +0 -0
  34. {gratinglab-0.3.11 → gratinglab-0.3.13}/docs/theory/cmethod.md +0 -0
  35. {gratinglab-0.3.11 → gratinglab-0.3.13}/docs/theory/integral.md +0 -0
  36. {gratinglab-0.3.11 → gratinglab-0.3.13}/docs/theory/metrology.md +0 -0
  37. {gratinglab-0.3.11 → gratinglab-0.3.13}/docs/theory/rcwa.md +0 -0
  38. {gratinglab-0.3.11 → gratinglab-0.3.13}/docs/theory/scalar.md +0 -0
  39. {gratinglab-0.3.11 → gratinglab-0.3.13}/setup.cfg +0 -0
  40. {gratinglab-0.3.11 → gratinglab-0.3.13}/setup.py +0 -0
  41. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/checks.py +0 -0
  42. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/compare.py +0 -0
  43. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/convergence.py +0 -0
  44. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/geometry.py +0 -0
  45. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/__init__.py +0 -0
  46. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/cmethod_options.py +0 -0
  47. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/comparison.py +0 -0
  48. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/diagram.py +0 -0
  49. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/docs.py +0 -0
  50. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/efficiency_plot.py +0 -0
  51. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/failures.py +0 -0
  52. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/icon.py +0 -0
  53. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/integral_options.py +0 -0
  54. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/orders.py +0 -0
  55. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/provenance.py +0 -0
  56. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/__init__.py +0 -0
  57. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/help_menu.py +0 -0
  58. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/launcher.py +0 -0
  59. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/provenance_panel.py +0 -0
  60. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/recent.py +0 -0
  61. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/setup_tab.py +0 -0
  62. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/sizing.py +0 -0
  63. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/theming.py +0 -0
  64. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/theory_viewer.py +0 -0
  65. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/qt/worker.py +0 -0
  66. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/rcwa_options.py +0 -0
  67. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/richtext.py +0 -0
  68. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/scalar_options.py +0 -0
  69. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/state.py +0 -0
  70. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/gui/theme.py +0 -0
  71. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/illumination.py +0 -0
  72. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/io/__init__.py +0 -0
  73. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/io/boundary.py +0 -0
  74. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/io/efficiency_table.py +0 -0
  75. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/io/ggp.py +0 -0
  76. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/io/txl.py +0 -0
  77. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/materials/__init__.py +0 -0
  78. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/materials/data/SOURCES.md +0 -0
  79. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/materials/fresnel.py +0 -0
  80. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/materials/optical.py +0 -0
  81. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/materials/refractiveindex.py +0 -0
  82. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/materials/typical.py +0 -0
  83. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/measured.py +0 -0
  84. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/__init__.py +0 -0
  85. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/_analyzer_summary.py +0 -0
  86. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/analyzer.py +0 -0
  87. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/boundary/__init__.py +0 -0
  88. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/boundary/average.py +0 -0
  89. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/boundary/cross_section.py +0 -0
  90. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/boundary/pipeline.py +0 -0
  91. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/boundary/swaths.py +0 -0
  92. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/cli.py +0 -0
  93. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/config.py +0 -0
  94. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/__init__.py +0 -0
  95. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/analysis.py +0 -0
  96. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/image_flatten.py +0 -0
  97. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/orientation.py +0 -0
  98. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/processing.py +0 -0
  99. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/region_mask.py +0 -0
  100. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/scars.py +0 -0
  101. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/core/tip.py +0 -0
  102. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/data/__init__.py +0 -0
  103. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/data/aggregation.py +0 -0
  104. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/__init__.py +0 -0
  105. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/icon.py +0 -0
  106. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/__init__.py +0 -0
  107. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/app.py +0 -0
  108. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/boundary_view.py +0 -0
  109. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/canvas.py +0 -0
  110. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/efficiency_dialog.py +0 -0
  111. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/import_view.py +0 -0
  112. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/layout.py +0 -0
  113. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/main_window.py +0 -0
  114. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/swath_dialog.py +0 -0
  115. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/wiki_view.py +0 -0
  116. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/qt/worker.py +0 -0
  117. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/gui/state.py +0 -0
  118. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/io/__init__.py +0 -0
  119. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/io/file_io.py +0 -0
  120. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/io/ibw.py +0 -0
  121. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/io/metrics.py +0 -0
  122. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/io/sem.py +0 -0
  123. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/io/spm.py +0 -0
  124. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/settings.py +0 -0
  125. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/stats/__init__.py +0 -0
  126. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/stats/analysis.py +0 -0
  127. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/stats/icc.py +0 -0
  128. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/visualization/__init__.py +0 -0
  129. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/visualization/diagnostics.py +0 -0
  130. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/visualization/profiles.py +0 -0
  131. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/visualization/statistics.py +0 -0
  132. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/__init__.py +0 -0
  133. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/facet-fitting.md +0 -0
  134. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/file-formats.md +0 -0
  135. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/flattening.md +0 -0
  136. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/groove-orientation.md +0 -0
  137. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/icc-correction.md +0 -0
  138. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/overview.md +0 -0
  139. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/reading-outputs.md +0 -0
  140. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/row-groups.md +0 -0
  141. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/scars-and-masking.md +0 -0
  142. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/swath-statistics.md +0 -0
  143. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/wiki/tip-correction.md +0 -0
  144. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/metrology/workflows.py +0 -0
  145. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/problem.py +0 -0
  146. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/profiles/__init__.py +0 -0
  147. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/profiles/_base.py +0 -0
  148. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/profiles/_polyline.py +0 -0
  149. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/profiles/_shapes.py +0 -0
  150. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/profiles/_trapezoid.py +0 -0
  151. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/profiles/_types.py +0 -0
  152. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/resolution.py +0 -0
  153. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/result.py +0 -0
  154. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/__init__.py +0 -0
  155. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/_conditioning.py +0 -0
  156. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/_execution.py +0 -0
  157. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/_scalar_groove.py +0 -0
  158. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/base.py +0 -0
  159. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/cmethod/__init__.py +0 -0
  160. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/cmethod/_core.py +0 -0
  161. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/cmethod/_series.py +0 -0
  162. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/integral/__init__.py +0 -0
  163. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/integral/_boundary.py +0 -0
  164. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/integral/_core.py +0 -0
  165. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/integral/_finite.py +0 -0
  166. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/integral/_greens.py +0 -0
  167. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/integral/_kernels.py +0 -0
  168. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/integral/_nystrom.py +0 -0
  169. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/rcwa/__init__.py +0 -0
  170. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/rcwa/_core.py +0 -0
  171. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/rcwa/_stack.py +0 -0
  172. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab/solvers/scalar.py +0 -0
  173. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab.egg-info/dependency_links.txt +0 -0
  174. {gratinglab-0.3.11 → gratinglab-0.3.13}/src/gratinglab.egg-info/top_level.txt +0 -0
  175. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_changelog.py +0 -0
  176. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_checks.py +0 -0
  177. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_cmethod.py +0 -0
  178. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_compare.py +0 -0
  179. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_conditioning.py +0 -0
  180. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_convergence.py +0 -0
  181. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_cross_method.py +0 -0
  182. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_efficiency_table.py +0 -0
  183. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_four_way.py +0 -0
  184. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_fresnel.py +0 -0
  185. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_geometry.py +0 -0
  186. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_ggp.py +0 -0
  187. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_cmethod_options.py +0 -0
  188. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_cmethod_tab.py +0 -0
  189. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_compare_tab.py +0 -0
  190. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_diagram.py +0 -0
  191. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_diagram3d.py +0 -0
  192. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_docs.py +0 -0
  193. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_integral_options.py +0 -0
  194. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_mathtext.py +0 -0
  195. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_orders.py +0 -0
  196. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_polish.py +0 -0
  197. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_provenance.py +0 -0
  198. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_provenance_panel.py +0 -0
  199. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_rcwa_options.py +0 -0
  200. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_richtext.py +0 -0
  201. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_scalar_options.py +0 -0
  202. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_gui_state.py +0 -0
  203. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_illumination.py +0 -0
  204. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_core.py +0 -0
  205. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_corpus.py +0 -0
  206. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_finite.py +0 -0
  207. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_graded.py +0 -0
  208. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_greens.py +0 -0
  209. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_kernels.py +0 -0
  210. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_measured_polygon.py +0 -0
  211. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_operators.py +0 -0
  212. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_integral_solver.py +0 -0
  213. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_io_boundary.py +0 -0
  214. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_littrow.py +0 -0
  215. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_materials.py +0 -0
  216. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_measured.py +0 -0
  217. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_perturbation.py +0 -0
  218. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_profiles.py +0 -0
  219. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_rayleigh_anomaly.py +0 -0
  220. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_rcwa.py +0 -0
  221. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_rcwa_benchmarks.py +0 -0
  222. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_refractiveindex.py +0 -0
  223. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_resolution.py +0 -0
  224. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_result.py +0 -0
  225. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_scalar.py +0 -0
  226. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_solver_conformance.py +0 -0
  227. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_solver_execution.py +0 -0
  228. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_solver_progress.py +0 -0
  229. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_trapezoidal_solvers.py +0 -0
  230. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_txl.py +0 -0
  231. {gratinglab-0.3.11 → gratinglab-0.3.13}/tests/test_typical.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gratinglab
3
- Version: 0.3.11
3
+ Version: 0.3.13
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
@@ -21,7 +21,7 @@ License-File: LICENSE
21
21
  Requires-Dist: numpy>=1.26
22
22
  Requires-Dist: scipy>=1.11
23
23
  Requires-Dist: pydantic>=2.6
24
- Requires-Dist: endstation>=0.5.1
24
+ Requires-Dist: endstation>=0.7.1
25
25
  Requires-Dist: threadpoolctl>=3.1
26
26
  Provides-Extra: dev
27
27
  Requires-Dist: pytest>=9.2; extra == "dev"
@@ -33,7 +33,7 @@ Provides-Extra: gui
33
33
  Requires-Dist: matplotlib>=3.8; extra == "gui"
34
34
  Requires-Dist: PySide6-Essentials!=6.12.0,>=6.7; python_version < "3.12" and extra == "gui"
35
35
  Requires-Dist: PySide6-Essentials>=6.7; python_version >= "3.12" and extra == "gui"
36
- Requires-Dist: endstation[qt]>=0.5.1; extra == "gui"
36
+ Requires-Dist: endstation[qt]>=0.7.1; extra == "gui"
37
37
  Provides-Extra: metrology
38
38
  Requires-Dist: matplotlib>=3.9; extra == "metrology"
39
39
  Provides-Extra: refractiveindex
@@ -306,21 +306,28 @@ pipeline recovers the period and blaze angle used to generate it.
306
306
 
307
307
  ```bash
308
308
  .venv/bin/python -m pip install -e ".[gui,metrology]"
309
- gratinglab-app # the chooser: one place to start, both windows
309
+ gratinglab-app # the chooser: one place to start, every window
310
310
  gratinglab-gui # straight to geometry, solvers, comparison
311
+ gratinglab-geometry # straight to the geometry, with no solver
311
312
  gratinglab-metrology-gui # straight to AFM import, blaze angles, boundary profiles
312
313
  ```
313
314
 
314
- `gratinglab-app` opens a chooser for the two windows. Each window has a **Go** menu
315
- that switches to the other window or back to the chooser (`Ctrl+Shift+M`), and
315
+ `gratinglab-app` opens a chooser for the three windows. Each window has a **Go** menu
316
+ that switches to another window or back to the chooser (`Ctrl+Shift+M`), and
316
317
  switching reuses a window that is already open. The chooser has the same
317
318
  **View → Theme** and **Help** menus as the windows, so the theme, which applies to the
318
319
  whole application, and the theory pages can be reached without opening a window
319
320
  first. While the chooser is on screen it imports both windows on a background thread,
320
321
  so the first window opens in about a fifth of a second; the matplotlib and scipy
321
- imports otherwise take several seconds. `gratinglab-gui` and
322
+ imports otherwise take several seconds. `gratinglab-gui`, `gratinglab-geometry` and
322
323
  `gratinglab-metrology-gui` open one window directly.
323
324
 
325
+ The geometry window (**Explore a geometry**) is the efficiency window's geometry form
326
+ and Grating Geometry tab on their own: the 3D view, the cross-section and the sin β
327
+ ladder, redrawn as the form changes, with no solver. **Send to efficiency window**
328
+ (`Ctrl+E`) copies its form into the efficiency window, opening it if need be, and
329
+ solves nothing; the efficiency window keeps its own Grating Geometry tab.
330
+
324
331
  The windows are built with Qt (PySide6), so `pip install "gratinglab[gui]"` needs no
325
332
  system toolkit to be installed first. PySide6 is licensed under the LGPLv3 and is an
326
333
  optional, dynamically linked extra, so this package remains under the BSD-3 licence.
@@ -331,10 +338,11 @@ hides it), and the window has one tab for each task:
331
338
  - **Grating Geometry:** a rotatable 3D view of the diffraction cone, in which every wave
332
339
  vector is drawn as an exact unit vector. In the reference off-plane geometry the
333
340
  orders separate in azimuth rather than in polar angle (93.8° of azimuthal spread at
334
- 0.0° of polar spread), so the view looking down the cone axis, combined with a uniform
335
- 27× zoom, makes them distinguishable at true scale. The grazing angle γ is not
336
- exaggerated: a uniform zoom preserves every angle in the view, and the magnification
337
- is stated on the canvas. Alongside it are the cross-section in the dispersion plane, a
341
+ 0.0° of polar spread), so the view looking down the cone axis, zoomed to the cone rim,
342
+ makes them distinguishable at true scale. The grazing angle γ is not exaggerated: the
343
+ view is orthographic and every zoom, pan and roll is uniform, so every angle in it
344
+ stays true, and the magnification is stated beside it. Drag to orbit, Shift+drag to
345
+ pan, Alt+drag to roll, and the wheel zooms about the cursor. Alongside it are the cross-section in the dispersion plane, a
338
346
  `sin β` diagram that includes the evanescent orders, and the groove profile. The view
339
347
  updates as values are typed.
340
348
  - **Scalar (Kirchhoff):** the scalar solution, the efficiency of each order with
@@ -262,21 +262,28 @@ pipeline recovers the period and blaze angle used to generate it.
262
262
 
263
263
  ```bash
264
264
  .venv/bin/python -m pip install -e ".[gui,metrology]"
265
- gratinglab-app # the chooser: one place to start, both windows
265
+ gratinglab-app # the chooser: one place to start, every window
266
266
  gratinglab-gui # straight to geometry, solvers, comparison
267
+ gratinglab-geometry # straight to the geometry, with no solver
267
268
  gratinglab-metrology-gui # straight to AFM import, blaze angles, boundary profiles
268
269
  ```
269
270
 
270
- `gratinglab-app` opens a chooser for the two windows. Each window has a **Go** menu
271
- that switches to the other window or back to the chooser (`Ctrl+Shift+M`), and
271
+ `gratinglab-app` opens a chooser for the three windows. Each window has a **Go** menu
272
+ that switches to another window or back to the chooser (`Ctrl+Shift+M`), and
272
273
  switching reuses a window that is already open. The chooser has the same
273
274
  **View → Theme** and **Help** menus as the windows, so the theme, which applies to the
274
275
  whole application, and the theory pages can be reached without opening a window
275
276
  first. While the chooser is on screen it imports both windows on a background thread,
276
277
  so the first window opens in about a fifth of a second; the matplotlib and scipy
277
- imports otherwise take several seconds. `gratinglab-gui` and
278
+ imports otherwise take several seconds. `gratinglab-gui`, `gratinglab-geometry` and
278
279
  `gratinglab-metrology-gui` open one window directly.
279
280
 
281
+ The geometry window (**Explore a geometry**) is the efficiency window's geometry form
282
+ and Grating Geometry tab on their own: the 3D view, the cross-section and the sin β
283
+ ladder, redrawn as the form changes, with no solver. **Send to efficiency window**
284
+ (`Ctrl+E`) copies its form into the efficiency window, opening it if need be, and
285
+ solves nothing; the efficiency window keeps its own Grating Geometry tab.
286
+
280
287
  The windows are built with Qt (PySide6), so `pip install "gratinglab[gui]"` needs no
281
288
  system toolkit to be installed first. PySide6 is licensed under the LGPLv3 and is an
282
289
  optional, dynamically linked extra, so this package remains under the BSD-3 licence.
@@ -287,10 +294,11 @@ hides it), and the window has one tab for each task:
287
294
  - **Grating Geometry:** a rotatable 3D view of the diffraction cone, in which every wave
288
295
  vector is drawn as an exact unit vector. In the reference off-plane geometry the
289
296
  orders separate in azimuth rather than in polar angle (93.8° of azimuthal spread at
290
- 0.0° of polar spread), so the view looking down the cone axis, combined with a uniform
291
- 27× zoom, makes them distinguishable at true scale. The grazing angle γ is not
292
- exaggerated: a uniform zoom preserves every angle in the view, and the magnification
293
- is stated on the canvas. Alongside it are the cross-section in the dispersion plane, a
297
+ 0.0° of polar spread), so the view looking down the cone axis, zoomed to the cone rim,
298
+ makes them distinguishable at true scale. The grazing angle γ is not exaggerated: the
299
+ view is orthographic and every zoom, pan and roll is uniform, so every angle in it
300
+ stays true, and the magnification is stated beside it. Drag to orbit, Shift+drag to
301
+ pan, Alt+drag to roll, and the wheel zooms about the cursor. Alongside it are the cross-section in the dispersion plane, a
294
302
  `sin β` diagram that includes the evanescent orders, and the groove profile. The view
295
303
  updates as values are typed.
296
304
  - **Scalar (Kirchhoff):** the scalar solution, the efficiency of each order with
@@ -54,7 +54,7 @@ dependencies = [
54
54
  # `dependencies = []` and has a test that fails if that stops being true,
55
55
  # so this line adds no transitive weight -- the Qt and matplotlib parts sit
56
56
  # behind its own extras, which our `gui` extra asks for by name.
57
- "endstation>=0.5.1",
57
+ "endstation>=0.7.1",
58
58
  # The rigorous solvers cap BLAS threads for the length of a solve
59
59
  # (solvers/_execution.py): OpenBLAS's thread-per-core default made RCWA
60
60
  # up to 135x slower on a busy machine, measured in benchmarks/
@@ -101,7 +101,7 @@ gui = [
101
101
  "matplotlib>=3.8",
102
102
  "PySide6-Essentials>=6.7,!=6.12.0; python_version < '3.12'",
103
103
  "PySide6-Essentials>=6.7; python_version >= '3.12'",
104
- "endstation[qt]>=0.5.1",
104
+ "endstation[qt]>=0.7.1",
105
105
  ]
106
106
  # Groove metrology: reading AFM scans and averaging them into a boundary
107
107
  # profile. An extra for the same reason the GUI is one -- `pip install
@@ -129,6 +129,7 @@ mut = ["mutmut>=3.2,<3.3"]
129
129
  # unchanged, for a shortcut or a habit.
130
130
  gratinglab-app = "gratinglab.gui.launcher:main"
131
131
  gratinglab-gui = "gratinglab.gui.app:main"
132
+ gratinglab-geometry = "gratinglab.gui.app:geometry_main"
132
133
  gratinglab-metrology-gui = "gratinglab.metrology.gui:main"
133
134
  # The metrology CLI, carried over unchanged. It still takes no arguments and
134
135
  # dispatches on `config.ANALYSIS_MODE`; reconciling that with the rest of the
@@ -22,7 +22,7 @@ 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.11"
25
+ __version__ = "0.3.13"
26
26
 
27
27
  #: The day this version was released, ISO 8601. It sits beside the version
28
28
  #: rather than being read from CHANGELOG.md at run time because the changelog
@@ -72,5 +72,28 @@ def main() -> int:
72
72
  return app.exec()
73
73
 
74
74
 
75
+ def geometry_main() -> int:
76
+ """Console-script entry point for ``gratinglab-geometry``.
77
+
78
+ The geometry window alone. Its "Send to efficiency window" opens the
79
+ efficiency window in the same process when it is used.
80
+ """
81
+ QApplication = _require_qt()
82
+ from .qt.geometry_window import GeometryWindow
83
+ from .qt.launcher import open_window
84
+ from .launcher import mode
85
+
86
+ app = QApplication(sys.argv)
87
+ from .qt.theming import install
88
+
89
+ install(app)
90
+ # Through the launcher, so the window gets its Go menu and is the one
91
+ # the efficiency window's Go menu finds, as from the chooser.
92
+ window = open_window(mode("geometry"))
93
+ assert isinstance(window, GeometryWindow)
94
+ _bring_to_front(window)
95
+ return app.exec()
96
+
97
+
75
98
  if __name__ == "__main__": # pragma: no cover
76
99
  sys.exit(main())
@@ -0,0 +1,209 @@
1
+ r"""The camera for the painted 3D view, without a GUI toolkit.
2
+
3
+ :mod:`gratinglab.gui.diagram3d` decides what is in the scene; this module
4
+ decides only where it lands on the screen; :mod:`gratinglab.gui.qt.scene3d_panel`
5
+ paints it. Nothing here reads physics: the one geometric input is the cone's
6
+ half-angle, which places the rim the view can zoom to.
7
+
8
+ The projection is **orthographic**, and every change of framing is a uniform
9
+ scale plus a translation (a similarity transform), so every angle in the
10
+ picture is the true angle in the plane of the screen at any zoom. That is
11
+ the property the matplotlib view protected by refusing to zoom at all; with
12
+ its own camera the view can zoom and keep it.
13
+
14
+ Frames and names
15
+ ================
16
+
17
+ The world is the physical :math:`(\hat{d}, \hat{n}, -\hat{g})` frame of
18
+ ``conventions.md`` §3: x across the grooves, y the grating normal, z along the
19
+ cone axis. No permutation is needed, because this camera keeps y up by
20
+ choosing its own basis, unlike `Axes3D`, which always draws its z upward.
21
+
22
+ - ``yaw``, ``pitch``: the orbit, in degrees. The eye sits at
23
+ :math:`(\sin y \cos p,\ \sin p,\ \cos y \cos p)` and looks at the origin.
24
+ - ``roll``: the viewer's twist about the line of sight, in degrees. It moves
25
+ nothing physical and is what lets the fan of orders lie level on screen.
26
+ - ``zoom``, ``pan``: the user's free transform on top of the fitted frame.
27
+ - ``rim``: 0 frames the whole scene, 1 frames the cone rim, and the scale
28
+ between them goes as ``magnification ** rim`` so the slider feels even.
29
+
30
+ Called by the panel on every paint; the tests drive it directly.
31
+ """
32
+
33
+ from __future__ import annotations
34
+
35
+ from dataclasses import dataclass, replace
36
+
37
+ import numpy as np
38
+ from numpy.typing import NDArray
39
+
40
+ __all__ = [
41
+ "PITCH_LIMIT",
42
+ "MIN_ZOOM",
43
+ "MAX_ZOOM",
44
+ "RIM_FILL",
45
+ "Camera",
46
+ "Frame",
47
+ "basis",
48
+ "orbit_for",
49
+ "fit",
50
+ "project",
51
+ "zoom_about",
52
+ ]
53
+
54
+ #: The orbit stops short of the poles, where "up" stops being defined. 89.5°
55
+ #: is close enough that the face-on preset reads as face-on.
56
+ PITCH_LIMIT = 89.5
57
+ #: The user's zoom, as a multiple of the fitted frame.
58
+ MIN_ZOOM, MAX_ZOOM = 0.3, 60.0
59
+ #: The rim circle's diameter as a fraction of the frame's short side, at full
60
+ #: rim focus. The app uses the same 0.62, so the two products frame alike.
61
+ RIM_FILL = 0.62
62
+
63
+
64
+ @dataclass(frozen=True, slots=True)
65
+ class Camera:
66
+ """Where the viewer is. Immutable: every gesture returns a new one."""
67
+
68
+ yaw: float = 26.6
69
+ pitch: float = 20.4
70
+ roll: float = 0.0
71
+ zoom: float = 1.0
72
+ pan: tuple[float, float] = (0.0, 0.0)
73
+ rim: float = 0.0
74
+
75
+ def orbited(self, dyaw: float, dpitch: float) -> "Camera":
76
+ pitch = float(np.clip(self.pitch + dpitch, -PITCH_LIMIT, PITCH_LIMIT))
77
+ return replace(self, yaw=(self.yaw + dyaw) % 360.0, pitch=pitch)
78
+
79
+ def rolled(self, droll: float) -> "Camera":
80
+ return replace(self, roll=(self.roll + droll) % 360.0)
81
+
82
+ def panned(self, dx: float, dy: float) -> "Camera":
83
+ return replace(self, pan=(self.pan[0] + dx, self.pan[1] + dy))
84
+
85
+ def recentred(self) -> "Camera":
86
+ """Clear the free transform. The orbit and the rim slider stay, as in
87
+ the app: Recentre undoes a wander, not a choice of view."""
88
+ return replace(self, roll=0.0, zoom=1.0, pan=(0.0, 0.0))
89
+
90
+
91
+ @dataclass(frozen=True, slots=True)
92
+ class Frame:
93
+ """One frame's mapping from world to screen pixels."""
94
+
95
+ right: NDArray[np.float64]
96
+ up: NDArray[np.float64]
97
+ fwd: NDArray[np.float64]
98
+ #: Screen point that world (offset) lands on, in pixels.
99
+ centre: tuple[float, float]
100
+ #: World-plane offset applied before scaling: the fit and the rim focus.
101
+ offset: tuple[float, float]
102
+ #: Pixels per world unit.
103
+ scale: float
104
+ #: Pixels per world unit for the fitted frame alone.
105
+ fit_scale: float
106
+ #: Whether zooming to the rim magnifies enough to be worth offering.
107
+ rim_usable: bool
108
+
109
+ @property
110
+ def magnification(self) -> float:
111
+ """How much closer than the fitted frame this is."""
112
+ return self.scale / self.fit_scale
113
+
114
+
115
+ def basis(yaw: float, pitch: float, roll: float = 0.0):
116
+ """``(right, up, fwd)`` for an orbit, as unit world vectors."""
117
+ y, p = np.radians(yaw), np.radians(np.clip(pitch, -PITCH_LIMIT, PITCH_LIMIT))
118
+ eye = np.array([np.sin(y) * np.cos(p), np.sin(p), np.cos(y) * np.cos(p)])
119
+ fwd = -eye
120
+ right = np.cross(fwd, [0.0, 1.0, 0.0])
121
+ right /= np.linalg.norm(right)
122
+ up = np.cross(right, fwd)
123
+ if roll:
124
+ c, s = np.cos(np.radians(roll)), np.sin(np.radians(roll))
125
+ right, up = right * c + up * s, up * c - right * s
126
+ return right, up, fwd
127
+
128
+
129
+ def orbit_for(direction) -> tuple[float, float]:
130
+ """``(yaw, pitch)`` that looks along a world ``direction``.
131
+
132
+ The inverse of :func:`basis`'s ``fwd``, so a preset that names a physical
133
+ direction is the direction the camera ends up looking along."""
134
+ eye = -np.asarray(direction, dtype=float)
135
+ eye /= np.linalg.norm(eye)
136
+ pitch = float(np.degrees(np.arcsin(np.clip(eye[1], -1.0, 1.0))))
137
+ yaw = float(np.degrees(np.arctan2(eye[0], eye[2])))
138
+ return yaw % 360.0, float(np.clip(pitch, -PITCH_LIMIT, PITCH_LIMIT))
139
+
140
+
141
+ def fit(
142
+ camera: Camera,
143
+ points,
144
+ gamma: float,
145
+ rect: tuple[float, float, float, float],
146
+ *,
147
+ pad: float = 30.0,
148
+ rim_offered: bool = True,
149
+ ) -> Frame:
150
+ """Fit ``points`` into the pixel ``rect`` ``(x0, y0, x1, y1)``.
151
+
152
+ Fitted to the scene's own projected extent rather than to a fixed box:
153
+ the bundle is a long diagonal, not a ball, so a box leaves most of the
154
+ frame empty, which is what made the matplotlib view look small. ``pad``
155
+ is reserved in pixels for labels, which do not scale with the scene.
156
+ """
157
+ right, up, fwd = basis(camera.yaw, camera.pitch, camera.roll)
158
+ pts = np.atleast_2d(np.asarray(points, dtype=float))
159
+ sx, sy = pts @ right, pts @ up
160
+ half_x = max(1e-9, (sx.max() - sx.min()) / 2.0)
161
+ half_y = max(1e-9, (sy.max() - sy.min()) / 2.0)
162
+ x0, y0, x1, y1 = rect
163
+ vis_w, vis_h = max(x1 - x0, 80.0), max(y1 - y0, 80.0)
164
+ fit_scale = min((vis_w - 2 * pad) / (2 * half_x), (vis_h - 2 * pad) / (2 * half_y))
165
+ fit_scale = max(fit_scale, 1e-6)
166
+ fit_off = (-(sx.max() + sx.min()) / 2.0, -(sy.max() + sy.min()) / 2.0)
167
+
168
+ # The rim: a circle of radius sin(gamma) about (0, 0, cos(gamma)).
169
+ sg = float(np.sin(gamma))
170
+ rim_scale = RIM_FILL * min(vis_w, vis_h) / (2 * sg) if sg > 0 else np.inf
171
+ mag = rim_scale / fit_scale
172
+ usable = bool(rim_offered and np.isfinite(mag) and mag > 1.0)
173
+ t = float(np.clip(camera.rim, 0.0, 1.0)) if usable else 0.0
174
+ ease = 1.0 - (1.0 - t) ** 2 # the centre settles ahead of the zoom
175
+ rc = np.array([0.0, 0.0, float(np.cos(gamma))])
176
+ rim_off = (-float(rc @ right), -float(rc @ up))
177
+ offset = (
178
+ fit_off[0] + (rim_off[0] - fit_off[0]) * ease,
179
+ fit_off[1] + (rim_off[1] - fit_off[1]) * ease,
180
+ )
181
+ scale = fit_scale * (mag if usable else 1.0) ** t * camera.zoom
182
+ centre = ((x0 + x1) / 2.0 + camera.pan[0], (y0 + y1) / 2.0 + camera.pan[1])
183
+ return Frame(right, up, fwd, centre, offset, scale, fit_scale, usable)
184
+
185
+
186
+ def project(frame: Frame, points) -> tuple[NDArray[np.float64], NDArray[np.float64]]:
187
+ """World points ``(n, 3)`` to screen ``(n, 2)`` pixels and depth ``(n,)``.
188
+
189
+ Depth grows away from the viewer, so painting in decreasing depth puts
190
+ near things over far ones."""
191
+ pts = np.atleast_2d(np.asarray(points, dtype=float))
192
+ sx = (pts @ frame.right + frame.offset[0]) * frame.scale + frame.centre[0]
193
+ sy = frame.centre[1] - (pts @ frame.up + frame.offset[1]) * frame.scale
194
+ return np.column_stack([sx, sy]), pts @ frame.fwd
195
+
196
+
197
+ def zoom_about(camera: Camera, frame: Frame, factor: float, at: tuple[float, float]) -> Camera:
198
+ """Zoom by ``factor`` keeping the scene point under ``at`` where it is.
199
+
200
+ Clamp first, then pan by the factor actually applied: using the requested
201
+ one makes the scene slide out from under the cursor at the limits."""
202
+ zoom = float(np.clip(camera.zoom * factor, MIN_ZOOM, MAX_ZOOM))
203
+ k = zoom / camera.zoom
204
+ # screen = c0 + pan + v*scale, held fixed for the v under `at`.
205
+ c0 = (frame.centre[0] - camera.pan[0], frame.centre[1] - camera.pan[1])
206
+ pan = tuple(
207
+ a - c - (a - c - p) * k for a, c, p in zip(at, c0, camera.pan)
208
+ )
209
+ return replace(camera, zoom=zoom, pan=pan)
@@ -165,7 +165,9 @@ RIM_PRESET = "Down the cone axis"
165
165
  #: Mesh resolutions. Both surfaces are *ruled* -- the grating patch is the
166
166
  #: cross-section extruded along ẑ, and every generator of a cone is straight --
167
167
  #: so the second dimension is 2 and that is exact, not a sampling choice.
168
- _PATCH_NX = {"fine": 241, "coarse": 61}
168
+ #: The patch is sampled per PERIOD, so a vertex at an integer t lands on a
169
+ #: sample whatever the number of periods drawn.
170
+ _PATCH_PER_PERIOD = {"fine": 120, "coarse": 30}
169
171
  _CONE_NPHI = {"fine": 289, "coarse": 73}
170
172
 
171
173
 
@@ -213,7 +215,7 @@ class Ray3D:
213
215
 
214
216
  @dataclass(frozen=True, slots=True)
215
217
  class Surface3D:
216
- """A ruled surface, as ``(n, 2)`` meshgrid arrays for ``plot_surface``."""
218
+ """A ruled surface, as ``(n, 2)`` arrays: column 0 one rule's end, column 1 the other's."""
217
219
 
218
220
  x: NDArray[np.float64]
219
221
  y: NDArray[np.float64]
@@ -464,7 +466,10 @@ def captions3d(
464
466
 
465
467
  def _grating_patch(problem: "Problem", scale_nm: float, periods: int, lod: str):
466
468
  """The cross-section extruded along ẑ; it is ruled, so two rows are exact."""
467
- t = np.linspace(-periods, 0.0, _PATCH_NX[lod])
469
+ # Centred on the strike point, so the bundle leaves from the middle of
470
+ # the patch rather than its edge.
471
+ left = periods // 2
472
+ t = np.linspace(-left, periods - left, _PATCH_PER_PERIOD[lod] * periods + 1)
468
473
  strike = np.asarray(strike_point(problem))
469
474
  px = (x_nm(t, problem.period) - strike[0]) / scale_nm
470
475
  py = (np.asarray(problem.height_nm(t)) - strike[1]) / scale_nm
@@ -515,7 +520,7 @@ def build_scene(
515
520
  illumination: "Illumination",
516
521
  wavelength: float,
517
522
  *,
518
- periods: int = 2,
523
+ periods: int = 20,
519
524
  pad_orders: int = 2,
520
525
  ) -> Scene:
521
526
  """Build every primitive of one 3D drawing."""
@@ -564,9 +569,9 @@ def build_scene(
564
569
  Ray3D(
565
570
  origin, tuple(k), 1.0,
566
571
  "zero" if mark.order == 0 else "order",
567
- # 3D text cannot dodge its neighbours, and every order tip is
568
- # within 1.5 deg of the same point. Only m=0 is labelled here;
569
- # the ladder beside this view names them all.
572
+ # Only m=0 carries a name here. The painted view names the
573
+ # others from `order` and moves each label clear of the rest;
574
+ # the ladder beside it names them all too.
570
575
  label=f"m={mark.order:+d}" if mark.order == 0 else None,
571
576
  order=mark.order,
572
577
  )
@@ -70,6 +70,8 @@ class Mode:
70
70
 
71
71
 
72
72
  #: The metrology window comes first because it is the half in regular use.
73
+ #: The geometry window sits between it and the efficiency window, in the
74
+ #: order the work goes.
73
75
  #: Adding a third window is one entry here and nothing else: the chooser's
74
76
  #: card and sentence, the Go menu and the Help submenu are all built from it.
75
77
  MODES = (
@@ -84,6 +86,20 @@ MODES = (
84
86
  summary="measure a grating's grooves from an AFM scan",
85
87
  help="gratinglab.gui.docs:wiki_help_groups",
86
88
  ),
89
+ # Between the two: a groove measured in the first is looked at here, and
90
+ # a geometry settled here is sent on to the third. No help of its own,
91
+ # since its tab is the efficiency window's and so are the pages.
92
+ Mode(
93
+ key="geometry",
94
+ title="Explore a geometry",
95
+ blurb="Turn a grating and its beams over in 3D, with the "
96
+ "cross-section and every order's sin β, without solving "
97
+ "anything. Send the geometry to the efficiency window when "
98
+ "it is settled.",
99
+ window="gratinglab.gui.qt.geometry_window:GeometryWindow",
100
+ script="gratinglab-geometry",
101
+ summary="look at its geometry",
102
+ ),
87
103
  Mode(
88
104
  key="efficiency",
89
105
  title="Compute efficiency",
@@ -22,6 +22,8 @@ from pathlib import Path
22
22
  from typing import Sequence
23
23
 
24
24
  from endstation.files import atomic_open
25
+ from endstation.qt.canvas import restyle_toolbar
26
+ from endstation.qt.progress_bar import DelayedProgressBar
25
27
  from PySide6.QtCore import Qt, Signal
26
28
  from PySide6.QtWidgets import (
27
29
  QAbstractItemView,
@@ -35,7 +37,6 @@ from PySide6.QtWidgets import (
35
37
  QListWidget,
36
38
  QListWidgetItem,
37
39
  QMessageBox,
38
- QProgressBar,
39
40
  QPushButton,
40
41
  QScrollArea,
41
42
  QSplitter,
@@ -203,9 +204,9 @@ class CMethodTab(QWidget):
203
204
  )
204
205
  self._converge_button.clicked.connect(self.convergence_requested)
205
206
 
206
- self._progress = QProgressBar()
207
- self._progress.setRange(0, 0)
208
- self._progress.hide()
207
+ # Hidden until a solve has run long enough to need it, indeterminate
208
+ # until the solver's first report: see endstation.qt.progress_bar.
209
+ self._progress = DelayedProgressBar()
209
210
 
210
211
  row = QHBoxLayout()
211
212
  row.addWidget(self._solve_button)
@@ -232,7 +233,8 @@ class CMethodTab(QWidget):
232
233
  panel = QWidget()
233
234
  layout = QVBoxLayout(panel)
234
235
  layout.setContentsMargins(0, 0, 0, 0)
235
- layout.addWidget(NavigationToolbar2QT(self._canvas, panel))
236
+ self._toolbar = NavigationToolbar2QT(self._canvas, panel)
237
+ layout.addWidget(self._toolbar)
236
238
  layout.addWidget(self._canvas)
237
239
  return panel
238
240
 
@@ -270,18 +272,13 @@ class CMethodTab(QWidget):
270
272
  # sweep untouched, so it stays live, like scalar's model selectors.
271
273
  self._fields["truncation"].setEnabled(not running)
272
274
  if not running:
273
- self._progress.hide()
274
-
275
- def show_progress(self) -> None:
276
- self._progress.show()
275
+ self._progress.end()
277
276
 
278
277
  def show_progress_value(self, done: int, total: int) -> None:
279
- if self._progress.maximum() != total:
280
- self._progress.setRange(0, total)
281
- self._progress.setValue(done)
278
+ self._progress.report(done, total)
282
279
 
283
280
  def show_solving(self, wavelength_count: int) -> None:
284
- self._progress.setRange(0, 0)
281
+ self._progress.begin()
285
282
  self._paint(provenance.solving_lines(self.name, wavelength_count))
286
283
 
287
284
  def show_result(self, scan, energy, lambda_over_period: float) -> None:
@@ -416,6 +413,8 @@ class CMethodTab(QWidget):
416
413
  )
417
414
 
418
415
  def _on_theme(self, theme) -> None:
416
+ # matplotlib colours a toolbar's icons only when it builds them.
417
+ restyle_toolbar(self._toolbar, theme)
419
418
  style_figure(self._figure, theme)
420
419
  if self._scan is not None:
421
420
  self._draw_efficiency(self._scan)
@@ -23,6 +23,8 @@ What is drawn, and what the panel says, is decided in
23
23
 
24
24
  from __future__ import annotations
25
25
 
26
+ from endstation.qt.canvas import restyle_toolbar
27
+ from endstation.qt.progress_bar import DelayedProgressBar
26
28
  from PySide6.QtCore import Qt, Signal
27
29
  from PySide6.QtWidgets import (
28
30
  QAbstractItemView,
@@ -34,7 +36,6 @@ from PySide6.QtWidgets import (
34
36
  QLabel,
35
37
  QListWidget,
36
38
  QListWidgetItem,
37
- QProgressBar,
38
39
  QPushButton,
39
40
  QScrollArea,
40
41
  QSplitter,
@@ -205,9 +206,9 @@ class CompareTab(QWidget):
205
206
  self._cancel_button.clicked.connect(self.cancel_requested)
206
207
  self._cancel_button.setEnabled(False)
207
208
 
208
- self._progress = QProgressBar()
209
- self._progress.setRange(0, 0)
210
- self._progress.hide()
209
+ # Hidden until a solve has run long enough to need it, indeterminate
210
+ # until the solver's first report: see endstation.qt.progress_bar.
211
+ self._progress = DelayedProgressBar()
211
212
 
212
213
  row = QHBoxLayout()
213
214
  row.addWidget(self._compare_button)
@@ -232,7 +233,8 @@ class CompareTab(QWidget):
232
233
  panel = QWidget()
233
234
  layout = QVBoxLayout(panel)
234
235
  layout.setContentsMargins(0, 0, 0, 0)
235
- layout.addWidget(NavigationToolbar2QT(self._canvas, panel))
236
+ self._toolbar = NavigationToolbar2QT(self._canvas, panel)
237
+ layout.addWidget(self._toolbar)
236
238
  layout.addWidget(self._canvas)
237
239
  return panel
238
240
 
@@ -281,20 +283,15 @@ class CompareTab(QWidget):
281
283
  for box in self._checks.values():
282
284
  box.setEnabled(not running)
283
285
  if not running:
284
- self._progress.hide()
285
-
286
- def show_progress(self) -> None:
287
- self._progress.show()
286
+ self._progress.end()
288
287
 
289
288
  def show_progress_value(self, done: int, total: int) -> None:
290
- if self._progress.maximum() != total:
291
- self._progress.setRange(0, total)
292
- self._progress.setValue(done)
289
+ self._progress.report(done, total)
293
290
 
294
291
  def show_solving(self, names, wavelength_count: int) -> None:
295
292
  from ..docs import short_title
296
293
 
297
- self._progress.setRange(0, 0)
294
+ self._progress.begin()
298
295
  self._paint((provenance.Line(
299
296
  f"comparing: {', '.join(short_title(n) for n in names)}, "
300
297
  f"{wavelength_count} wavelengths each…\n", "dim",
@@ -419,6 +416,8 @@ class CompareTab(QWidget):
419
416
  )
420
417
 
421
418
  def _on_theme(self, theme) -> None:
419
+ # matplotlib colours a toolbar's icons only when it builds them.
420
+ restyle_toolbar(self._toolbar, theme)
422
421
  style_figure(self._figure, theme)
423
422
  self._redraw()
424
423
  if self._lines:
@@ -292,6 +292,28 @@ class GeometryPanel(QWidget):
292
292
  def read_form(self) -> FormState:
293
293
  return FormState(**{k: _value(w) for k, w in self._fields.items()})
294
294
 
295
+ def write_form(self, form: FormState) -> None:
296
+ """Set every field from ``form``, as `read_form` would read it back.
297
+
298
+ The geometry window's "Send to efficiency window" calls this. It
299
+ emits `changed`, so the window redraws its geometry, and not
300
+ `solve_requested`: a geometry arriving from elsewhere is solved when
301
+ the user asks. A coating that is not installed here falls back to
302
+ "(none)", the same as `refresh_coatings` does.
303
+ """
304
+ for key, value in dataclasses.asdict(form).items():
305
+ widget = self._fields[key]
306
+ if isinstance(widget, QComboBox):
307
+ index = widget.findData(value)
308
+ if index < 0:
309
+ index = widget.findText(value)
310
+ widget.setCurrentIndex(max(index, 0))
311
+ else:
312
+ widget.setText(value)
313
+ path = form.profile_path
314
+ self._path_label.setText(Path(path).name if path else "")
315
+ self.changed.emit()
316
+
295
317
  def load_profile(self) -> None:
296
318
  path, _ = QFileDialog.getOpenFileName(
297
319
  self, "Load boundary profile", recent.start_in("profiles"),