gratinglab 0.3.13__tar.gz → 0.3.15__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 (230) hide show
  1. {gratinglab-0.3.13/src/gratinglab.egg-info → gratinglab-0.3.15}/PKG-INFO +6 -4
  2. {gratinglab-0.3.13 → gratinglab-0.3.15}/README.md +5 -3
  3. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/__init__.py +1 -1
  4. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/geometry_window.py +11 -0
  5. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/launcher.py +67 -62
  6. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/boundary_view.py +31 -11
  7. {gratinglab-0.3.13 → gratinglab-0.3.15/src/gratinglab.egg-info}/PKG-INFO +6 -4
  8. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_launcher.py +80 -37
  9. {gratinglab-0.3.13 → gratinglab-0.3.15}/LICENSE +0 -0
  10. {gratinglab-0.3.13 → gratinglab-0.3.15}/MANIFEST.in +0 -0
  11. {gratinglab-0.3.13 → gratinglab-0.3.15}/docs/conventions.md +0 -0
  12. {gratinglab-0.3.13 → gratinglab-0.3.15}/docs/theory/cmethod.md +0 -0
  13. {gratinglab-0.3.13 → gratinglab-0.3.15}/docs/theory/integral.md +0 -0
  14. {gratinglab-0.3.13 → gratinglab-0.3.15}/docs/theory/metrology.md +0 -0
  15. {gratinglab-0.3.13 → gratinglab-0.3.15}/docs/theory/rcwa.md +0 -0
  16. {gratinglab-0.3.13 → gratinglab-0.3.15}/docs/theory/scalar.md +0 -0
  17. {gratinglab-0.3.13 → gratinglab-0.3.15}/pyproject.toml +0 -0
  18. {gratinglab-0.3.13 → gratinglab-0.3.15}/setup.cfg +0 -0
  19. {gratinglab-0.3.13 → gratinglab-0.3.15}/setup.py +0 -0
  20. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/checks.py +0 -0
  21. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/compare.py +0 -0
  22. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/convergence.py +0 -0
  23. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/geometry.py +0 -0
  24. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/__init__.py +0 -0
  25. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/app.py +0 -0
  26. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/camera3d.py +0 -0
  27. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/cmethod_options.py +0 -0
  28. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/comparison.py +0 -0
  29. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/diagram.py +0 -0
  30. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/diagram3d.py +0 -0
  31. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/docs.py +0 -0
  32. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/efficiency_plot.py +0 -0
  33. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/failures.py +0 -0
  34. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/icon.py +0 -0
  35. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/integral_options.py +0 -0
  36. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/launcher.py +0 -0
  37. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/orders.py +0 -0
  38. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/provenance.py +0 -0
  39. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/__init__.py +0 -0
  40. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/cmethod_tab.py +0 -0
  41. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/compare_tab.py +0 -0
  42. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/geometry_panel.py +0 -0
  43. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/geometry_tab.py +0 -0
  44. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/help_menu.py +0 -0
  45. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/integral_tab.py +0 -0
  46. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/main_window.py +0 -0
  47. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/profile_plot_panel.py +0 -0
  48. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/provenance_panel.py +0 -0
  49. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/rcwa_tab.py +0 -0
  50. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/recent.py +0 -0
  51. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/scalar_tab.py +0 -0
  52. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/scene3d_panel.py +0 -0
  53. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/setup_tab.py +0 -0
  54. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/sizing.py +0 -0
  55. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/theming.py +0 -0
  56. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/theory_viewer.py +0 -0
  57. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/qt/worker.py +0 -0
  58. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/rcwa_options.py +0 -0
  59. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/richtext.py +0 -0
  60. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/scalar_options.py +0 -0
  61. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/state.py +0 -0
  62. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/gui/theme.py +0 -0
  63. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/illumination.py +0 -0
  64. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/io/__init__.py +0 -0
  65. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/io/boundary.py +0 -0
  66. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/io/efficiency_table.py +0 -0
  67. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/io/ggp.py +0 -0
  68. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/io/txl.py +0 -0
  69. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/materials/__init__.py +0 -0
  70. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/materials/data/SOURCES.md +0 -0
  71. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/materials/fresnel.py +0 -0
  72. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/materials/optical.py +0 -0
  73. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/materials/refractiveindex.py +0 -0
  74. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/materials/typical.py +0 -0
  75. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/measured.py +0 -0
  76. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/__init__.py +0 -0
  77. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/_analyzer_summary.py +0 -0
  78. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/analyzer.py +0 -0
  79. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/boundary/__init__.py +0 -0
  80. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/boundary/average.py +0 -0
  81. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/boundary/cross_section.py +0 -0
  82. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/boundary/pipeline.py +0 -0
  83. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/boundary/swaths.py +0 -0
  84. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/cli.py +0 -0
  85. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/config.py +0 -0
  86. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/__init__.py +0 -0
  87. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/analysis.py +0 -0
  88. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/image_flatten.py +0 -0
  89. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/orientation.py +0 -0
  90. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/processing.py +0 -0
  91. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/region_mask.py +0 -0
  92. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/scars.py +0 -0
  93. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/core/tip.py +0 -0
  94. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/data/__init__.py +0 -0
  95. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/data/aggregation.py +0 -0
  96. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/__init__.py +0 -0
  97. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/icon.py +0 -0
  98. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/__init__.py +0 -0
  99. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/app.py +0 -0
  100. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/canvas.py +0 -0
  101. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/efficiency_dialog.py +0 -0
  102. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/import_view.py +0 -0
  103. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/layout.py +0 -0
  104. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/main_window.py +0 -0
  105. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/swath_dialog.py +0 -0
  106. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/wiki_view.py +0 -0
  107. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/qt/worker.py +0 -0
  108. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/gui/state.py +0 -0
  109. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/io/__init__.py +0 -0
  110. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/io/file_io.py +0 -0
  111. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/io/ibw.py +0 -0
  112. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/io/metrics.py +0 -0
  113. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/io/sem.py +0 -0
  114. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/io/spm.py +0 -0
  115. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/settings.py +0 -0
  116. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/stats/__init__.py +0 -0
  117. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/stats/analysis.py +0 -0
  118. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/stats/icc.py +0 -0
  119. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/visualization/__init__.py +0 -0
  120. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/visualization/diagnostics.py +0 -0
  121. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/visualization/profiles.py +0 -0
  122. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/visualization/statistics.py +0 -0
  123. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/__init__.py +0 -0
  124. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/facet-fitting.md +0 -0
  125. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/file-formats.md +0 -0
  126. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/flattening.md +0 -0
  127. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/groove-orientation.md +0 -0
  128. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/icc-correction.md +0 -0
  129. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/overview.md +0 -0
  130. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/reading-outputs.md +0 -0
  131. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/row-groups.md +0 -0
  132. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/scars-and-masking.md +0 -0
  133. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/swath-statistics.md +0 -0
  134. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/wiki/tip-correction.md +0 -0
  135. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/metrology/workflows.py +0 -0
  136. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/problem.py +0 -0
  137. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/profiles/__init__.py +0 -0
  138. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/profiles/_base.py +0 -0
  139. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/profiles/_polyline.py +0 -0
  140. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/profiles/_shapes.py +0 -0
  141. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/profiles/_trapezoid.py +0 -0
  142. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/profiles/_types.py +0 -0
  143. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/resolution.py +0 -0
  144. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/result.py +0 -0
  145. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/__init__.py +0 -0
  146. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/_conditioning.py +0 -0
  147. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/_execution.py +0 -0
  148. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/_scalar_groove.py +0 -0
  149. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/base.py +0 -0
  150. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/cmethod/__init__.py +0 -0
  151. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/cmethod/_core.py +0 -0
  152. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/cmethod/_series.py +0 -0
  153. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/integral/__init__.py +0 -0
  154. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/integral/_boundary.py +0 -0
  155. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/integral/_core.py +0 -0
  156. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/integral/_finite.py +0 -0
  157. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/integral/_greens.py +0 -0
  158. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/integral/_kernels.py +0 -0
  159. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/integral/_nystrom.py +0 -0
  160. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/rcwa/__init__.py +0 -0
  161. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/rcwa/_core.py +0 -0
  162. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/rcwa/_stack.py +0 -0
  163. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab/solvers/scalar.py +0 -0
  164. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab.egg-info/SOURCES.txt +0 -0
  165. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab.egg-info/dependency_links.txt +0 -0
  166. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab.egg-info/entry_points.txt +0 -0
  167. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab.egg-info/requires.txt +0 -0
  168. {gratinglab-0.3.13 → gratinglab-0.3.15}/src/gratinglab.egg-info/top_level.txt +0 -0
  169. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_changelog.py +0 -0
  170. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_checks.py +0 -0
  171. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_cmethod.py +0 -0
  172. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_compare.py +0 -0
  173. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_conditioning.py +0 -0
  174. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_convergence.py +0 -0
  175. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_cross_method.py +0 -0
  176. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_efficiency_table.py +0 -0
  177. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_four_way.py +0 -0
  178. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_fresnel.py +0 -0
  179. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_geometry.py +0 -0
  180. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_ggp.py +0 -0
  181. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_camera3d.py +0 -0
  182. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_cmethod_options.py +0 -0
  183. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_cmethod_tab.py +0 -0
  184. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_compare_tab.py +0 -0
  185. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_diagram.py +0 -0
  186. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_diagram3d.py +0 -0
  187. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_docs.py +0 -0
  188. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_geometry_window.py +0 -0
  189. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_help_menu.py +0 -0
  190. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_integral_options.py +0 -0
  191. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_mathtext.py +0 -0
  192. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_orders.py +0 -0
  193. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_polish.py +0 -0
  194. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_provenance.py +0 -0
  195. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_provenance_panel.py +0 -0
  196. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_qt.py +0 -0
  197. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_rcwa_options.py +0 -0
  198. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_richtext.py +0 -0
  199. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_scalar_options.py +0 -0
  200. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_state.py +0 -0
  201. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_gui_theme.py +0 -0
  202. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_illumination.py +0 -0
  203. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_core.py +0 -0
  204. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_corpus.py +0 -0
  205. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_finite.py +0 -0
  206. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_graded.py +0 -0
  207. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_greens.py +0 -0
  208. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_kernels.py +0 -0
  209. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_measured_polygon.py +0 -0
  210. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_operators.py +0 -0
  211. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_integral_solver.py +0 -0
  212. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_io_boundary.py +0 -0
  213. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_littrow.py +0 -0
  214. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_materials.py +0 -0
  215. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_measured.py +0 -0
  216. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_perturbation.py +0 -0
  217. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_profiles.py +0 -0
  218. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_rayleigh_anomaly.py +0 -0
  219. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_rcwa.py +0 -0
  220. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_rcwa_benchmarks.py +0 -0
  221. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_refractiveindex.py +0 -0
  222. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_resolution.py +0 -0
  223. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_result.py +0 -0
  224. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_scalar.py +0 -0
  225. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_solver_conformance.py +0 -0
  226. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_solver_execution.py +0 -0
  227. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_solver_progress.py +0 -0
  228. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_trapezoidal_solvers.py +0 -0
  229. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_txl.py +0 -0
  230. {gratinglab-0.3.13 → gratinglab-0.3.15}/tests/test_typical.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gratinglab
3
- Version: 0.3.13
3
+ Version: 0.3.15
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
@@ -312,9 +312,11 @@ gratinglab-geometry # straight to the geometry, with no solver
312
312
  gratinglab-metrology-gui # straight to AFM import, blaze angles, boundary profiles
313
313
  ```
314
314
 
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
317
- switching reuses a window that is already open. The chooser has the same
315
+ `gratinglab-app` opens a chooser for the three windows, which stays open as the main
316
+ menu while you work, as Gwiddion's toolbox does; closing it closes every window. Each
317
+ window has a **Go** menu that switches to another window or back to the chooser
318
+ (`Ctrl+Shift+M`). There is one window of each kind, so opening one that is already
319
+ open brings it forward. The chooser has the same
318
320
  **View → Theme** and **Help** menus as the windows, so the theme, which applies to the
319
321
  whole application, and the theory pages can be reached without opening a window
320
322
  first. While the chooser is on screen it imports both windows on a background thread,
@@ -268,9 +268,11 @@ gratinglab-geometry # straight to the geometry, with no solver
268
268
  gratinglab-metrology-gui # straight to AFM import, blaze angles, boundary profiles
269
269
  ```
270
270
 
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
273
- switching reuses a window that is already open. The chooser has the same
271
+ `gratinglab-app` opens a chooser for the three windows, which stays open as the main
272
+ menu while you work, as Gwiddion's toolbox does; closing it closes every window. Each
273
+ window has a **Go** menu that switches to another window or back to the chooser
274
+ (`Ctrl+Shift+M`). There is one window of each kind, so opening one that is already
275
+ open brings it forward. The chooser has the same
274
276
  **View → Theme** and **Help** menus as the windows, so the theme, which applies to the
275
277
  whole application, and the theory pages can be reached without opening a window
276
278
  first. While the chooser is on screen it imports both windows on a background thread,
@@ -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.13"
25
+ __version__ = "0.3.15"
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
@@ -161,6 +161,17 @@ class GeometryWindow(QMainWindow):
161
161
  return
162
162
  self.geometry_tab.show_geometry(build(form))
163
163
 
164
+ def open_boundary(self, path) -> None:
165
+ """Load a boundary profile file as the grating, as if chosen by hand.
166
+
167
+ The metrology window's "Send to geometry window" calls this with a
168
+ gratinglab ``.json``, so the measured period arrives with the shape.
169
+ Loading it redraws, and nothing is solved, since nothing here can.
170
+ """
171
+ self.geometry.load_boundary_file(path)
172
+ if not self.geometry_dock.isVisible():
173
+ self.geometry_dock.show()
174
+
164
175
  def send_to_efficiency(self):
165
176
  """Copy this geometry into the efficiency window, and return that window.
166
177
 
@@ -6,10 +6,11 @@ window it opens (see :data:`_OPEN_WINDOWS`), and importing both windows off
6
6
  the GUI thread while the chooser is on screen (see :func:`prewarm`, which
7
7
  exists because the first open used to freeze the application).
8
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.
9
+ It also carries the View and Help menus the windows carry, built by the
10
+ same code. The chooser is the main menu: it stays open while the windows it
11
+ opened are up, as Gwiddion's toolbox does, and closing it closes them all.
12
+ There is one window per mode, so a second click on a card raises the window
13
+ already open rather than opening another.
13
14
  """
14
15
 
15
16
  from __future__ import annotations
@@ -25,8 +26,6 @@ from PySide6.QtCore import Qt
25
26
  from PySide6.QtGui import QKeySequence
26
27
  from PySide6.QtWidgets import (
27
28
  QApplication,
28
- QFrame,
29
- QHBoxLayout,
30
29
  QLabel,
31
30
  QMenuBar,
32
31
  QPushButton,
@@ -57,14 +56,21 @@ SWITCH_MENU_TITLE = "&Go"
57
56
  #:
58
57
  #: A top-level Qt window with no Python reference is garbage collected and
59
58
  #: vanishes a moment after it appears, which reads as "the button did nothing".
60
- #: The list cannot live on the chooser, because the chooser closes itself as
61
- #: soon as a window is up and would take the only reference with it.
59
+ #: The list is not on the chooser, because a window opened from a Go menu,
60
+ #: in a session started by a direct script, has no chooser to hold it.
62
61
  _OPEN_WINDOWS: list[QWidget] = []
63
62
 
64
63
 
64
+ #: The toolbox's width, and its buttons' height. Wide enough for the
65
+ #: sentence to wrap to three lines and the longest title to sit in its
66
+ #: button with room either side; a toolbox wider than this crowds the
67
+ #: windows it sits beside.
68
+ _TOOLBOX_WIDTH = 260
69
+ _BUTTON_HEIGHT = 34
70
+
65
71
  #: The chooser, kept so that "Main Menu" shows the same one rather than a
66
72
  #: second copy. Closing a window does not destroy it while a reference is
67
- #: held, so this one can be shown again after it closed itself.
73
+ #: held, so this one can be shown again after it was closed.
68
74
  _CHOOSER: list = []
69
75
 
70
76
  #: The background import started by :func:`prewarm`, at most one per process.
@@ -234,14 +240,19 @@ def _either(items):
234
240
 
235
241
 
236
242
  class LauncherWindow(QWidget):
237
- """Two buttons and a sentence each, so neither half can be missed.
243
+ """A compact toolbox: one sentence, and a button per window.
244
+
245
+ Kept small because it stays open beside the windows, as Gwiddion's
246
+ toolbox does. What each window is for, and the command that opens it
247
+ directly, are in its button's tooltip; the sentence names every window
248
+ in a line, so none of them, the AFM half least of all, can be missed.
238
249
 
239
- It carries the same View and Help menus the two windows do. The chooser
240
- is where a session starts and, after "Main Menu", where it pauses, so it
241
- was the one place from which the theme could not be changed and no page
242
- could be read -- both of which had to be done by opening a window first
243
- and then coming back. The theme in particular is a setting for the whole
244
- application, not for whichever window happens to be open.
250
+ It carries the same View and Help menus the windows do, since the theme
251
+ is a setting for the whole application and not for whichever window
252
+ happens to be open.
253
+
254
+ It is the main menu, and stays open while windows are: see `choose` and
255
+ `closeEvent`.
245
256
 
246
257
  A plain ``QWidget`` has no ``menuBar()``, so the bar is built here and put
247
258
  at the top of the layout. `install_help_menu` takes one for exactly this
@@ -253,42 +264,28 @@ class LauncherWindow(QWidget):
253
264
  self.setWindowTitle("gratinglab")
254
265
 
255
266
  layout = QVBoxLayout(self)
256
- layout.setContentsMargins(28, 24, 28, 24)
257
- layout.setSpacing(18)
267
+ layout.setContentsMargins(12, 8, 12, 12)
268
+ layout.setSpacing(6)
258
269
  layout.setMenuBar(self._build_menu())
259
270
 
260
- heading = QLabel("gratinglab")
261
- font = heading.font()
262
- font.setPointSize(font.pointSize() + 8)
263
- font.setBold(True)
264
- heading.setFont(font)
265
- layout.addWidget(heading)
266
-
267
271
  opening = _either([m.summary for m in MODES if m.summary])
268
272
  # Only the first letter: str.capitalize() would lower "AFM" too.
269
273
  subtitle = QLabel(opening[:1].upper() + opening[1:] + ".")
270
274
  subtitle.setWordWrap(True)
271
275
  subtitle.setStyleSheet("color: palette(mid);")
276
+ subtitle.setToolTip(
277
+ "The Go menu in each window switches to another window or back "
278
+ "to this one, and closing this one closes them all."
279
+ )
272
280
  layout.addWidget(subtitle)
281
+ layout.addSpacing(4)
273
282
 
274
283
  self.buttons = {}
275
284
  for chosen in MODES:
276
- layout.addWidget(self._card(chosen))
285
+ layout.addWidget(self._button(chosen))
277
286
 
278
287
  layout.addStretch(1)
279
-
280
- hint = QLabel(
281
- "The <b>Go</b> menu in each window switches to another window or "
282
- "back to this one. To open a window directly, run "
283
- + _either([f"<code>{m.script}</code>" for m in MODES])
284
- + "."
285
- )
286
- hint.setWordWrap(True)
287
- hint.setTextFormat(Qt.RichText)
288
- hint.setStyleSheet("color: palette(mid);")
289
- layout.addWidget(hint)
290
-
291
- self.setMinimumWidth(460)
288
+ self.setFixedWidth(_TOOLBOX_WIDTH)
292
289
 
293
290
  def _build_menu(self):
294
291
  """View > Theme and Help, held on the instance and returned.
@@ -314,36 +311,44 @@ class LauncherWindow(QWidget):
314
311
  self._help_menu = install_help_menu(self, self._menu_bar)
315
312
  return self._menu_bar
316
313
 
317
- def _card(self, chosen):
318
- """One mode: its button, and the sentence saying what it is for."""
319
- frame = QFrame()
320
- frame.setFrameShape(QFrame.StyledPanel)
321
- inner = QVBoxLayout(frame)
322
- inner.setContentsMargins(16, 14, 16, 14)
323
- inner.setSpacing(6)
324
-
325
- row = QHBoxLayout()
314
+ def _button(self, chosen):
315
+ """One mode's button, with what it is for and its command as a tooltip."""
326
316
  button = QPushButton(chosen.title)
327
317
  button.setDefault(chosen is MODES[0])
328
318
  button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
319
+ button.setMinimumHeight(_BUTTON_HEIGHT)
320
+ button.setToolTip(
321
+ f"<p>{chosen.blurb}</p>"
322
+ f"<p>To open it directly, run <code>{chosen.script}</code>.</p>"
323
+ )
329
324
  button.clicked.connect(partial(self.choose, chosen))
330
325
  button.setObjectName(f"mode-{chosen.key}")
331
- row.addWidget(button)
332
- inner.addLayout(row)
333
-
334
- blurb = QLabel(chosen.blurb)
335
- blurb.setWordWrap(True)
336
- inner.addWidget(blurb)
337
-
338
326
  self.buttons[chosen.key] = button
339
- return frame
327
+ return button
340
328
 
341
329
  def choose(self, chosen):
342
- """Open a mode's window, then close the chooser.
330
+ """Open a mode's window, or raise it if it is open, and stay open.
343
331
 
344
- In that order: Qt quits when the last window closes, so closing first
345
- would end the process before the window it was asked for exists.
332
+ The main menu stays up so it is where any window is reopened from,
333
+ as Gwiddion's toolbox is. A window covering it is brought back with
334
+ Go > Main Menu.
346
335
  """
347
- window = open_window(chosen)
348
- self.close()
349
- return window
336
+ return open_window(chosen)
337
+
338
+ def closeEvent(self, event): # noqa: N802 - Qt's spelling
339
+ """Closing the main menu closes every window it opened.
340
+
341
+ Each window gets its own close, so it saves its layout and stops a
342
+ job in flight as it would if closed by hand. A window that refuses
343
+ keeps the main menu open too, so the menu is never gone while a
344
+ window is still up. Nothing calls quit: once the last window is
345
+ closed, Qt's quit-on-last-window ends the application, which also
346
+ leaves a test's other widgets alone.
347
+ """
348
+ for window in list(_OPEN_WINDOWS):
349
+ if not shiboken6.isValid(window) or not window.isVisible():
350
+ continue
351
+ if not window.close():
352
+ event.ignore()
353
+ return
354
+ super().closeEvent(event)
@@ -163,6 +163,16 @@ class BoundaryView(QWidget):
163
163
  self.send_btn.clicked.connect(self.send_to_efficiency)
164
164
  layout.addWidget(self.send_btn)
165
165
 
166
+ # The same hand-over, to the window that draws the grating without
167
+ # solving: a look at the measured groove in 3D before any solve.
168
+ self.geometry_btn = QPushButton("Send to geometry window")
169
+ self.geometry_btn.setEnabled(False)
170
+ self.geometry_btn.setToolTip(
171
+ "Open this groove in the geometry window, with the period this\n"
172
+ "scan measured, to see it and its beams before solving anything.")
173
+ self.geometry_btn.clicked.connect(self.send_to_geometry)
174
+ layout.addWidget(self.geometry_btn)
175
+
166
176
  self.swaths_btn = QPushButton("Swath statistics…")
167
177
  self.swaths_btn.setEnabled(False)
168
178
  self.swaths_btn.setToolTip(
@@ -343,10 +353,11 @@ class BoundaryView(QWidget):
343
353
  self._show_placeholder(self._placeholder)
344
354
 
345
355
  def _set_actions_enabled(self, enabled: bool) -> None:
346
- """All four actions need only a profile, so they are enabled together."""
356
+ """Every action needs only a profile, so they are enabled together."""
347
357
  self.export_btn.setEnabled(enabled)
348
358
  self.efficiency_btn.setEnabled(enabled)
349
359
  self.send_btn.setEnabled(enabled)
360
+ self.geometry_btn.setEnabled(enabled)
350
361
  self.swaths_btn.setEnabled(enabled)
351
362
 
352
363
  # ── Out to a solver ──────────────────────────────────────────────────────
@@ -450,26 +461,35 @@ class BoundaryView(QWidget):
450
461
  return path, metrics_path
451
462
 
452
463
  def send_to_efficiency(self):
453
- """Open this groove in the main efficiency window, period included.
464
+ """Open this groove in the main efficiency window, period included."""
465
+ return self._send("efficiency", "Efficiency window")
466
+
467
+ def send_to_geometry(self):
468
+ """Open this groove in the geometry window, period included."""
469
+ return self._send("geometry", "Geometry window")
470
+
471
+ def _send(self, key, name):
472
+ """Hand this groove to the window a mode names, and return that window.
454
473
 
455
474
  The groove is written to a gratinglab .json in the temporary directory
456
- first, because the efficiency window's form takes a profile file. That
457
- also leaves the user a file the period travels with, should they want
458
- to keep it. The window is the one the Go menu opens
475
+ first, because both windows' forms take a profile file. That also
476
+ leaves the user a file the period travels with, should they want to
477
+ keep it. The window is the one the Go menu opens
459
478
  (:func:`gratinglab.gui.qt.launcher.open_window`), so sending and
460
- switching never leave two efficiency windows open.
479
+ switching never leave two of one window open. Both windows take the
480
+ file through ``open_boundary``.
461
481
  """
462
482
  if self._profile is None:
463
- return
483
+ return None
464
484
  try:
465
485
  from gratinglab.gui.launcher import mode
466
486
  from gratinglab.gui.qt.launcher import open_window
467
487
  except ImportError as exc:
468
488
  QMessageBox.warning(
469
- self, "Efficiency window unavailable",
470
- f"The efficiency window could not be loaded:\n{exc}\n\n"
489
+ self, f"{name} unavailable",
490
+ f"The {name.lower()} could not be loaded:\n{exc}\n\n"
471
491
  'It needs the gui extra: pip install "gratinglab[gui]"')
472
- return
492
+ return None
473
493
 
474
494
  import tempfile
475
495
 
@@ -478,6 +498,6 @@ class BoundaryView(QWidget):
478
498
  os.makedirs(folder, exist_ok=True)
479
499
  path, _ = self.write_profile(os.path.join(folder, f"{stem}_boundary.json"))
480
500
 
481
- window = open_window(mode("efficiency"))
501
+ window = open_window(mode(key))
482
502
  window.open_boundary(path)
483
503
  return window
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gratinglab
3
- Version: 0.3.13
3
+ Version: 0.3.15
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
@@ -312,9 +312,11 @@ gratinglab-geometry # straight to the geometry, with no solver
312
312
  gratinglab-metrology-gui # straight to AFM import, blaze angles, boundary profiles
313
313
  ```
314
314
 
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
317
- switching reuses a window that is already open. The chooser has the same
315
+ `gratinglab-app` opens a chooser for the three windows, which stays open as the main
316
+ menu while you work, as Gwiddion's toolbox does; closing it closes every window. Each
317
+ window has a **Go** menu that switches to another window or back to the chooser
318
+ (`Ctrl+Shift+M`). There is one window of each kind, so opening one that is already
319
+ open brings it forward. The chooser has the same
318
320
  **View → Theme** and **Help** menus as the windows, so the theme, which applies to the
319
321
  whole application, and the theory pages can be reached without opening a window
320
322
  first. While the chooser is on screen it imports both windows on a background thread,
@@ -96,6 +96,13 @@ from PySide6.QtWidgets import QLabel # noqa: E402
96
96
  from gratinglab.gui.qt import launcher as qt_launcher # noqa: E402
97
97
 
98
98
 
99
+ def _stub_mode(key='stub'):
100
+ """A mode whose window is a bare QMainWindow: the bookkeeping, not a window."""
101
+ return Mode(key=key, title=f'Stub {key}', blurb='x' * 50,
102
+ window='PySide6.QtWidgets:QMainWindow',
103
+ script='gratinglab-app')
104
+
105
+
99
106
  @pytest.fixture(autouse=True)
100
107
  def _no_leaked_windows():
101
108
  """
@@ -246,11 +253,30 @@ class TestTheChooser:
246
253
  assert ("Measure a grating's grooves from an AFM scan, look at its "
247
254
  "geometry, compute its diffraction efficiency, or plan how to "
248
255
  "rule it.") in shown
249
- assert 'another window' in shown and 'the other window' not in shown
250
- assert '<code>gratinglab-fab</code>' in shown
256
+ tips = ' '.join(w.toolTip() for w in
257
+ [*window.findChildren(QLabel), *window.buttons.values()])
258
+ assert 'another window' in tips and 'the other window' not in tips
259
+ assert '<code>gratinglab-fab</code>' in window.buttons['fabrication'].toolTip()
260
+
261
+ def test_every_button_says_what_it_opens(self, qtbot):
262
+ """The blurbs left the face of the toolbox for the tooltips; they
263
+ must not have left altogether."""
264
+ window = qt_launcher.LauncherWindow()
265
+ qtbot.addWidget(window)
266
+ for chosen in MODES:
267
+ tip = window.buttons[chosen.key].toolTip()
268
+ assert chosen.blurb in tip and f'<code>{chosen.script}</code>' in tip
269
+
270
+ def test_it_is_a_compact_toolbox(self, qtbot):
271
+ """Narrow enough to sit beside the windows it stays open with."""
272
+ window = qt_launcher.LauncherWindow()
273
+ qtbot.addWidget(window)
274
+ window.show()
275
+ assert window.width() <= 300
276
+ assert window.sizeHint().height() <= 320
251
277
 
252
- def test_clicking_opens_that_mode_and_closes_the_chooser(self, qtbot,
253
- monkeypatch):
278
+ def test_clicking_opens_that_mode_and_the_menu_stays(self, qtbot,
279
+ monkeypatch):
254
280
  opened = []
255
281
  monkeypatch.setattr(qt_launcher, 'open_window', opened.append)
256
282
 
@@ -261,33 +287,55 @@ class TestTheChooser:
261
287
  window.buttons['metrology'].click()
262
288
 
263
289
  assert [m.key for m in opened] == ['metrology']
264
- assert not window.isVisible(), "the chooser should get out of the way"
290
+ assert window.isVisible(), "the main menu stays open, as Gwiddion's does"
265
291
 
266
- def test_the_chooser_closes_only_after_the_window_is_up(self, qtbot,
267
- monkeypatch):
268
- """
269
- Order matters: Qt quits when the last window closes.
292
+ def test_a_second_click_raises_the_same_window(self, qtbot):
293
+ """One window per mode: the card reopens it rather than adding one."""
294
+ chooser = qt_launcher.LauncherWindow()
295
+ qtbot.addWidget(chooser)
296
+ chooser.show()
270
297
 
271
- Closing the chooser first would end the process before the window it
272
- was asked for existed, which is a blank launch rather than an error.
273
- """
274
- order = []
275
- monkeypatch.setattr(qt_launcher, 'open_window',
276
- lambda chosen: order.append('opened'))
298
+ first = chooser.choose(_stub_mode('one'))
299
+ qtbot.addWidget(first)
300
+ first.close()
301
+ again = chooser.choose(_stub_mode('one'))
277
302
 
278
- window = qt_launcher.LauncherWindow()
279
- qtbot.addWidget(window)
280
- window.show()
281
- original_close = window.close
303
+ assert again is first and again.isVisible()
304
+ assert len(qt_launcher._OPEN_WINDOWS) == 1
305
+
306
+ def test_closing_the_menu_closes_every_window(self, qtbot):
307
+ chooser = qt_launcher.LauncherWindow()
308
+ qtbot.addWidget(chooser)
309
+ chooser.show()
310
+ windows = [chooser.choose(_stub_mode(k)) for k in ('one', 'two')]
311
+ for window in windows:
312
+ qtbot.addWidget(window)
313
+ assert all(w.isVisible() for w in windows)
314
+
315
+ assert chooser.close()
282
316
 
283
- def recording_close():
284
- order.append('closed')
285
- return original_close()
317
+ assert not chooser.isVisible()
318
+ assert not any(w.isVisible() for w in windows)
286
319
 
287
- monkeypatch.setattr(window, 'close', recording_close)
288
- window.buttons['efficiency'].click()
320
+ def test_a_window_that_refuses_keeps_the_menu_open(self, qtbot):
321
+ """The menu is never gone while a window it opened is still up."""
322
+ from PySide6.QtWidgets import QMainWindow
289
323
 
290
- assert order == ['opened', 'closed']
324
+ class Refusing(QMainWindow):
325
+ def closeEvent(self, event): # noqa: N802
326
+ event.ignore()
327
+
328
+ chooser = qt_launcher.LauncherWindow()
329
+ qtbot.addWidget(chooser)
330
+ chooser.show()
331
+ stubborn = Refusing()
332
+ qtbot.addWidget(stubborn)
333
+ stubborn.show()
334
+ qt_launcher._OPEN_WINDOWS.append(stubborn)
335
+
336
+ assert not chooser.close()
337
+ assert chooser.isVisible() and stubborn.isVisible()
338
+ qt_launcher._OPEN_WINDOWS.remove(stubborn)
291
339
 
292
340
  def test_an_opened_window_is_kept_alive(self, qtbot):
293
341
  """
@@ -365,7 +413,7 @@ class TestItReallyOpensTheRealWindows:
365
413
  opened = qt_launcher._OPEN_WINDOWS[-1]
366
414
  qtbot.addWidget(opened)
367
415
  assert isinstance(opened, MetrologyWindow)
368
- assert not chooser.isVisible()
416
+ assert chooser.isVisible()
369
417
  finally:
370
418
  opened = qt_launcher._OPEN_WINDOWS.pop()
371
419
  opened.close()
@@ -378,13 +426,8 @@ class TestGettingBackAndSwitching:
378
426
  other one or back. Each window now carries a Go menu.
379
427
  """
380
428
 
381
- def _stub_mode(self, key='stub'):
382
- return Mode(key=key, title=f'Stub {key}', blurb='x' * 50,
383
- window='PySide6.QtWidgets:QMainWindow',
384
- script='gratinglab-app')
385
-
386
429
  def test_every_opened_window_gets_the_menu(self, qtbot):
387
- window = qt_launcher.open_window(self._stub_mode())
430
+ window = qt_launcher.open_window(_stub_mode())
388
431
  qtbot.addWidget(window)
389
432
 
390
433
  menu = window._gratinglab_switch_menu
@@ -413,7 +456,7 @@ class TestGettingBackAndSwitching:
413
456
  The metrology window holds a loaded scan and its settings. A switch
414
457
  that produced an empty second copy would read as the scan being gone.
415
458
  """
416
- chosen = self._stub_mode()
459
+ chosen = _stub_mode()
417
460
  first = qt_launcher.open_window(chosen)
418
461
  qtbot.addWidget(first)
419
462
 
@@ -423,7 +466,7 @@ class TestGettingBackAndSwitching:
423
466
 
424
467
  def test_a_closed_window_comes_back_with_its_state(self, qtbot):
425
468
  """Closing is not destroying while a reference is held."""
426
- chosen = self._stub_mode()
469
+ chosen = _stub_mode()
427
470
  window = qt_launcher.open_window(chosen)
428
471
  qtbot.addWidget(window)
429
472
  window.close()
@@ -453,14 +496,14 @@ class TestGettingBackAndSwitching:
453
496
  chooser = qt_launcher.show_chooser()
454
497
  qtbot.addWidget(chooser)
455
498
 
456
- first = qt_launcher.open_window(self._stub_mode('one'))
499
+ first = qt_launcher.open_window(_stub_mode('one'))
457
500
  qtbot.addWidget(first)
458
501
  chooser.close()
459
502
 
460
503
  back = qt_launcher.show_chooser()
461
504
  assert back is chooser and back.isVisible()
462
505
 
463
- second = qt_launcher.open_window(self._stub_mode('two'))
506
+ second = qt_launcher.open_window(_stub_mode('two'))
464
507
  qtbot.addWidget(second)
465
508
 
466
509
  assert first is not second
@@ -468,7 +511,7 @@ class TestGettingBackAndSwitching:
468
511
 
469
512
  def test_the_main_menu_action_actually_shows_it(self, qtbot):
470
513
  """Triggering the menu action, not calling the function behind it."""
471
- window = qt_launcher.open_window(self._stub_mode())
514
+ window = qt_launcher.open_window(_stub_mode())
472
515
  qtbot.addWidget(window)
473
516
 
474
517
  assert not qt_launcher._CHOOSER
File without changes
File without changes
File without changes
File without changes
File without changes