gratinglab 0.3.15__tar.gz → 0.3.17__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 (232) hide show
  1. {gratinglab-0.3.15/src/gratinglab.egg-info → gratinglab-0.3.17}/PKG-INFO +1 -1
  2. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/__init__.py +2 -2
  3. gratinglab-0.3.17/src/gratinglab/gui/label_layout.py +139 -0
  4. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/geometry_window.py +5 -1
  5. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/profile_plot_panel.py +14 -4
  6. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/scene3d_panel.py +66 -19
  7. {gratinglab-0.3.15 → gratinglab-0.3.17/src/gratinglab.egg-info}/PKG-INFO +1 -1
  8. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab.egg-info/SOURCES.txt +2 -0
  9. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_geometry_window.py +28 -0
  10. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_qt.py +23 -0
  11. gratinglab-0.3.17/tests/test_label_layout.py +75 -0
  12. {gratinglab-0.3.15 → gratinglab-0.3.17}/LICENSE +0 -0
  13. {gratinglab-0.3.15 → gratinglab-0.3.17}/MANIFEST.in +0 -0
  14. {gratinglab-0.3.15 → gratinglab-0.3.17}/README.md +0 -0
  15. {gratinglab-0.3.15 → gratinglab-0.3.17}/docs/conventions.md +0 -0
  16. {gratinglab-0.3.15 → gratinglab-0.3.17}/docs/theory/cmethod.md +0 -0
  17. {gratinglab-0.3.15 → gratinglab-0.3.17}/docs/theory/integral.md +0 -0
  18. {gratinglab-0.3.15 → gratinglab-0.3.17}/docs/theory/metrology.md +0 -0
  19. {gratinglab-0.3.15 → gratinglab-0.3.17}/docs/theory/rcwa.md +0 -0
  20. {gratinglab-0.3.15 → gratinglab-0.3.17}/docs/theory/scalar.md +0 -0
  21. {gratinglab-0.3.15 → gratinglab-0.3.17}/pyproject.toml +0 -0
  22. {gratinglab-0.3.15 → gratinglab-0.3.17}/setup.cfg +0 -0
  23. {gratinglab-0.3.15 → gratinglab-0.3.17}/setup.py +0 -0
  24. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/checks.py +0 -0
  25. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/compare.py +0 -0
  26. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/convergence.py +0 -0
  27. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/geometry.py +0 -0
  28. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/__init__.py +0 -0
  29. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/app.py +0 -0
  30. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/camera3d.py +0 -0
  31. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/cmethod_options.py +0 -0
  32. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/comparison.py +0 -0
  33. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/diagram.py +0 -0
  34. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/diagram3d.py +0 -0
  35. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/docs.py +0 -0
  36. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/efficiency_plot.py +0 -0
  37. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/failures.py +0 -0
  38. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/icon.py +0 -0
  39. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/integral_options.py +0 -0
  40. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/launcher.py +0 -0
  41. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/orders.py +0 -0
  42. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/provenance.py +0 -0
  43. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/__init__.py +0 -0
  44. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/cmethod_tab.py +0 -0
  45. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/compare_tab.py +0 -0
  46. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/geometry_panel.py +0 -0
  47. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/geometry_tab.py +0 -0
  48. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/help_menu.py +0 -0
  49. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/integral_tab.py +0 -0
  50. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/launcher.py +0 -0
  51. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/main_window.py +0 -0
  52. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/provenance_panel.py +0 -0
  53. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/rcwa_tab.py +0 -0
  54. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/recent.py +0 -0
  55. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/scalar_tab.py +0 -0
  56. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/setup_tab.py +0 -0
  57. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/sizing.py +0 -0
  58. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/theming.py +0 -0
  59. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/theory_viewer.py +0 -0
  60. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/qt/worker.py +0 -0
  61. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/rcwa_options.py +0 -0
  62. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/richtext.py +0 -0
  63. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/scalar_options.py +0 -0
  64. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/state.py +0 -0
  65. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/gui/theme.py +0 -0
  66. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/illumination.py +0 -0
  67. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/io/__init__.py +0 -0
  68. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/io/boundary.py +0 -0
  69. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/io/efficiency_table.py +0 -0
  70. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/io/ggp.py +0 -0
  71. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/io/txl.py +0 -0
  72. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/materials/__init__.py +0 -0
  73. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/materials/data/SOURCES.md +0 -0
  74. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/materials/fresnel.py +0 -0
  75. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/materials/optical.py +0 -0
  76. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/materials/refractiveindex.py +0 -0
  77. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/materials/typical.py +0 -0
  78. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/measured.py +0 -0
  79. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/__init__.py +0 -0
  80. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/_analyzer_summary.py +0 -0
  81. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/analyzer.py +0 -0
  82. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/boundary/__init__.py +0 -0
  83. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/boundary/average.py +0 -0
  84. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/boundary/cross_section.py +0 -0
  85. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/boundary/pipeline.py +0 -0
  86. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/boundary/swaths.py +0 -0
  87. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/cli.py +0 -0
  88. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/config.py +0 -0
  89. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/__init__.py +0 -0
  90. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/analysis.py +0 -0
  91. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/image_flatten.py +0 -0
  92. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/orientation.py +0 -0
  93. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/processing.py +0 -0
  94. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/region_mask.py +0 -0
  95. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/scars.py +0 -0
  96. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/core/tip.py +0 -0
  97. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/data/__init__.py +0 -0
  98. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/data/aggregation.py +0 -0
  99. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/__init__.py +0 -0
  100. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/icon.py +0 -0
  101. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/__init__.py +0 -0
  102. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/app.py +0 -0
  103. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/boundary_view.py +0 -0
  104. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/canvas.py +0 -0
  105. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/efficiency_dialog.py +0 -0
  106. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/import_view.py +0 -0
  107. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/layout.py +0 -0
  108. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/main_window.py +0 -0
  109. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/swath_dialog.py +0 -0
  110. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/wiki_view.py +0 -0
  111. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/qt/worker.py +0 -0
  112. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/gui/state.py +0 -0
  113. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/io/__init__.py +0 -0
  114. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/io/file_io.py +0 -0
  115. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/io/ibw.py +0 -0
  116. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/io/metrics.py +0 -0
  117. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/io/sem.py +0 -0
  118. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/io/spm.py +0 -0
  119. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/settings.py +0 -0
  120. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/stats/__init__.py +0 -0
  121. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/stats/analysis.py +0 -0
  122. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/stats/icc.py +0 -0
  123. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/visualization/__init__.py +0 -0
  124. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/visualization/diagnostics.py +0 -0
  125. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/visualization/profiles.py +0 -0
  126. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/visualization/statistics.py +0 -0
  127. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/__init__.py +0 -0
  128. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/facet-fitting.md +0 -0
  129. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/file-formats.md +0 -0
  130. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/flattening.md +0 -0
  131. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/groove-orientation.md +0 -0
  132. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/icc-correction.md +0 -0
  133. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/overview.md +0 -0
  134. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/reading-outputs.md +0 -0
  135. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/row-groups.md +0 -0
  136. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/scars-and-masking.md +0 -0
  137. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/swath-statistics.md +0 -0
  138. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/wiki/tip-correction.md +0 -0
  139. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/metrology/workflows.py +0 -0
  140. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/problem.py +0 -0
  141. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/profiles/__init__.py +0 -0
  142. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/profiles/_base.py +0 -0
  143. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/profiles/_polyline.py +0 -0
  144. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/profiles/_shapes.py +0 -0
  145. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/profiles/_trapezoid.py +0 -0
  146. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/profiles/_types.py +0 -0
  147. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/resolution.py +0 -0
  148. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/result.py +0 -0
  149. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/__init__.py +0 -0
  150. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/_conditioning.py +0 -0
  151. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/_execution.py +0 -0
  152. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/_scalar_groove.py +0 -0
  153. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/base.py +0 -0
  154. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/cmethod/__init__.py +0 -0
  155. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/cmethod/_core.py +0 -0
  156. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/cmethod/_series.py +0 -0
  157. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/integral/__init__.py +0 -0
  158. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/integral/_boundary.py +0 -0
  159. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/integral/_core.py +0 -0
  160. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/integral/_finite.py +0 -0
  161. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/integral/_greens.py +0 -0
  162. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/integral/_kernels.py +0 -0
  163. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/integral/_nystrom.py +0 -0
  164. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/rcwa/__init__.py +0 -0
  165. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/rcwa/_core.py +0 -0
  166. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/rcwa/_stack.py +0 -0
  167. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab/solvers/scalar.py +0 -0
  168. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab.egg-info/dependency_links.txt +0 -0
  169. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab.egg-info/entry_points.txt +0 -0
  170. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab.egg-info/requires.txt +0 -0
  171. {gratinglab-0.3.15 → gratinglab-0.3.17}/src/gratinglab.egg-info/top_level.txt +0 -0
  172. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_changelog.py +0 -0
  173. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_checks.py +0 -0
  174. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_cmethod.py +0 -0
  175. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_compare.py +0 -0
  176. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_conditioning.py +0 -0
  177. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_convergence.py +0 -0
  178. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_cross_method.py +0 -0
  179. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_efficiency_table.py +0 -0
  180. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_four_way.py +0 -0
  181. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_fresnel.py +0 -0
  182. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_geometry.py +0 -0
  183. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_ggp.py +0 -0
  184. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_camera3d.py +0 -0
  185. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_cmethod_options.py +0 -0
  186. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_cmethod_tab.py +0 -0
  187. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_compare_tab.py +0 -0
  188. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_diagram.py +0 -0
  189. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_diagram3d.py +0 -0
  190. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_docs.py +0 -0
  191. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_help_menu.py +0 -0
  192. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_integral_options.py +0 -0
  193. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_launcher.py +0 -0
  194. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_mathtext.py +0 -0
  195. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_orders.py +0 -0
  196. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_polish.py +0 -0
  197. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_provenance.py +0 -0
  198. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_provenance_panel.py +0 -0
  199. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_rcwa_options.py +0 -0
  200. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_richtext.py +0 -0
  201. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_scalar_options.py +0 -0
  202. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_state.py +0 -0
  203. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_gui_theme.py +0 -0
  204. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_illumination.py +0 -0
  205. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_core.py +0 -0
  206. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_corpus.py +0 -0
  207. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_finite.py +0 -0
  208. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_graded.py +0 -0
  209. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_greens.py +0 -0
  210. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_kernels.py +0 -0
  211. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_measured_polygon.py +0 -0
  212. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_operators.py +0 -0
  213. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_integral_solver.py +0 -0
  214. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_io_boundary.py +0 -0
  215. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_littrow.py +0 -0
  216. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_materials.py +0 -0
  217. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_measured.py +0 -0
  218. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_perturbation.py +0 -0
  219. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_profiles.py +0 -0
  220. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_rayleigh_anomaly.py +0 -0
  221. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_rcwa.py +0 -0
  222. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_rcwa_benchmarks.py +0 -0
  223. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_refractiveindex.py +0 -0
  224. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_resolution.py +0 -0
  225. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_result.py +0 -0
  226. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_scalar.py +0 -0
  227. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_solver_conformance.py +0 -0
  228. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_solver_execution.py +0 -0
  229. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_solver_progress.py +0 -0
  230. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_trapezoidal_solvers.py +0 -0
  231. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_txl.py +0 -0
  232. {gratinglab-0.3.15 → gratinglab-0.3.17}/tests/test_typical.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gratinglab
3
- Version: 0.3.15
3
+ Version: 0.3.17
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
@@ -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.15"
25
+ __version__ = "0.3.17"
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
@@ -32,7 +32,7 @@ __version__ = "0.3.15"
32
32
  #: the `## <version>` heading, so the release commit that forgets to move it
33
33
  #: fails at the point where it is cheapest to fix, the same arrangement as
34
34
  #: the version's own section.
35
- __version_date__ = "2026-11-14"
35
+ __version_date__ = "2026-11-15"
36
36
 
37
37
  __all__ = [
38
38
  "Illumination",
@@ -0,0 +1,139 @@
1
+ """Labels whose anchors crowd together, set in a column beside the crowd.
2
+
3
+ At grazing incidence every ray of the 3D view leaves along nearly the same
4
+ line, so their tips land within a few pixels of one another. Each label
5
+ placed beside its own tip then fills that knot, where the rays and tip
6
+ markers cross it. This module finds such crowds and lays their labels out as
7
+ one column beside the crowd, in the order the tips run down the screen, so
8
+ the leader lines joining each label to its tip do not cross.
9
+
10
+ Pure: screen points and ``(x, y, w, h)`` rectangles in, rectangles out, and
11
+ no toolkit. :class:`gratinglab.gui.qt.scene3d_panel.SceneCanvas` calls it and
12
+ paints the result.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ from collections.abc import Sequence
18
+
19
+ __all__ = ["CROWD_PX", "GAP_PX", "column", "covers", "crosses", "crowds"]
20
+
21
+ #: A tip nearer than this to another tip joins that tip's crowd.
22
+ CROWD_PX = 36.0
23
+ #: Between the crowd's outermost tip and the column.
24
+ GAP_PX = 14.0
25
+ #: Between rows of the column.
26
+ ROW_GAP = 2.0
27
+ #: How far a label keeps from any point it must not cover.
28
+ CLEAR_PX = 3.0
29
+
30
+ Point = tuple[float, float]
31
+ Rect = tuple[float, float, float, float]
32
+
33
+
34
+ def crowds(tips: Sequence[Point], reach: float = CROWD_PX) -> list[list[int]]:
35
+ """Groups of two or more tips, each tip within ``reach`` of another in its group."""
36
+ n = len(tips)
37
+ group = list(range(n))
38
+
39
+ def root(i: int) -> int:
40
+ while group[i] != i:
41
+ group[i] = group[group[i]]
42
+ i = group[i]
43
+ return i
44
+
45
+ for i in range(n):
46
+ for j in range(i + 1, n):
47
+ dx, dy = tips[i][0] - tips[j][0], tips[i][1] - tips[j][1]
48
+ if dx * dx + dy * dy <= reach * reach:
49
+ group[root(i)] = root(j)
50
+ found: dict[int, list[int]] = {}
51
+ for i in range(n):
52
+ found.setdefault(root(i), []).append(i)
53
+ return [members for members in found.values() if len(members) > 1]
54
+
55
+
56
+ def overlaps(a: Rect, b: Rect) -> bool:
57
+ return a[0] < b[0] + b[2] and b[0] < a[0] + a[2] and a[1] < b[1] + b[3] and b[1] < a[1] + a[3]
58
+
59
+
60
+ def covers(rect: Rect, point: Point, pad: float = CLEAR_PX) -> bool:
61
+ x, y, w, h = rect
62
+ return x - pad <= point[0] <= x + w + pad and y - pad <= point[1] <= y + h + pad
63
+
64
+
65
+ def inside(rect: Rect, bounds: Rect) -> bool:
66
+ x, y, w, h = rect
67
+ bx, by, bw, bh = bounds
68
+ return x >= bx and y >= by and x + w <= bx + bw and y + h <= by + bh
69
+
70
+
71
+ def crosses(rect: Rect, a: Point, b: Point) -> bool:
72
+ """Whether the segment from ``a`` to ``b`` passes through ``rect``.
73
+
74
+ Liang and Barsky's clip: the segment is cut to each of the rectangle's
75
+ four slabs in turn, and crosses it if anything of it is left."""
76
+ x, y, w, h = rect
77
+ lo, hi = 0.0, 1.0
78
+ dx, dy = b[0] - a[0], b[1] - a[1]
79
+ for step, gap in ((-dx, a[0] - x), (dx, x + w - a[0]), (-dy, a[1] - y), (dy, y + h - a[1])):
80
+ if step == 0:
81
+ if gap < 0:
82
+ return False
83
+ continue
84
+ t = gap / step
85
+ if step < 0:
86
+ lo = max(lo, t)
87
+ else:
88
+ hi = min(hi, t)
89
+ if lo > hi:
90
+ return False
91
+ return True
92
+
93
+
94
+ def column(
95
+ members: Sequence[int],
96
+ tips: Sequence[Point],
97
+ sizes: Sequence[tuple[float, float]],
98
+ bounds: Rect,
99
+ keep_clear: Sequence[Point] = (),
100
+ taken: Sequence[Rect] = (),
101
+ lines: Sequence[tuple[Point, Point]] = (),
102
+ ) -> dict[int, Rect] | None:
103
+ """A rectangle for each member's label, stacked beside the crowd, or None.
104
+
105
+ The column goes to the right of the crowd if it fits, else to the left,
106
+ first level with the crowd and then stepped up and down. A column fits
107
+ when it is in ``bounds``, overlaps nothing in ``taken``, covers no point
108
+ in ``keep_clear`` and is crossed by no segment in ``lines``: the rays
109
+ leave the crowd as a fan, and a column across the fan is read through
110
+ it. On the right the labels are left-aligned, on the left right-aligned,
111
+ so each sits against the side its leader comes from.
112
+ """
113
+ rows = sorted(members, key=lambda i: tips[i][1])
114
+ width = max(sizes[i][0] for i in rows)
115
+ height = sum(sizes[i][1] for i in rows) + ROW_GAP * (len(rows) - 1)
116
+ xs = [tips[i][0] for i in rows]
117
+ middle = sum(tips[i][1] for i in rows) / len(rows)
118
+ shifts = [0.0]
119
+ for step in (0.5, 1.0, 1.5, 2.0, 3.0):
120
+ shifts += [-step * height, step * height]
121
+ for side in (1, -1):
122
+ left = max(xs) + GAP_PX if side > 0 else min(xs) - GAP_PX - width
123
+ for shift in shifts:
124
+ top = middle - height / 2 + shift
125
+ top = min(max(top, bounds[1]), bounds[1] + bounds[3] - height)
126
+ placed: dict[int, Rect] = {}
127
+ y = top
128
+ for i in rows:
129
+ w, h = sizes[i]
130
+ x = left if side > 0 else left + width - w
131
+ placed[i] = (x, y, w, h)
132
+ y += h + ROW_GAP
133
+ boxes = list(placed.values())
134
+ if all(inside(b, bounds) for b in boxes) \
135
+ and not any(overlaps(b, t) for b in boxes for t in taken) \
136
+ and not any(covers(b, p) for b in boxes for p in keep_clear) \
137
+ and not any(crosses(b, *line) for b in boxes for line in lines):
138
+ return placed
139
+ return None
@@ -93,8 +93,12 @@ class GeometryWindow(QMainWindow):
93
93
  column = QWidget()
94
94
  layout = QVBoxLayout(column)
95
95
  layout.setContentsMargins(0, 0, 0, 0)
96
- layout.addWidget(self.geometry)
96
+ # The button sits just under the last field, and the spare height
97
+ # goes below it: the panel ends in a stretch of its own, which with
98
+ # equal shares would push the button to the foot of the dock.
99
+ layout.addWidget(self.geometry, 0)
97
100
  layout.addWidget(self.send_button)
101
+ layout.addStretch(1)
98
102
 
99
103
  scroller = QScrollArea()
100
104
  scroller.setWidget(column)
@@ -14,6 +14,9 @@ from PySide6.QtWidgets import QVBoxLayout, QWidget
14
14
 
15
15
  __all__ = ["ProfilePlotPanel"]
16
16
 
17
+ #: A profile class named as the geometry form names it, where they differ.
18
+ _KIND_NAMES = {"FromProfileData": "From file"}
19
+
17
20
 
18
21
  class ProfilePlotPanel(QWidget):
19
22
  """A single matplotlib axes, embedded with its own navigation toolbar."""
@@ -81,12 +84,19 @@ class ProfilePlotPanel(QWidget):
81
84
  height = parsed.problem.height_nm(t)
82
85
  axes.plot(x, height, color=surface, lw=1.8)
83
86
  axes.fill_between(x, 0, height, color=surface, alpha=0.12)
84
- axes.set_xlabel("position along d̂ (nm), two periods shown")
87
+ # Short lines, at 9 pt, centred on the figure: constrained layout
88
+ # shrinks the axes to fit the panel but never the text, and an axes
89
+ # title centres on the axes, which the y label pushes right. One long
90
+ # 10 pt axes title ran past the edge of a pane 324 px wide; this fits
91
+ # the dock's narrowest, 280 px, with about 20 px either side.
92
+ axes.set_xlabel("position along d̂ (nm)")
85
93
  axes.set_ylabel("height (nm)")
86
- axes.set_title(
87
- f"{type(parsed.problem.profile).__name__}: "
94
+ kind = type(parsed.problem.profile).__name__
95
+ self._figure.suptitle(
96
+ f"{_KIND_NAMES.get(kind, kind)}, two periods\n"
88
97
  f"period {parsed.problem.period:g} nm, depth {parsed.problem.depth:.4g} nm",
89
- fontsize=10,
98
+ fontsize=9,
99
+ color=theme.ink,
90
100
  )
91
101
  axes.grid(alpha=0.25)
92
102
  self._canvas.draw_idle()
@@ -43,7 +43,7 @@ from PySide6.QtWidgets import (
43
43
  QWidget,
44
44
  )
45
45
 
46
- from .. import camera3d, diagram3d
46
+ from .. import camera3d, diagram3d, label_layout
47
47
  from ..camera3d import Camera
48
48
  from . import recent, theming
49
49
 
@@ -300,19 +300,59 @@ class SceneCanvas(QWidget):
300
300
  return out
301
301
 
302
302
  def _paint_labels(self, painter, frame, colors, theme, width, height) -> None:
303
- """Place each label at the first of several spots round its anchor
304
- that overlaps no label already placed and stays in the frame. Orders
305
- go last, since there are many and they are the ones that crowd."""
303
+ """Name everything, covering no other label and no other tip.
304
+
305
+ Labels whose tips crowd together go in a column beside the crowd,
306
+ laid out by :mod:`gratinglab.gui.label_layout`: at grazing incidence
307
+ every order's tip lands in one knot, and labels set round each tip
308
+ filled it. The rest go at the first of several spots round their tip
309
+ that is free, orders last, since there are many of them."""
306
310
  font = QFont(painter.font())
307
311
  font.setPointSizeF(8.5)
308
312
  painter.setFont(font)
309
313
  metrics = QFontMetricsF(font)
310
314
  bounds = QRectF(2, 2, width - 4, height - 4)
315
+
316
+ labels = []
317
+ for tail, world, text, tag in self._labels():
318
+ (t_xy, xy), _ = camera3d.project(frame, [tail, world])
319
+ size = (metrics.horizontalAdvance(text) + 4, metrics.height())
320
+ labels.append((t_xy, (float(xy[0]), float(xy[1])), text, tag, size))
321
+ tips = [lab[1] for lab in labels]
322
+ markers = []
323
+ for point in self.scene.points:
324
+ (xy,), _ = camera3d.project(frame, [(point.x, point.y, point.z)])
325
+ markers.append((float(xy[0]), float(xy[1])))
326
+ keep_clear = tips + markers
327
+ # Every labelled line as drawn on screen, tail to tip, for a column
328
+ # to keep out of.
329
+ lines = [((float(lab[0][0]), float(lab[0][1])), lab[1]) for lab in labels]
330
+
331
+ # --- crowds first, each as one column, while there is room for it.
311
332
  placed: list[QRectF] = []
312
- ordered = sorted(self._labels(), key=lambda lab: lab[3] in ("order", "zero"))
313
- for tail, world, text, tag in ordered:
314
- (t_xy, (x, y)), _ = camera3d.project(frame, [tail, world])
315
- w, h = metrics.horizontalAdvance(text) + 4, metrics.height()
333
+ done: set[int] = set()
334
+ frame_rect = bounds.getRect()
335
+ on_screen = [i for i, tip in enumerate(tips) if bounds.contains(QPointF(*tip))]
336
+ for crowd in label_layout.crowds([tips[i] for i in on_screen]):
337
+ members = [on_screen[k] for k in crowd]
338
+ rects = label_layout.column(
339
+ members, tips, [lab[4] for lab in labels], frame_rect,
340
+ keep_clear, [b.getRect() for b in placed], lines,
341
+ )
342
+ if rects is None:
343
+ continue # no room for a column; each takes its own chance below
344
+ for i, rect in rects.items():
345
+ box = QRectF(*rect)
346
+ self._draw_label(painter, colors, labels[i], box, leader=True)
347
+ placed.append(box)
348
+ done.add(i)
349
+
350
+ # --- everything else, round its own tip.
351
+ rest = sorted((i for i in range(len(labels)) if i not in done),
352
+ key=lambda i: labels[i][3] in ("order", "zero"))
353
+ for i in rest:
354
+ t_xy, (x, y), text, tag, (w, h) = labels[i]
355
+ others = [p for k, p in enumerate(keep_clear) if k != i]
316
356
  # First choice: just past the tip, continuing the line, where the
317
357
  # label reads as the line's own and covers none of it.
318
358
  dx, dy = x - t_xy[0], y - t_xy[1]
@@ -332,22 +372,29 @@ class SceneCanvas(QWidget):
332
372
  box, leader = None, False
333
373
  for n, (dx, dy) in enumerate(spots):
334
374
  candidate = QRectF(x + dx, y + dy, w, h)
335
- if bounds.contains(candidate) and not any(candidate.intersects(b) for b in placed):
375
+ if bounds.contains(candidate) \
376
+ and not any(candidate.intersects(b) for b in placed) \
377
+ and not any(label_layout.covers(candidate.getRect(), p) for p in others):
336
378
  box, leader = candidate, n >= 9
337
379
  break
338
380
  if box is None or not bounds.contains(QPointF(x, y)):
339
381
  continue # nowhere free, or its tip is off screen
340
- if leader:
341
- lead = QColor(colors[tag])
342
- lead.setAlphaF(0.5)
343
- painter.setPen(QPen(lead, 0.8))
344
- # To the nearest point of the box, which a ring keeps clear of the tip.
345
- painter.drawLine(QPointF(x, y), QPointF(
346
- min(max(x, box.left()), box.right()), min(max(y, box.top()), box.bottom())))
382
+ self._draw_label(painter, colors, labels[i], box, leader)
347
383
  placed.append(box)
348
- self.label_boxes.append((text, box))
349
- painter.setPen(QColor(colors[tag]))
350
- painter.drawText(box, Qt.AlignmentFlag.AlignCenter, text)
384
+
385
+ def _draw_label(self, painter, colors, label, box, leader) -> None:
386
+ """One label in its box, joined to its tip when it is set apart."""
387
+ _tail, (x, y), text, tag, _size = label
388
+ if leader:
389
+ lead = QColor(colors[tag])
390
+ lead.setAlphaF(0.5)
391
+ painter.setPen(QPen(lead, 0.8))
392
+ # To the nearest point of the box, which keeps clear of the tip.
393
+ painter.drawLine(QPointF(x, y), QPointF(
394
+ min(max(x, box.left()), box.right()), min(max(y, box.top()), box.bottom())))
395
+ self.label_boxes.append((text, box))
396
+ painter.setPen(QColor(colors[tag]))
397
+ painter.drawText(box, Qt.AlignmentFlag.AlignCenter, text)
351
398
 
352
399
  def _paint_title(self, painter, theme, width) -> None:
353
400
  font = QFont(painter.font())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gratinglab
3
- Version: 0.3.15
3
+ Version: 0.3.17
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
@@ -37,6 +37,7 @@ src/gratinglab/gui/efficiency_plot.py
37
37
  src/gratinglab/gui/failures.py
38
38
  src/gratinglab/gui/icon.py
39
39
  src/gratinglab/gui/integral_options.py
40
+ src/gratinglab/gui/label_layout.py
40
41
  src/gratinglab/gui/launcher.py
41
42
  src/gratinglab/gui/orders.py
42
43
  src/gratinglab/gui/provenance.py
@@ -208,6 +209,7 @@ tests/test_integral_measured_polygon.py
208
209
  tests/test_integral_operators.py
209
210
  tests/test_integral_solver.py
210
211
  tests/test_io_boundary.py
212
+ tests/test_label_layout.py
211
213
  tests/test_littrow.py
212
214
  tests/test_materials.py
213
215
  tests/test_measured.py
@@ -93,6 +93,34 @@ class TestTheWindow:
93
93
  window.refresh()
94
94
  assert window.geometry_tab._parsed is before
95
95
 
96
+ def test_the_send_button_sits_under_the_form(self, window, qapp):
97
+ """Just below the last field, not at the foot of a tall dock."""
98
+ window.resize(1280, 820)
99
+ window.show()
100
+ qapp.processEvents()
101
+ panel, button = window.geometry, window.send_button
102
+ form_bottom = panel.mapTo(window, panel.rect().topLeft()).y() + panel.sizeHint().height()
103
+ gap = button.mapTo(window, button.rect().topLeft()).y() - form_bottom
104
+ assert 0 <= gap < 20, f"the button is {gap} px below the form"
105
+ assert window.geometry_dock.height() - gap > 400, "the dock was too short to tell"
106
+
107
+ def test_the_profile_plot_text_fits_a_narrow_window(self, window, qapp):
108
+ """The groove profile's title and x label stay inside its figure at
109
+ the dock's narrowest; one long title used to run off its right edge."""
110
+ window.resize(1000, 700)
111
+ window.show()
112
+ qapp.processEvents()
113
+ panel = window.geometry_tab.profile_panel
114
+ figure, axes = panel._figure, panel._axes
115
+ figure.canvas.draw()
116
+ renderer = figure.canvas.get_renderer()
117
+ assert figure.bbox.width < 300, "the pane was too wide to tell"
118
+ title = figure.get_suptitle()
119
+ assert "two periods" in title and "period" in title.splitlines()[1]
120
+ for text in (figure._suptitle, axes.title, axes.xaxis.label):
121
+ extent = text.get_window_extent(renderer)
122
+ assert extent.x0 >= 0 and extent.x1 <= figure.bbox.width, text.get_text()
123
+
96
124
  def test_the_go_menu_reaches_the_efficiency_window(self, window):
97
125
  titles = [a.text() for a in window._gratinglab_switch_actions]
98
126
  assert "Compute efficiency" in titles
@@ -1631,6 +1631,29 @@ class TestRimFocusAndPresets:
1631
1631
  for b in boxes[i + 1:]:
1632
1632
  assert not a.intersects(b) or a.intersected(b).isEmpty()
1633
1633
 
1634
+ def test_no_label_covers_another_tip(self, win):
1635
+ """At grazing incidence the order tips land in one knot, and labels
1636
+ set round each tip filled it, over the rays and the tip markers. A
1637
+ crowd's labels now stand in a column beside it."""
1638
+ from gratinglab.gui import camera3d, label_layout
1639
+
1640
+ panel = self._panel(win)
1641
+ panel.render_image()
1642
+ canvas = panel._canvas
1643
+ tips = []
1644
+ for tail, head, text, _tag in canvas._labels():
1645
+ (_, xy), _ = camera3d.project(canvas.frame, [tail, head])
1646
+ tips.append((text, (float(xy[0]), float(xy[1]))))
1647
+ for point in canvas.scene.points:
1648
+ (xy,), _ = camera3d.project(canvas.frame, [(point.x, point.y, point.z)])
1649
+ tips.append(("", (float(xy[0]), float(xy[1]))))
1650
+ crowded = label_layout.crowds([xy for _t, xy in tips])
1651
+ assert crowded, "the default geometry no longer crowds; this test needs one that does"
1652
+ covering = [(text, other) for text, box in canvas.label_boxes
1653
+ for other, xy in tips
1654
+ if other != text and label_layout.covers(box.getRect(), xy)]
1655
+ assert not covering
1656
+
1634
1657
  def test_every_propagating_order_is_named(self, win):
1635
1658
  """The scene names m = 0 only; this view names the rest from each
1636
1659
  ray's own order, so the names are the scene's numbers."""
@@ -0,0 +1,75 @@
1
+ """The column a crowd of labels is set in, without a toolkit.
2
+
3
+ The 3D view at grazing incidence lands every order's tip in one knot, and
4
+ labels placed round each tip filled it. These hold the pure layout to what
5
+ it is for: crowds are found, a column is in tip order, and it keeps off
6
+ every tip and every ray it is given.
7
+ """
8
+
9
+ import pytest
10
+
11
+ from gratinglab.gui import label_layout as L
12
+
13
+ BOUNDS = (0.0, 0.0, 600.0, 400.0)
14
+ SIZE = (30.0, 12.0)
15
+
16
+
17
+ class TestCrowds:
18
+ def test_near_tips_group_and_a_far_one_does_not(self):
19
+ tips = [(100, 100), (110, 104), (120, 100), (400, 300)]
20
+ assert [sorted(c) for c in L.crowds(tips)] == [[0, 1, 2]]
21
+
22
+ def test_a_chain_is_one_crowd(self):
23
+ """Single linkage: each within reach of the next is one crowd, even
24
+ when the ends are further apart than the reach."""
25
+ tips = [(0, 0), (30, 0), (60, 0), (90, 0)]
26
+ assert [sorted(c) for c in L.crowds(tips)] == [[0, 1, 2, 3]]
27
+
28
+ def test_lone_tips_make_no_crowd(self):
29
+ assert L.crowds([(0, 0), (200, 0), (0, 200)]) == []
30
+
31
+
32
+ class TestColumn:
33
+ def test_rows_follow_the_tips_down_the_screen(self):
34
+ tips = [(100, 110), (104, 100), (108, 120)]
35
+ rects = L.column([0, 1, 2], tips, [SIZE] * 3, BOUNDS)
36
+ tops = {i: r[1] for i, r in rects.items()}
37
+ assert tops[1] < tops[0] < tops[2]
38
+
39
+ def test_it_covers_no_tip_and_no_label_overlaps(self):
40
+ tips = [(100, 110), (104, 100), (108, 120)]
41
+ rects = L.column([0, 1, 2], tips, [SIZE] * 3, BOUNDS, keep_clear=tips)
42
+ boxes = list(rects.values())
43
+ assert not any(L.covers(b, t) for b in boxes for t in tips)
44
+ assert not any(L.overlaps(a, b) for k, a in enumerate(boxes) for b in boxes[k + 1:])
45
+
46
+ def test_it_keeps_off_a_ray_it_is_given(self):
47
+ """A ray leaving the crowd to the right pushes the column off it."""
48
+ tips = [(100, 200), (104, 204)]
49
+ ray = ((100, 200), (500, 200))
50
+ rects = L.column([0, 1], tips, [SIZE] * 2, BOUNDS, lines=[ray])
51
+ assert not any(L.crosses(b, *ray) for b in rects.values())
52
+ unconstrained = L.column([0, 1], tips, [SIZE] * 2, BOUNDS)
53
+ assert any(L.crosses(b, *ray) for b in unconstrained.values()), (
54
+ "the test proves nothing unless the ray was in the way to begin with")
55
+
56
+ def test_it_goes_left_when_the_right_is_out_of_frame(self):
57
+ tips = [(590, 200), (594, 206)]
58
+ rects = L.column([0, 1], tips, [SIZE] * 2, BOUNDS)
59
+ assert all(r[0] + r[2] <= 590 for r in rects.values())
60
+
61
+ def test_no_room_is_none(self):
62
+ tips = [(10, 10), (14, 12)]
63
+ assert L.column([0, 1], tips, [(500.0, 300.0)] * 2, (0, 0, 520, 320)) is None
64
+
65
+
66
+ class TestCrosses:
67
+ @pytest.mark.parametrize("a, b, expected", [
68
+ ((0, 5), (20, 5), True), # straight through
69
+ ((0, 0), (20, 20), True), # corner to corner
70
+ ((0, 20), (20, 20), False), # passes below
71
+ ((5, 5), (6, 6), True), # wholly inside
72
+ ((-10, 5), (-1, 5), False), # stops short
73
+ ])
74
+ def test_cases(self, a, b, expected):
75
+ assert L.crosses((0, 0, 10, 10), a, b) is expected
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes