gratinglab 0.3.14__tar.gz → 0.3.16__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.
- {gratinglab-0.3.14/src/gratinglab.egg-info → gratinglab-0.3.16}/PKG-INFO +1 -1
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/__init__.py +1 -1
- gratinglab-0.3.16/src/gratinglab/gui/label_layout.py +139 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/geometry_window.py +11 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/launcher.py +30 -43
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/scene3d_panel.py +66 -19
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/boundary_view.py +31 -11
- {gratinglab-0.3.14 → gratinglab-0.3.16/src/gratinglab.egg-info}/PKG-INFO +1 -1
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab.egg-info/SOURCES.txt +2 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_launcher.py +21 -2
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_qt.py +23 -0
- gratinglab-0.3.16/tests/test_label_layout.py +75 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/LICENSE +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/MANIFEST.in +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/README.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/docs/conventions.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/docs/theory/cmethod.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/docs/theory/integral.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/docs/theory/metrology.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/docs/theory/rcwa.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/docs/theory/scalar.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/pyproject.toml +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/setup.cfg +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/setup.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/checks.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/compare.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/convergence.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/geometry.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/app.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/camera3d.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/cmethod_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/comparison.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/diagram.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/diagram3d.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/docs.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/efficiency_plot.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/failures.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/icon.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/integral_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/launcher.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/orders.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/provenance.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/cmethod_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/compare_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/geometry_panel.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/geometry_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/help_menu.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/integral_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/main_window.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/profile_plot_panel.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/provenance_panel.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/rcwa_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/recent.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/scalar_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/setup_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/sizing.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/theming.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/theory_viewer.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/qt/worker.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/rcwa_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/richtext.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/scalar_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/state.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/gui/theme.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/illumination.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/io/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/io/boundary.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/io/efficiency_table.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/io/ggp.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/io/txl.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/materials/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/materials/data/SOURCES.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/materials/fresnel.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/materials/optical.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/materials/refractiveindex.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/materials/typical.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/measured.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/_analyzer_summary.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/analyzer.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/boundary/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/boundary/average.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/boundary/cross_section.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/boundary/pipeline.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/boundary/swaths.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/cli.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/config.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/analysis.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/image_flatten.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/orientation.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/processing.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/region_mask.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/scars.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/core/tip.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/data/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/data/aggregation.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/icon.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/app.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/canvas.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/efficiency_dialog.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/import_view.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/layout.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/main_window.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/swath_dialog.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/wiki_view.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/qt/worker.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/gui/state.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/io/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/io/file_io.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/io/ibw.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/io/metrics.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/io/sem.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/io/spm.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/settings.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/stats/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/stats/analysis.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/stats/icc.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/visualization/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/visualization/diagnostics.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/visualization/profiles.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/visualization/statistics.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/facet-fitting.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/file-formats.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/flattening.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/groove-orientation.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/icc-correction.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/overview.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/reading-outputs.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/row-groups.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/scars-and-masking.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/swath-statistics.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/wiki/tip-correction.md +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/metrology/workflows.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/problem.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/profiles/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/profiles/_base.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/profiles/_polyline.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/profiles/_shapes.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/profiles/_trapezoid.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/profiles/_types.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/resolution.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/result.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/_conditioning.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/_execution.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/_scalar_groove.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/base.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/cmethod/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/cmethod/_core.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/cmethod/_series.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/integral/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/integral/_boundary.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/integral/_core.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/integral/_finite.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/integral/_greens.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/integral/_kernels.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/integral/_nystrom.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/rcwa/__init__.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/rcwa/_core.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/rcwa/_stack.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab/solvers/scalar.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab.egg-info/dependency_links.txt +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab.egg-info/entry_points.txt +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab.egg-info/requires.txt +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/src/gratinglab.egg-info/top_level.txt +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_changelog.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_checks.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_cmethod.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_compare.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_conditioning.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_convergence.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_cross_method.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_efficiency_table.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_four_way.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_fresnel.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_geometry.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_ggp.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_camera3d.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_cmethod_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_cmethod_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_compare_tab.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_diagram.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_diagram3d.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_docs.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_geometry_window.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_help_menu.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_integral_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_mathtext.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_orders.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_polish.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_provenance.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_provenance_panel.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_rcwa_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_richtext.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_scalar_options.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_state.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_gui_theme.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_illumination.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_core.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_corpus.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_finite.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_graded.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_greens.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_kernels.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_measured_polygon.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_operators.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_integral_solver.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_io_boundary.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_littrow.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_materials.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_measured.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_perturbation.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_profiles.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_rayleigh_anomaly.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_rcwa.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_rcwa_benchmarks.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_refractiveindex.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_resolution.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_result.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_scalar.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_solver_conformance.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_solver_execution.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_solver_progress.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_trapezoidal_solvers.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_txl.py +0 -0
- {gratinglab-0.3.14 → gratinglab-0.3.16}/tests/test_typical.py +0 -0
|
@@ -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.
|
|
25
|
+
__version__ = "0.3.16"
|
|
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
|
|
@@ -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
|
|
@@ -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
|
|
|
@@ -26,8 +26,6 @@ from PySide6.QtCore import Qt
|
|
|
26
26
|
from PySide6.QtGui import QKeySequence
|
|
27
27
|
from PySide6.QtWidgets import (
|
|
28
28
|
QApplication,
|
|
29
|
-
QFrame,
|
|
30
|
-
QHBoxLayout,
|
|
31
29
|
QLabel,
|
|
32
30
|
QMenuBar,
|
|
33
31
|
QPushButton,
|
|
@@ -63,6 +61,13 @@ SWITCH_MENU_TITLE = "&Go"
|
|
|
63
61
|
_OPEN_WINDOWS: list[QWidget] = []
|
|
64
62
|
|
|
65
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
|
+
|
|
66
71
|
#: The chooser, kept so that "Main Menu" shows the same one rather than a
|
|
67
72
|
#: second copy. Closing a window does not destroy it while a reference is
|
|
68
73
|
#: held, so this one can be shown again after it was closed.
|
|
@@ -235,7 +240,12 @@ def _either(items):
|
|
|
235
240
|
|
|
236
241
|
|
|
237
242
|
class LauncherWindow(QWidget):
|
|
238
|
-
"""A
|
|
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.
|
|
239
249
|
|
|
240
250
|
It carries the same View and Help menus the windows do, since the theme
|
|
241
251
|
is a setting for the whole application and not for whichever window
|
|
@@ -254,42 +264,28 @@ class LauncherWindow(QWidget):
|
|
|
254
264
|
self.setWindowTitle("gratinglab")
|
|
255
265
|
|
|
256
266
|
layout = QVBoxLayout(self)
|
|
257
|
-
layout.setContentsMargins(
|
|
258
|
-
layout.setSpacing(
|
|
267
|
+
layout.setContentsMargins(12, 8, 12, 12)
|
|
268
|
+
layout.setSpacing(6)
|
|
259
269
|
layout.setMenuBar(self._build_menu())
|
|
260
270
|
|
|
261
|
-
heading = QLabel("gratinglab")
|
|
262
|
-
font = heading.font()
|
|
263
|
-
font.setPointSize(font.pointSize() + 8)
|
|
264
|
-
font.setBold(True)
|
|
265
|
-
heading.setFont(font)
|
|
266
|
-
layout.addWidget(heading)
|
|
267
|
-
|
|
268
271
|
opening = _either([m.summary for m in MODES if m.summary])
|
|
269
272
|
# Only the first letter: str.capitalize() would lower "AFM" too.
|
|
270
273
|
subtitle = QLabel(opening[:1].upper() + opening[1:] + ".")
|
|
271
274
|
subtitle.setWordWrap(True)
|
|
272
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
|
+
)
|
|
273
280
|
layout.addWidget(subtitle)
|
|
281
|
+
layout.addSpacing(4)
|
|
274
282
|
|
|
275
283
|
self.buttons = {}
|
|
276
284
|
for chosen in MODES:
|
|
277
|
-
layout.addWidget(self.
|
|
285
|
+
layout.addWidget(self._button(chosen))
|
|
278
286
|
|
|
279
287
|
layout.addStretch(1)
|
|
280
|
-
|
|
281
|
-
hint = QLabel(
|
|
282
|
-
"The <b>Go</b> menu in each window switches to another window or "
|
|
283
|
-
"back to this one. To open a window directly, run "
|
|
284
|
-
+ _either([f"<code>{m.script}</code>" for m in MODES])
|
|
285
|
-
+ "."
|
|
286
|
-
)
|
|
287
|
-
hint.setWordWrap(True)
|
|
288
|
-
hint.setTextFormat(Qt.RichText)
|
|
289
|
-
hint.setStyleSheet("color: palette(mid);")
|
|
290
|
-
layout.addWidget(hint)
|
|
291
|
-
|
|
292
|
-
self.setMinimumWidth(460)
|
|
288
|
+
self.setFixedWidth(_TOOLBOX_WIDTH)
|
|
293
289
|
|
|
294
290
|
def _build_menu(self):
|
|
295
291
|
"""View > Theme and Help, held on the instance and returned.
|
|
@@ -315,29 +311,20 @@ class LauncherWindow(QWidget):
|
|
|
315
311
|
self._help_menu = install_help_menu(self, self._menu_bar)
|
|
316
312
|
return self._menu_bar
|
|
317
313
|
|
|
318
|
-
def
|
|
319
|
-
"""One mode
|
|
320
|
-
frame = QFrame()
|
|
321
|
-
frame.setFrameShape(QFrame.StyledPanel)
|
|
322
|
-
inner = QVBoxLayout(frame)
|
|
323
|
-
inner.setContentsMargins(16, 14, 16, 14)
|
|
324
|
-
inner.setSpacing(6)
|
|
325
|
-
|
|
326
|
-
row = QHBoxLayout()
|
|
314
|
+
def _button(self, chosen):
|
|
315
|
+
"""One mode's button, with what it is for and its command as a tooltip."""
|
|
327
316
|
button = QPushButton(chosen.title)
|
|
328
317
|
button.setDefault(chosen is MODES[0])
|
|
329
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
|
+
)
|
|
330
324
|
button.clicked.connect(partial(self.choose, chosen))
|
|
331
325
|
button.setObjectName(f"mode-{chosen.key}")
|
|
332
|
-
row.addWidget(button)
|
|
333
|
-
inner.addLayout(row)
|
|
334
|
-
|
|
335
|
-
blurb = QLabel(chosen.blurb)
|
|
336
|
-
blurb.setWordWrap(True)
|
|
337
|
-
inner.addWidget(blurb)
|
|
338
|
-
|
|
339
326
|
self.buttons[chosen.key] = button
|
|
340
|
-
return
|
|
327
|
+
return button
|
|
341
328
|
|
|
342
329
|
def choose(self, chosen):
|
|
343
330
|
"""Open a mode's window, or raise it if it is open, and stay open.
|
|
@@ -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
|
-
"""
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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)
|
|
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
|
-
|
|
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
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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())
|
|
@@ -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
|
-
"""
|
|
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
|
|
457
|
-
|
|
458
|
-
|
|
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
|
|
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, "
|
|
470
|
-
f"The
|
|
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(
|
|
501
|
+
window = open_window(mode(key))
|
|
482
502
|
window.open_boundary(path)
|
|
483
503
|
return window
|
|
@@ -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
|
|
@@ -253,8 +253,27 @@ class TestTheChooser:
|
|
|
253
253
|
assert ("Measure a grating's grooves from an AFM scan, look at its "
|
|
254
254
|
"geometry, compute its diffraction efficiency, or plan how to "
|
|
255
255
|
"rule it.") in shown
|
|
256
|
-
|
|
257
|
-
|
|
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
|
|
258
277
|
|
|
259
278
|
def test_clicking_opens_that_mode_and_the_menu_stays(self, qtbot,
|
|
260
279
|
monkeypatch):
|
|
@@ -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
|