gratinglab 0.3.8__tar.gz → 0.3.10__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.8/src/gratinglab.egg-info → gratinglab-0.3.10}/PKG-INFO +3 -3
- {gratinglab-0.3.8 → gratinglab-0.3.10}/pyproject.toml +2 -2
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/__init__.py +2 -2
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/cmethod_tab.py +2 -1
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/help_menu.py +26 -28
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/integral_tab.py +2 -1
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/rcwa_tab.py +2 -1
- gratinglab-0.3.10/src/gratinglab/gui/qt/recent.py +14 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/scalar_tab.py +2 -1
- gratinglab-0.3.10/src/gratinglab/gui/qt/theming.py +57 -0
- gratinglab-0.3.10/src/gratinglab/gui/qt/theory_viewer.py +93 -0
- gratinglab-0.3.10/src/gratinglab/gui/richtext.py +64 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/theme.py +27 -131
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/io/boundary.py +4 -2
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/io/ggp.py +2 -1
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/wiki_view.py +41 -19
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/io/metrics.py +3 -1
- {gratinglab-0.3.8 → gratinglab-0.3.10/src/gratinglab.egg-info}/PKG-INFO +3 -3
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab.egg-info/SOURCES.txt +0 -1
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab.egg-info/requires.txt +2 -2
- gratinglab-0.3.10/tests/test_gui_mathtext.py +40 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_qt.py +2 -1
- gratinglab-0.3.10/tests/test_gui_richtext.py +146 -0
- gratinglab-0.3.8/src/gratinglab/gui/mathtext.py +0 -292
- gratinglab-0.3.8/src/gratinglab/gui/qt/recent.py +0 -59
- gratinglab-0.3.8/src/gratinglab/gui/qt/theming.py +0 -249
- gratinglab-0.3.8/src/gratinglab/gui/qt/theory_viewer.py +0 -225
- gratinglab-0.3.8/src/gratinglab/gui/richtext.py +0 -518
- gratinglab-0.3.8/tests/test_gui_mathtext.py +0 -216
- gratinglab-0.3.8/tests/test_gui_richtext.py +0 -474
- {gratinglab-0.3.8 → gratinglab-0.3.10}/LICENSE +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/MANIFEST.in +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/README.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/docs/conventions.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/docs/theory/cmethod.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/docs/theory/integral.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/docs/theory/metrology.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/docs/theory/rcwa.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/docs/theory/scalar.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/setup.cfg +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/setup.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/checks.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/compare.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/convergence.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/geometry.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/app.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/cmethod_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/comparison.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/diagram.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/diagram3d.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/docs.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/efficiency_plot.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/failures.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/icon.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/integral_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/launcher.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/orders.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/provenance.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/compare_tab.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/geometry_panel.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/geometry_tab.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/launcher.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/main_window.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/profile_plot_panel.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/provenance_panel.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/scene3d_panel.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/setup_tab.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/sizing.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/qt/worker.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/rcwa_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/scalar_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/gui/state.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/illumination.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/io/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/io/efficiency_table.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/io/txl.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/materials/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/materials/data/SOURCES.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/materials/fresnel.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/materials/optical.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/materials/refractiveindex.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/materials/typical.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/measured.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/_analyzer_summary.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/analyzer.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/boundary/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/boundary/average.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/boundary/cross_section.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/boundary/pipeline.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/boundary/swaths.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/cli.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/config.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/analysis.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/image_flatten.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/orientation.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/processing.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/region_mask.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/scars.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/core/tip.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/data/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/data/aggregation.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/icon.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/app.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/boundary_view.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/canvas.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/efficiency_dialog.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/import_view.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/layout.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/main_window.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/swath_dialog.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/qt/worker.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/gui/state.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/io/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/io/file_io.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/io/ibw.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/io/sem.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/io/spm.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/settings.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/stats/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/stats/analysis.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/stats/icc.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/visualization/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/visualization/diagnostics.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/visualization/profiles.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/visualization/statistics.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/facet-fitting.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/file-formats.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/flattening.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/groove-orientation.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/icc-correction.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/overview.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/reading-outputs.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/row-groups.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/scars-and-masking.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/swath-statistics.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/wiki/tip-correction.md +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/metrology/workflows.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/problem.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/profiles/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/profiles/_base.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/profiles/_polyline.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/profiles/_shapes.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/profiles/_trapezoid.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/profiles/_types.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/resolution.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/result.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/_conditioning.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/_execution.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/_scalar_groove.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/base.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/cmethod/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/cmethod/_core.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/cmethod/_series.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/integral/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/integral/_boundary.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/integral/_core.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/integral/_finite.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/integral/_greens.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/integral/_kernels.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/integral/_nystrom.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/rcwa/__init__.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/rcwa/_core.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/rcwa/_stack.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab/solvers/scalar.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab.egg-info/dependency_links.txt +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab.egg-info/entry_points.txt +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/src/gratinglab.egg-info/top_level.txt +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_changelog.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_checks.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_cmethod.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_compare.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_conditioning.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_convergence.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_cross_method.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_efficiency_table.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_four_way.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_fresnel.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_geometry.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_ggp.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_cmethod_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_cmethod_tab.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_compare_tab.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_diagram.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_diagram3d.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_docs.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_help_menu.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_integral_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_launcher.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_orders.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_polish.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_provenance.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_provenance_panel.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_rcwa_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_scalar_options.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_state.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_gui_theme.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_illumination.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_core.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_corpus.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_finite.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_graded.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_greens.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_kernels.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_measured_polygon.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_operators.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_integral_solver.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_io_boundary.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_littrow.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_materials.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_measured.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_perturbation.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_profiles.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_rayleigh_anomaly.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_rcwa.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_rcwa_benchmarks.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_refractiveindex.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_resolution.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_result.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_scalar.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_solver_conformance.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_solver_execution.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_solver_progress.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_trapezoidal_solvers.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_txl.py +0 -0
- {gratinglab-0.3.8 → gratinglab-0.3.10}/tests/test_typical.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gratinglab
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.10
|
|
4
4
|
Summary: Open platform for diffraction grating groove metrology and efficiency analysis
|
|
5
5
|
Author: Jake McCoy, Aditi Gangadharan
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
@@ -21,7 +21,7 @@ License-File: LICENSE
|
|
|
21
21
|
Requires-Dist: numpy>=1.26
|
|
22
22
|
Requires-Dist: scipy>=1.11
|
|
23
23
|
Requires-Dist: pydantic>=2.6
|
|
24
|
-
Requires-Dist: endstation>=0.
|
|
24
|
+
Requires-Dist: endstation>=0.4.0
|
|
25
25
|
Requires-Dist: threadpoolctl>=3.1
|
|
26
26
|
Provides-Extra: dev
|
|
27
27
|
Requires-Dist: pytest>=9.2; extra == "dev"
|
|
@@ -33,7 +33,7 @@ Provides-Extra: gui
|
|
|
33
33
|
Requires-Dist: matplotlib>=3.8; extra == "gui"
|
|
34
34
|
Requires-Dist: PySide6-Essentials!=6.12.0,>=6.7; python_version < "3.12" and extra == "gui"
|
|
35
35
|
Requires-Dist: PySide6-Essentials>=6.7; python_version >= "3.12" and extra == "gui"
|
|
36
|
-
Requires-Dist: endstation[qt]>=0.
|
|
36
|
+
Requires-Dist: endstation[qt]>=0.4.0; extra == "gui"
|
|
37
37
|
Provides-Extra: metrology
|
|
38
38
|
Requires-Dist: matplotlib>=3.9; extra == "metrology"
|
|
39
39
|
Provides-Extra: refractiveindex
|
|
@@ -54,7 +54,7 @@ dependencies = [
|
|
|
54
54
|
# `dependencies = []` and has a test that fails if that stops being true,
|
|
55
55
|
# so this line adds no transitive weight -- the Qt and matplotlib parts sit
|
|
56
56
|
# behind its own extras, which our `gui` extra asks for by name.
|
|
57
|
-
"endstation>=0.
|
|
57
|
+
"endstation>=0.4.0",
|
|
58
58
|
# The rigorous solvers cap BLAS threads for the length of a solve
|
|
59
59
|
# (solvers/_execution.py): OpenBLAS's thread-per-core default made RCWA
|
|
60
60
|
# up to 135x slower on a busy machine, measured in benchmarks/
|
|
@@ -101,7 +101,7 @@ gui = [
|
|
|
101
101
|
"matplotlib>=3.8",
|
|
102
102
|
"PySide6-Essentials>=6.7,!=6.12.0; python_version < '3.12'",
|
|
103
103
|
"PySide6-Essentials>=6.7; python_version >= '3.12'",
|
|
104
|
-
"endstation[qt]>=0.
|
|
104
|
+
"endstation[qt]>=0.4.0",
|
|
105
105
|
]
|
|
106
106
|
# Groove metrology: reading AFM scans and averaging them into a boundary
|
|
107
107
|
# profile. An extra for the same reason the GUI is one -- `pip install
|
|
@@ -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.10"
|
|
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.8"
|
|
|
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-
|
|
35
|
+
__version_date__ = "2026-11-14"
|
|
36
36
|
|
|
37
37
|
__all__ = [
|
|
38
38
|
"Illumination",
|
|
@@ -21,6 +21,7 @@ import dataclasses
|
|
|
21
21
|
from pathlib import Path
|
|
22
22
|
from typing import Sequence
|
|
23
23
|
|
|
24
|
+
from endstation.files import atomic_open
|
|
24
25
|
from PySide6.QtCore import Qt, Signal
|
|
25
26
|
from PySide6.QtWidgets import (
|
|
26
27
|
QAbstractItemView,
|
|
@@ -445,7 +446,7 @@ class CMethodTab(QWidget):
|
|
|
445
446
|
return
|
|
446
447
|
recent.remember("exports", path)
|
|
447
448
|
rows = self._scan.to_records()
|
|
448
|
-
with
|
|
449
|
+
with atomic_open(path, newline="", encoding="utf-8") as handle:
|
|
449
450
|
writer = csv.DictWriter(handle, fieldnames=list(rows[0]))
|
|
450
451
|
writer.writeheader()
|
|
451
452
|
writer.writerows(rows)
|
|
@@ -16,29 +16,30 @@ at once.
|
|
|
16
16
|
``menu_bar`` exists because the chooser is a plain ``QWidget`` and has no
|
|
17
17
|
``menuBar()`` of its own; it hands in the one it put in its layout. The
|
|
18
18
|
windows pass nothing and get theirs.
|
|
19
|
+
|
|
20
|
+
The menu itself is built by :func:`endstation.qt.help_menu.install_help_menu`;
|
|
21
|
+
what this module supplies is the About text and the pages.
|
|
19
22
|
"""
|
|
20
23
|
|
|
21
24
|
from __future__ import annotations
|
|
22
25
|
|
|
26
|
+
from endstation.qt.help_menu import HELP_MENU_TITLE
|
|
27
|
+
from endstation.qt.help_menu import install_help_menu as _install
|
|
23
28
|
from PySide6.QtWidgets import QMessageBox
|
|
24
29
|
|
|
25
30
|
__all__ = ["HELP_MENU_TITLE", "install_help_menu", "show_about", "show_theory"]
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
def _about_text() -> str:
|
|
33
|
+
from ... import __version__, __version_date__
|
|
34
|
+
from .. import provenance
|
|
35
|
+
|
|
36
|
+
return provenance.about_text(__version__, __version_date__)
|
|
29
37
|
|
|
30
38
|
|
|
31
39
|
def show_about(parent=None) -> None:
|
|
32
40
|
"""The About box. Its text is :func:`gratinglab.gui.provenance.about_text`,
|
|
33
41
|
which is a plain string so it can be asserted without a dialog."""
|
|
34
|
-
|
|
35
|
-
from .. import provenance
|
|
36
|
-
|
|
37
|
-
QMessageBox.about(
|
|
38
|
-
parent,
|
|
39
|
-
"About gratinglab",
|
|
40
|
-
provenance.about_text(__version__, __version_date__),
|
|
41
|
-
)
|
|
42
|
+
QMessageBox.about(parent, "About gratinglab", _about_text())
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def show_theory(page, parent=None):
|
|
@@ -68,26 +69,23 @@ def install_help_menu(window, menu_bar=None):
|
|
|
68
69
|
from ..docs import general_pages, theory_pages
|
|
69
70
|
from ..richtext import menu_label
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
def entry(page, suffix):
|
|
73
|
+
return (menu_label(page.title, suffix), lambda: show_theory(page, window))
|
|
74
|
+
|
|
75
|
+
def missing(page):
|
|
76
|
+
return "" if page.available else " (not written yet)"
|
|
75
77
|
|
|
76
78
|
# Foundational, solver-independent reference first -- the generalized
|
|
77
79
|
# grating equation and the angle conventions -- then one page per method.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
menu_label(page.title, suffix),
|
|
89
|
-
lambda p=page: show_theory(p, window),
|
|
90
|
-
)
|
|
91
|
-
|
|
80
|
+
menu = _install(
|
|
81
|
+
window,
|
|
82
|
+
about_title="About gratinglab",
|
|
83
|
+
about_text=_about_text,
|
|
84
|
+
pages=[
|
|
85
|
+
[entry(page, missing(page)) for page in general_pages()],
|
|
86
|
+
[entry(page, " Theory" + missing(page)) for page in theory_pages()],
|
|
87
|
+
],
|
|
88
|
+
menu_bar=menu_bar,
|
|
89
|
+
)
|
|
92
90
|
window._gratinglab_help_menu = menu
|
|
93
91
|
return menu
|
|
@@ -21,6 +21,7 @@ import dataclasses
|
|
|
21
21
|
from pathlib import Path
|
|
22
22
|
from typing import Sequence
|
|
23
23
|
|
|
24
|
+
from endstation.files import atomic_open
|
|
24
25
|
from PySide6.QtCore import Qt, Signal
|
|
25
26
|
from PySide6.QtWidgets import (
|
|
26
27
|
QAbstractItemView,
|
|
@@ -481,7 +482,7 @@ class IntegralTab(QWidget):
|
|
|
481
482
|
return
|
|
482
483
|
recent.remember("exports", path)
|
|
483
484
|
rows = self._scan.to_records()
|
|
484
|
-
with
|
|
485
|
+
with atomic_open(path, newline="", encoding="utf-8") as handle:
|
|
485
486
|
writer = csv.DictWriter(handle, fieldnames=list(rows[0]))
|
|
486
487
|
writer.writeheader()
|
|
487
488
|
writer.writerows(rows)
|
|
@@ -20,6 +20,7 @@ import dataclasses
|
|
|
20
20
|
from pathlib import Path
|
|
21
21
|
from typing import Sequence
|
|
22
22
|
|
|
23
|
+
from endstation.files import atomic_open
|
|
23
24
|
from PySide6.QtCore import Qt, Signal
|
|
24
25
|
from PySide6.QtWidgets import (
|
|
25
26
|
QAbstractItemView,
|
|
@@ -442,7 +443,7 @@ class RcwaTab(QWidget):
|
|
|
442
443
|
return
|
|
443
444
|
recent.remember("exports", path)
|
|
444
445
|
rows = self._scan.to_records()
|
|
445
|
-
with
|
|
446
|
+
with atomic_open(path, newline="", encoding="utf-8") as handle:
|
|
446
447
|
writer = csv.DictWriter(handle, fieldnames=list(rows[0]))
|
|
447
448
|
writer.writeheader()
|
|
448
449
|
writer.writerows(rows)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""The last folder per kind of file, and window layout: :mod:`endstation.qt.recent`.
|
|
2
|
+
|
|
3
|
+
Kept as a module so the windows and dialogs import it from here. It writes to
|
|
4
|
+
the store :mod:`gratinglab.gui.qt.theming` names, so ``GRATINGLAB_SETTINGS``
|
|
5
|
+
redirects it with the theme.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from endstation.qt.recent import remember, restore_layout, save_layout, start_in
|
|
11
|
+
|
|
12
|
+
from . import theming as _theming # noqa: F401 - names the settings store
|
|
13
|
+
|
|
14
|
+
__all__ = ["start_in", "remember", "restore_layout", "save_layout"]
|
|
@@ -18,6 +18,7 @@ import dataclasses
|
|
|
18
18
|
from pathlib import Path
|
|
19
19
|
from typing import Sequence
|
|
20
20
|
|
|
21
|
+
from endstation.files import atomic_open
|
|
21
22
|
from PySide6.QtCore import Qt, Signal
|
|
22
23
|
from PySide6.QtWidgets import (
|
|
23
24
|
QAbstractItemView,
|
|
@@ -513,7 +514,7 @@ class ScalarTab(QWidget):
|
|
|
513
514
|
return
|
|
514
515
|
recent.remember("exports", path)
|
|
515
516
|
rows = self._scan.to_records()
|
|
516
|
-
with
|
|
517
|
+
with atomic_open(path, newline="", encoding="utf-8") as handle:
|
|
517
518
|
writer = csv.DictWriter(handle, fieldnames=list(rows[0]))
|
|
518
519
|
writer.writeheader()
|
|
519
520
|
writer.writerows(rows)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""gratinglab's themes, applied by :mod:`endstation.qt.theming`.
|
|
2
|
+
|
|
3
|
+
The manager, the View > Theme menu, the palette and the settings store are
|
|
4
|
+
endstation's. This module names the store and passes gratinglab's themes
|
|
5
|
+
(:mod:`gratinglab.gui.theme`, which add the diagram and order colours), so
|
|
6
|
+
the rest of the package keeps importing from here.
|
|
7
|
+
|
|
8
|
+
The choice is stored with ``QSettings`` under ``gratinglab``.
|
|
9
|
+
``GRATINGLAB_SETTINGS`` names an INI file to use instead, which is what the
|
|
10
|
+
test suite sets, the same arrangement as ``GRATINGLAB_MATERIALS``: a run of
|
|
11
|
+
the tests must never write to the user's own settings.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
from endstation.qt import settings as _settings_store
|
|
17
|
+
from endstation.qt import theming as _theming
|
|
18
|
+
from endstation.qt.theming import ThemeManager, ThemeMenu, manager, palette, subscribe, swatch
|
|
19
|
+
from PySide6.QtGui import QIcon
|
|
20
|
+
from PySide6.QtWidgets import QApplication
|
|
21
|
+
|
|
22
|
+
from ..theme import LIGHT, THEMES, Theme
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"QIcon",
|
|
26
|
+
"SETTINGS_ENV",
|
|
27
|
+
"ThemeMenu",
|
|
28
|
+
"ThemeManager",
|
|
29
|
+
"current",
|
|
30
|
+
"install",
|
|
31
|
+
"manager",
|
|
32
|
+
"palette",
|
|
33
|
+
"settings",
|
|
34
|
+
"subscribe",
|
|
35
|
+
"swatch",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
#: Names an INI file to keep settings in instead of the platform's store.
|
|
39
|
+
SETTINGS_ENV = "GRATINGLAB_SETTINGS"
|
|
40
|
+
|
|
41
|
+
# At import, so every entry point (both windows, the chooser, a test) reads
|
|
42
|
+
# and writes the same store. The organization and application names are the
|
|
43
|
+
# ones the store had before it moved to endstation, so saved choices carry over.
|
|
44
|
+
_settings_store.configure("gratinglab", "gratinglab", env=SETTINGS_ENV)
|
|
45
|
+
|
|
46
|
+
settings = _settings_store.settings
|
|
47
|
+
_settings = settings
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def install(app: QApplication) -> ThemeManager:
|
|
51
|
+
"""The application's manager with gratinglab's themes, created on first call."""
|
|
52
|
+
return _theming.install(app, THEMES)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def current() -> Theme:
|
|
56
|
+
"""The theme in effect, or :data:`gratinglab.gui.theme.LIGHT` before any is installed."""
|
|
57
|
+
return _theming.current(LIGHT)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""The read-only window for one theory or reference page.
|
|
2
|
+
|
|
3
|
+
The pane and the rendering are endstation's (:mod:`endstation.qt.reading`):
|
|
4
|
+
a ``QTextBrowser`` laid out for reading, with the page's equations sized to
|
|
5
|
+
its font. This module adds what is gratinglab's: the approximate-method banner
|
|
6
|
+
(:func:`gratinglab.gui.richtext.banner`), links between Help pages opening in
|
|
7
|
+
windows of their own, and a re-render when the theme changes.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from endstation.qt.reading import ReadingBrowser, text_color
|
|
13
|
+
from endstation.qt.reading import render_into as _render_into
|
|
14
|
+
from PySide6.QtCore import Qt, QUrl
|
|
15
|
+
from PySide6.QtGui import QDesktopServices
|
|
16
|
+
from PySide6.QtWidgets import QTextBrowser, QVBoxLayout, QWidget
|
|
17
|
+
|
|
18
|
+
from .. import richtext
|
|
19
|
+
from ..docs import resolve_link
|
|
20
|
+
|
|
21
|
+
__all__ = ["ReadingBrowser", "TheoryViewer", "render_into"]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def render_into(
|
|
25
|
+
browser: QTextBrowser, page, *, device_pixel_ratio: float, text_color: str
|
|
26
|
+
) -> None:
|
|
27
|
+
"""Render a page into a browser, banner and images included.
|
|
28
|
+
|
|
29
|
+
Shared by :class:`TheoryViewer` and :class:`~.setup_tab.SetupTab`.
|
|
30
|
+
"""
|
|
31
|
+
_render_into(
|
|
32
|
+
browser,
|
|
33
|
+
page.text,
|
|
34
|
+
device_pixel_ratio=device_pixel_ratio,
|
|
35
|
+
text_color=text_color,
|
|
36
|
+
before=richtext.banner(page),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class TheoryViewer(QWidget):
|
|
41
|
+
"""One page, typeset."""
|
|
42
|
+
|
|
43
|
+
def __init__(self, page, parent: QWidget | None = None) -> None:
|
|
44
|
+
# A window in its own right rather than a modal dialog: reading the
|
|
45
|
+
# theory while adjusting the grating is the point.
|
|
46
|
+
super().__init__(parent)
|
|
47
|
+
self.setWindowFlag(Qt.WindowType.Window)
|
|
48
|
+
self.setWindowTitle(page.title)
|
|
49
|
+
self.resize(860, 720)
|
|
50
|
+
|
|
51
|
+
self._browser = ReadingBrowser()
|
|
52
|
+
self._browser.setOpenExternalLinks(False)
|
|
53
|
+
# QTextBrowser would load a relative link as a file in this window and
|
|
54
|
+
# show raw markdown, so links are followed here instead.
|
|
55
|
+
self._browser.setOpenLinks(False)
|
|
56
|
+
self._browser.anchorClicked.connect(self._follow)
|
|
57
|
+
#: The last page a link opened, held so its window is not collected.
|
|
58
|
+
self.opened: TheoryViewer | None = None
|
|
59
|
+
|
|
60
|
+
layout = QVBoxLayout(self)
|
|
61
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
62
|
+
layout.addWidget(self._browser)
|
|
63
|
+
|
|
64
|
+
self.set_page(page)
|
|
65
|
+
from . import theming
|
|
66
|
+
|
|
67
|
+
# Equations are images rasterised in the text colour, so a theme
|
|
68
|
+
# change re-renders the page rather than only repainting it.
|
|
69
|
+
theming.subscribe(self._on_theme)
|
|
70
|
+
|
|
71
|
+
def _follow(self, url: QUrl) -> None:
|
|
72
|
+
"""Open a linked Help page in a window of its own, beside this one,
|
|
73
|
+
the way the Help menu opens them; anything else goes to the browser."""
|
|
74
|
+
target = resolve_link(self._page, url.toString())
|
|
75
|
+
if isinstance(target, str):
|
|
76
|
+
QDesktopServices.openUrl(QUrl(target))
|
|
77
|
+
elif target is not None:
|
|
78
|
+
self.opened = TheoryViewer(target, parent=self.parentWidget())
|
|
79
|
+
self.opened.show()
|
|
80
|
+
|
|
81
|
+
def _on_theme(self, _theme) -> None:
|
|
82
|
+
# A bound method so Qt disconnects it with the window (see SetupTab).
|
|
83
|
+
self.set_page(self._page)
|
|
84
|
+
|
|
85
|
+
def set_page(self, page) -> None:
|
|
86
|
+
"""Render a page into the browser, images and all."""
|
|
87
|
+
self._page = page
|
|
88
|
+
render_into(
|
|
89
|
+
self._browser,
|
|
90
|
+
page,
|
|
91
|
+
device_pixel_ratio=self.devicePixelRatioF(),
|
|
92
|
+
text_color=text_color(self),
|
|
93
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""What gratinglab adds to endstation's rendering of a Help page.
|
|
2
|
+
|
|
3
|
+
The markdown and the equations are rendered by :mod:`endstation.docs.markdown`,
|
|
4
|
+
which began as this module. Two things stay here because they are about
|
|
5
|
+
gratinglab's pages rather than markdown: the banner above the page of a
|
|
6
|
+
solver that approximates, and the escaping a page title needs to become a
|
|
7
|
+
menu entry.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from typing import TYPE_CHECKING
|
|
13
|
+
|
|
14
|
+
from endstation.docs.markdown import RichPage, render_markdown
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING: # pragma: no cover - imports for type checkers only
|
|
17
|
+
from .docs import TheoryPage
|
|
18
|
+
|
|
19
|
+
__all__ = ["BANNER_COLOR", "banner", "menu_label", "to_html"]
|
|
20
|
+
|
|
21
|
+
#: Colour of the approximate-method banner. The same as endstation's colour
|
|
22
|
+
#: for an equation that failed to render, and kept as its own constant: the
|
|
23
|
+
#: two facts are unrelated, and a test that cannot tell them apart could one
|
|
24
|
+
#: day pass for the wrong reason.
|
|
25
|
+
BANNER_COLOR = "#a5370d"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def banner(page: "TheoryPage") -> str:
|
|
29
|
+
"""The HTML placed above the page, empty for a rigorous solver.
|
|
30
|
+
|
|
31
|
+
A solver whose ``Capabilities.rigorous`` is False says so at the top, so a
|
|
32
|
+
reader learns about the approximation before section 7 rather than in it.
|
|
33
|
+
"""
|
|
34
|
+
if page.rigorous:
|
|
35
|
+
return ""
|
|
36
|
+
return (
|
|
37
|
+
f'<p style="color:{BANNER_COLOR}"><b>'
|
|
38
|
+
"⚠ Approximate method: see Limits below."
|
|
39
|
+
"</b></p>"
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_html(page: "TheoryPage", **kwargs) -> RichPage:
|
|
44
|
+
"""A page rendered by :func:`endstation.docs.markdown.render_markdown`,
|
|
45
|
+
banner included. ``kwargs`` go to ``render_markdown``."""
|
|
46
|
+
rendered = render_markdown(page.text, **kwargs)
|
|
47
|
+
notice = banner(page)
|
|
48
|
+
if not notice:
|
|
49
|
+
return rendered
|
|
50
|
+
return RichPage(
|
|
51
|
+
html=notice + "\n" + rendered.html,
|
|
52
|
+
images=rendered.images,
|
|
53
|
+
unrendered=rendered.unrendered,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def menu_label(title: str, suffix: str = "") -> str:
|
|
58
|
+
"""A menu entry's text, with Qt's mnemonic character neutralised.
|
|
59
|
+
|
|
60
|
+
Qt reads ``&`` in an action's text as "underline the next character", so
|
|
61
|
+
the page titled "Grating Geometry & Conventions" would appear as "Grating
|
|
62
|
+
Geometry Conventions" with a stray underline. Doubling it escapes it.
|
|
63
|
+
"""
|
|
64
|
+
return (title + suffix).replace("&", "&&")
|