gratinglab 0.5.0__tar.gz → 0.5.1__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.5.0/src/gratinglab.egg-info → gratinglab-0.5.1}/PKG-INFO +4 -1
- {gratinglab-0.5.0 → gratinglab-0.5.1}/README.md +3 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/__init__.py +57 -1
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/coatings_window.py +27 -1
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/main_window.py +48 -1
- gratinglab-0.5.1/src/gratinglab/gui/script.py +204 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/__init__.py +12 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1/src/gratinglab.egg-info}/PKG-INFO +4 -1
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab.egg-info/SOURCES.txt +3 -0
- gratinglab-0.5.1/tests/test_examples.py +66 -0
- gratinglab-0.5.1/tests/test_gui_script.py +206 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/LICENSE +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/MANIFEST.in +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/docs/conventions.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/docs/theory/cmethod.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/docs/theory/integral.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/docs/theory/metrology.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/docs/theory/mirror.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/docs/theory/rcwa.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/docs/theory/scalar.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/pyproject.toml +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/setup.cfg +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/setup.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/checks.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/compare.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/convergence.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/geometry.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/app.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/camera3d.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/cmethod_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/comparison.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/diagram.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/diagram3d.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/docs.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/efficiency_plot.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/failures.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/icon.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/integral_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/label_layout.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/launcher.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/materials_view.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/mirror_view.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/orders.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/provenance.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/cmethod_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/compare_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/geometry_panel.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/geometry_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/geometry_window.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/help_menu.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/integral_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/launcher.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/library_bar.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/materials_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/mirror_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/profile_plot_panel.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/provenance_panel.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/rcwa_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/recent.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/scalar_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/scene3d_panel.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/setup_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/sizing.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/stack_editor.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/theming.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/theory_viewer.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/qt/worker.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/rcwa_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/richtext.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/scalar_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/state.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/gui/theme.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/illumination.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/io/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/io/boundary.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/io/efficiency_table.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/io/ggp.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/io/txl.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/data/SOURCES.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/elements.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/factors.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/fresnel.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/nk.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/optical.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/refractiveindex.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/materials/typical.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/measured.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/_analyzer_summary.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/analyzer.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/boundary/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/boundary/average.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/boundary/cross_section.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/boundary/pipeline.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/boundary/swaths.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/cli.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/config.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/analysis.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/image_flatten.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/orientation.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/processing.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/region_mask.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/scars.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/core/tip.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/data/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/data/aggregation.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/icon.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/app.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/boundary_view.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/canvas.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/efficiency_dialog.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/import_view.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/layout.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/main_window.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/swath_dialog.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/wiki_view.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/qt/worker.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/gui/state.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/io/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/io/file_io.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/io/ibw.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/io/metrics.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/io/sem.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/io/spm.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/settings.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/stats/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/stats/analysis.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/stats/icc.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/visualization/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/visualization/diagnostics.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/visualization/profiles.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/visualization/statistics.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/facet-fitting.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/file-formats.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/flattening.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/groove-orientation.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/icc-correction.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/overview.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/reading-outputs.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/row-groups.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/scars-and-masking.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/swath-statistics.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/wiki/tip-correction.md +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/metrology/workflows.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/mirror.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/problem.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/profiles/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/profiles/_base.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/profiles/_polyline.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/profiles/_shapes.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/profiles/_trapezoid.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/profiles/_types.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/resolution.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/result.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/_conditioning.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/_execution.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/_scalar_groove.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/base.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/cmethod/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/cmethod/_core.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/cmethod/_series.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/integral/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/integral/_boundary.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/integral/_core.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/integral/_finite.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/integral/_greens.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/integral/_kernels.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/integral/_nystrom.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/rcwa/__init__.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/rcwa/_core.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/rcwa/_stack.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab/solvers/scalar.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab.egg-info/dependency_links.txt +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab.egg-info/entry_points.txt +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab.egg-info/requires.txt +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/src/gratinglab.egg-info/top_level.txt +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_changelog.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_checks.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_cmethod.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_compare.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_conditioning.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_convergence.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_cross_method.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_efficiency_table.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_factors.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_four_way.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_fresnel.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_geometry.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_ggp.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_camera3d.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_cmethod_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_cmethod_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_coatings_window.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_compare_tab.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_diagram.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_diagram3d.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_docs.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_geometry_window.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_help_menu.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_integral_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_launcher.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_mathtext.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_orders.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_polish.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_provenance.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_provenance_panel.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_qt.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_rcwa_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_richtext.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_scalar_options.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_stack_editor.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_state.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_gui_theme.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_illumination.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_core.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_corpus.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_finite.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_graded.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_greens.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_kernels.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_measured_polygon.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_operators.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_integral_solver.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_io_boundary.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_label_layout.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_littrow.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_materials.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_materials_view.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_measured.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_mirror.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_mirror_view.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_nk.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_perturbation.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_profiles.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_rayleigh_anomaly.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_rcwa.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_rcwa_benchmarks.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_refractiveindex.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_resolution.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_result.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_scalar.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_solver_conformance.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_solver_execution.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_solver_progress.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_trapezoidal_solvers.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_txl.py +0 -0
- {gratinglab-0.5.0 → gratinglab-0.5.1}/tests/test_typical.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gratinglab
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.1
|
|
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
|
|
@@ -447,10 +447,13 @@ icon --app gratinglab` regenerates the icon from the artwork in `gratinglab.gui.
|
|
|
447
447
|
|
|
448
448
|
| Document | Contents |
|
|
449
449
|
|---|---|
|
|
450
|
+
| [`docs/python.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/python.md) | Using gratinglab from your own code: the objects, the result, materials, the mirror, and "Copy as Python" from the windows |
|
|
451
|
+
| [`examples/`](https://github.com/jamccoy/gratinglab/tree/master/examples) | Short scripts that use gratinglab from your own code: an efficiency scan, two solvers compared, your own optical constants, a coating as a mirror, a parameter sweep; with a table of what to import for what |
|
|
450
452
|
| [`docs/roadmap.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/roadmap.md) | The current state of the project, planned work and open questions; the place to start |
|
|
451
453
|
| [`docs/conventions.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/conventions.md) | The normative definitions: signs, units, normalizations, and errata in the references |
|
|
452
454
|
| [`docs/theory/scalar.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/scalar.md) | The derivation of the scalar solver, its closed-form results and its limits |
|
|
453
455
|
| [`docs/theory/integral.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/integral.md) | The boundary-integral solver: conical formulation, perfect and finite conductivity |
|
|
456
|
+
| [`docs/theory/mirror.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/mirror.md) | The coating as a flat mirror: the recursion, what the penetration depth and bulk thickness mean, and what is and is not validated |
|
|
454
457
|
| [`docs/theory/metrology.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/metrology.md) | The assumptions of the AFM pipeline, what it measures and what it does not, including what tip erosion can recover |
|
|
455
458
|
| [`docs/typical-materials.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/typical-materials.md) | The X-ray index model used without a table, what it is checked against, and its measured accuracy |
|
|
456
459
|
| [`docs/findings.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/findings.md) | Empirical results, each with the evidence for it |
|
|
@@ -403,10 +403,13 @@ icon --app gratinglab` regenerates the icon from the artwork in `gratinglab.gui.
|
|
|
403
403
|
|
|
404
404
|
| Document | Contents |
|
|
405
405
|
|---|---|
|
|
406
|
+
| [`docs/python.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/python.md) | Using gratinglab from your own code: the objects, the result, materials, the mirror, and "Copy as Python" from the windows |
|
|
407
|
+
| [`examples/`](https://github.com/jamccoy/gratinglab/tree/master/examples) | Short scripts that use gratinglab from your own code: an efficiency scan, two solvers compared, your own optical constants, a coating as a mirror, a parameter sweep; with a table of what to import for what |
|
|
406
408
|
| [`docs/roadmap.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/roadmap.md) | The current state of the project, planned work and open questions; the place to start |
|
|
407
409
|
| [`docs/conventions.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/conventions.md) | The normative definitions: signs, units, normalizations, and errata in the references |
|
|
408
410
|
| [`docs/theory/scalar.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/scalar.md) | The derivation of the scalar solver, its closed-form results and its limits |
|
|
409
411
|
| [`docs/theory/integral.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/integral.md) | The boundary-integral solver: conical formulation, perfect and finite conductivity |
|
|
412
|
+
| [`docs/theory/mirror.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/mirror.md) | The coating as a flat mirror: the recursion, what the penetration depth and bulk thickness mean, and what is and is not validated |
|
|
410
413
|
| [`docs/theory/metrology.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/metrology.md) | The assumptions of the AFM pipeline, what it measures and what it does not, including what tip erosion can recover |
|
|
411
414
|
| [`docs/typical-materials.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/typical-materials.md) | The X-ray index model used without a table, what it is checked against, and its measured accuracy |
|
|
412
415
|
| [`docs/findings.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/findings.md) | Empirical results, each with the evidence for it |
|
|
@@ -13,16 +13,59 @@ lengths in nm, angles in degrees at the API boundary.
|
|
|
13
13
|
>>> from gratinglab import Illumination
|
|
14
14
|
>>> Illumination.offplane(graze=1.5, azimuth=0.97).gamma_deg
|
|
15
15
|
1.5
|
|
16
|
+
|
|
17
|
+
What a script needs is importable from here::
|
|
18
|
+
|
|
19
|
+
from gratinglab import Problem, Blazed, Illumination, solve, materials, Mirror
|
|
20
|
+
|
|
21
|
+
The grating, the profiles, the light and the result types are imported with
|
|
22
|
+
the package. The solvers, the comparison and the mirror are looked up on first
|
|
23
|
+
use (:func:`__getattr__`), so ``import gratinglab`` does not pay for scipy's
|
|
24
|
+
linear algebra until something is solved. ``examples/`` shows them in use.
|
|
16
25
|
"""
|
|
17
26
|
|
|
18
27
|
from __future__ import annotations
|
|
19
28
|
|
|
29
|
+
from importlib import import_module
|
|
30
|
+
from typing import TYPE_CHECKING
|
|
31
|
+
|
|
32
|
+
from . import materials
|
|
20
33
|
from .illumination import Illumination, Polarization
|
|
21
34
|
from .measured import MeasuredEfficiency, MeasurementProvenance
|
|
35
|
+
from .problem import ConformalLayer, Problem
|
|
36
|
+
from .profiles import Blazed, Lamellar, Sinusoidal, Trapezoidal
|
|
22
37
|
from .resolution import ResolvingPower, resolving_power
|
|
23
38
|
from .result import EfficiencyScan, OrderEfficiency, Provenance
|
|
24
39
|
|
|
25
|
-
|
|
40
|
+
if TYPE_CHECKING: # for editors and type checkers; at run time these are lazy
|
|
41
|
+
from .compare import align, sweep
|
|
42
|
+
from .mirror import Mirror
|
|
43
|
+
from .solvers import available_solvers, get_solver, solve
|
|
44
|
+
|
|
45
|
+
#: Names resolved on first use, and the module each lives in.
|
|
46
|
+
_LAZY = {
|
|
47
|
+
"solve": "gratinglab.solvers",
|
|
48
|
+
"get_solver": "gratinglab.solvers",
|
|
49
|
+
"available_solvers": "gratinglab.solvers",
|
|
50
|
+
"sweep": "gratinglab.compare",
|
|
51
|
+
"align": "gratinglab.compare",
|
|
52
|
+
"Mirror": "gratinglab.mirror",
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def __getattr__(name: str):
|
|
57
|
+
"""Import a lazy name's module the first time the name is asked for."""
|
|
58
|
+
if name in _LAZY:
|
|
59
|
+
value = getattr(import_module(_LAZY[name]), name)
|
|
60
|
+
globals()[name] = value # so the next lookup is an ordinary one
|
|
61
|
+
return value
|
|
62
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def __dir__() -> list[str]:
|
|
66
|
+
return sorted({*globals(), *_LAZY})
|
|
67
|
+
|
|
68
|
+
__version__ = "0.5.1"
|
|
26
69
|
|
|
27
70
|
#: The day this version was released, ISO 8601. It sits beside the version
|
|
28
71
|
#: rather than being read from CHANGELOG.md at run time because the changelog
|
|
@@ -35,8 +78,21 @@ __version__ = "0.5.0"
|
|
|
35
78
|
__version_date__ = "2026-11-17"
|
|
36
79
|
|
|
37
80
|
__all__ = [
|
|
81
|
+
"Problem",
|
|
82
|
+
"ConformalLayer",
|
|
83
|
+
"Blazed",
|
|
84
|
+
"Lamellar",
|
|
85
|
+
"Sinusoidal",
|
|
86
|
+
"Trapezoidal",
|
|
38
87
|
"Illumination",
|
|
39
88
|
"Polarization",
|
|
89
|
+
"solve",
|
|
90
|
+
"get_solver",
|
|
91
|
+
"available_solvers",
|
|
92
|
+
"sweep",
|
|
93
|
+
"align",
|
|
94
|
+
"Mirror",
|
|
95
|
+
"materials",
|
|
40
96
|
"EfficiencyScan",
|
|
41
97
|
"OrderEfficiency",
|
|
42
98
|
"Provenance",
|
|
@@ -131,7 +131,11 @@ class CoatingsWindow(QMainWindow):
|
|
|
131
131
|
send = self._file_menu.addAction("&Send to efficiency window")
|
|
132
132
|
send.setShortcut(QKeySequence("Ctrl+E"))
|
|
133
133
|
send.triggered.connect(self.send_to_efficiency)
|
|
134
|
-
self.
|
|
134
|
+
script = self._file_menu.addAction("Copy mirror as &Python")
|
|
135
|
+
script.setShortcut(QKeySequence("Ctrl+Shift+C"))
|
|
136
|
+
script.setToolTip("Copy a script that builds this stack and reflects it as the Mirror tab does")
|
|
137
|
+
script.triggered.connect(self.copy_as_python)
|
|
138
|
+
self._file_actions = {"send": send, "python": script}
|
|
135
139
|
|
|
136
140
|
self._view_menu = self._menu_bar.addMenu("&View")
|
|
137
141
|
toggle = self.stack_dock.toggleViewAction()
|
|
@@ -158,6 +162,28 @@ class CoatingsWindow(QMainWindow):
|
|
|
158
162
|
if not self.stack_dock.isVisible():
|
|
159
163
|
self.stack_dock.show()
|
|
160
164
|
|
|
165
|
+
def python_script(self) -> "str | None":
|
|
166
|
+
"""The Mirror tab's calculation as a script, computed afresh from the
|
|
167
|
+
dock so it is what is on screen; ``None`` when it does not compute,
|
|
168
|
+
which the tab's own panel then explains."""
|
|
169
|
+
from ..script import mirror_script
|
|
170
|
+
|
|
171
|
+
self.mirror_tab.calculate()
|
|
172
|
+
result = self.mirror_tab._result
|
|
173
|
+
return None if result is None else mirror_script(result)
|
|
174
|
+
|
|
175
|
+
def copy_as_python(self) -> None:
|
|
176
|
+
"""Put `python_script` on the clipboard, or show why there is none."""
|
|
177
|
+
script = self.python_script()
|
|
178
|
+
if script is None:
|
|
179
|
+
self.tabs.setCurrentWidget(self.mirror_tab)
|
|
180
|
+
self.statusBar().showMessage("Nothing copied: the Mirror tab says what to fix", 6000)
|
|
181
|
+
return
|
|
182
|
+
QApplication.clipboard().setText(script)
|
|
183
|
+
self.statusBar().showMessage(
|
|
184
|
+
f"Copied {len(script.splitlines())} lines of Python to the clipboard", 6000
|
|
185
|
+
)
|
|
186
|
+
|
|
161
187
|
def send_to_efficiency(self):
|
|
162
188
|
"""Copy this stack into the efficiency window, and return that window.
|
|
163
189
|
|
|
@@ -323,7 +323,11 @@ class MainWindow(QMainWindow):
|
|
|
323
323
|
coat = self._file_menu.addAction("Send &coating to coatings window")
|
|
324
324
|
coat.setShortcut(QKeySequence("Ctrl+K"))
|
|
325
325
|
coat.triggered.connect(self.send_to_coatings)
|
|
326
|
-
|
|
326
|
+
script = self._file_menu.addAction("Copy as &Python")
|
|
327
|
+
script.setShortcut(QKeySequence("Ctrl+Shift+C"))
|
|
328
|
+
script.setToolTip("Copy a script that rebuilds this problem and solves it as this tab would")
|
|
329
|
+
script.triggered.connect(self.copy_as_python)
|
|
330
|
+
self._file_actions = {"open": load, "solve": solve, "coatings": coat, "python": script}
|
|
327
331
|
|
|
328
332
|
self._view_menu = self._menu_bar.addMenu("&View")
|
|
329
333
|
toggle = self.geometry_dock.toggleViewAction()
|
|
@@ -389,6 +393,49 @@ class MainWindow(QMainWindow):
|
|
|
389
393
|
window.open_stack(form, marks_text(mount_markers(form)))
|
|
390
394
|
return window
|
|
391
395
|
|
|
396
|
+
def python_script(self) -> str:
|
|
397
|
+
"""What this window is showing, as a script: the problem, and the
|
|
398
|
+
solve the showing tab would run. A solver tab gives that solver with
|
|
399
|
+
its settings, the Compare tab the ticked solvers compared, and the
|
|
400
|
+
Setup and Grating Geometry tabs the problem alone. Raises
|
|
401
|
+
`FormErrors` when the geometry or a tab's settings do not parse."""
|
|
402
|
+
from ..script import efficiency_script
|
|
403
|
+
|
|
404
|
+
form = self.geometry.read_form()
|
|
405
|
+
geometry = build(form)
|
|
406
|
+
current = self._tab_widget.currentWidget()
|
|
407
|
+
name = getattr(current, "name", None)
|
|
408
|
+
if name in self.tabs:
|
|
409
|
+
names = (name,)
|
|
410
|
+
elif current is self.compare_tab:
|
|
411
|
+
names = self.compare_tab.selected()
|
|
412
|
+
else:
|
|
413
|
+
names = ()
|
|
414
|
+
options = {
|
|
415
|
+
n: self.tabs[n].build_options(geometry.problem, geometry.illumination, geometry.wavelengths)
|
|
416
|
+
for n in names
|
|
417
|
+
}
|
|
418
|
+
return efficiency_script(geometry, names, options, profile_path=form.profile_path)
|
|
419
|
+
|
|
420
|
+
def copy_as_python(self) -> None:
|
|
421
|
+
"""Put `python_script` on the clipboard, or say what stops it."""
|
|
422
|
+
from PySide6.QtWidgets import QApplication, QMessageBox
|
|
423
|
+
|
|
424
|
+
try:
|
|
425
|
+
script = self.python_script()
|
|
426
|
+
except FormErrors as exc:
|
|
427
|
+
QMessageBox.warning(
|
|
428
|
+
self,
|
|
429
|
+
"Nothing copied",
|
|
430
|
+
"Fix these before copying the problem as Python:\n\n"
|
|
431
|
+
+ "\n".join(f"{e.field}: {e.message}" for e in exc.errors),
|
|
432
|
+
)
|
|
433
|
+
return
|
|
434
|
+
QApplication.clipboard().setText(script)
|
|
435
|
+
self.statusBar().showMessage(
|
|
436
|
+
f"Copied {len(script.splitlines())} lines of Python to the clipboard", 6000
|
|
437
|
+
)
|
|
438
|
+
|
|
392
439
|
def _geometry_edited(self) -> None:
|
|
393
440
|
"""Schedule a redraw after a field was edited, without solving.
|
|
394
441
|
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""Write what a window is showing as a Python script.
|
|
2
|
+
|
|
3
|
+
"Copy as Python" in the efficiency and coatings windows puts one of these on
|
|
4
|
+
the clipboard: a short script that rebuilds the problem on screen and solves
|
|
5
|
+
it the way the window would, for a user who wants to take it from there in
|
|
6
|
+
code of their own, such as a sweep the window has no control for.
|
|
7
|
+
|
|
8
|
+
The script is generated from the *built* objects (the ``Problem``, the
|
|
9
|
+
``Illumination``, the wavelengths and the tab's options), not from the form's
|
|
10
|
+
text, so it is what the solver was actually given. Nothing here touches Qt;
|
|
11
|
+
``tests/test_gui_script.py`` runs the scripts it writes and compares them with
|
|
12
|
+
the window's own result.
|
|
13
|
+
|
|
14
|
+
Called by :mod:`gratinglab.gui.qt.main_window` and
|
|
15
|
+
:mod:`gratinglab.gui.qt.coatings_window`.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
from typing import Any, Mapping, Sequence
|
|
21
|
+
|
|
22
|
+
import numpy as np
|
|
23
|
+
from pydantic import BaseModel
|
|
24
|
+
|
|
25
|
+
from ..profiles import FromProfileData
|
|
26
|
+
|
|
27
|
+
__all__ = ["efficiency_script", "mirror_script"]
|
|
28
|
+
|
|
29
|
+
_HEADER = '"""{title}\n\nWritten by gratinglab {version}, "Copy as Python". Lengths are nm, angles degrees.\n"""\n'
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _version() -> str:
|
|
33
|
+
from .. import __version__
|
|
34
|
+
|
|
35
|
+
return __version__
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _value(value: Any) -> str:
|
|
39
|
+
"""A value as source: a model as its constructor call, the rest by repr."""
|
|
40
|
+
if isinstance(value, BaseModel):
|
|
41
|
+
return _call(value)
|
|
42
|
+
if isinstance(value, tuple):
|
|
43
|
+
inner = ", ".join(_value(v) for v in value)
|
|
44
|
+
return f"({inner},)" if len(value) == 1 else f"({inner})"
|
|
45
|
+
if isinstance(value, (np.floating, np.integer)):
|
|
46
|
+
return repr(value.item())
|
|
47
|
+
return repr(value)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _call(model: BaseModel, *, spread: bool = False, **replaced: str) -> str:
|
|
51
|
+
"""``Class(field=value, ...)`` for a pydantic model, leaving out fields
|
|
52
|
+
still at their default. ``replaced`` gives source for named fields, and
|
|
53
|
+
``spread`` puts one argument on a line, as a person would write a long one."""
|
|
54
|
+
parts = []
|
|
55
|
+
for name, field in type(model).model_fields.items():
|
|
56
|
+
value = getattr(model, name)
|
|
57
|
+
if name in replaced:
|
|
58
|
+
parts.append(f"{name}={replaced[name]}")
|
|
59
|
+
elif field.is_required() or value != field.default:
|
|
60
|
+
parts.append(f"{name}={_value(value)}")
|
|
61
|
+
if spread and len(parts) > 2:
|
|
62
|
+
return f"{type(model).__name__}(\n" + "".join(f" {part},\n" for part in parts) + ")"
|
|
63
|
+
return f"{type(model).__name__}({', '.join(parts)})"
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _wavelengths(values) -> str:
|
|
67
|
+
"""The scan as ``np.linspace`` when it is one, else the numbers."""
|
|
68
|
+
values = np.asarray(values, dtype=float)
|
|
69
|
+
if len(values) == 1:
|
|
70
|
+
return f"np.array([{values[0]!r}])"
|
|
71
|
+
even = np.linspace(values[0], values[-1], len(values))
|
|
72
|
+
if np.allclose(values, even, rtol=1e-12, atol=0.0):
|
|
73
|
+
return f"np.linspace({float(values[0])!r}, {float(values[-1])!r}, {len(values)})"
|
|
74
|
+
return f"np.array({[float(v) for v in values]!r})"
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def efficiency_script(
|
|
78
|
+
parsed,
|
|
79
|
+
methods: Sequence[str] = (),
|
|
80
|
+
options: Mapping[str, Mapping[str, Any]] | None = None,
|
|
81
|
+
profile_path: str = "",
|
|
82
|
+
) -> str:
|
|
83
|
+
"""The script for the efficiency window.
|
|
84
|
+
|
|
85
|
+
``parsed`` is the built geometry (``state.Parsed``). With one name in
|
|
86
|
+
``methods`` the script solves with it; with several it compares them, as
|
|
87
|
+
the Compare tab does; with none it stops at the problem, which is what
|
|
88
|
+
the Setup and Grating Geometry tabs show. ``options`` holds each method's
|
|
89
|
+
settings by name. ``profile_path`` is the file a "From file" profile was
|
|
90
|
+
read from: a measured groove is loaded again rather than written out.
|
|
91
|
+
"""
|
|
92
|
+
options = options or {}
|
|
93
|
+
problem, light = parsed.problem, parsed.illumination
|
|
94
|
+
names = {"Illumination", "Problem"}
|
|
95
|
+
lines: list[str] = []
|
|
96
|
+
|
|
97
|
+
if isinstance(problem.profile, FromProfileData):
|
|
98
|
+
lines += [
|
|
99
|
+
"from gratinglab.io.boundary import read_profile_file",
|
|
100
|
+
"",
|
|
101
|
+
f"profile = read_profile_file(r{profile_path!r})",
|
|
102
|
+
]
|
|
103
|
+
problem_source = _call(problem, spread=True, profile="profile")
|
|
104
|
+
else:
|
|
105
|
+
names.add(type(problem.profile).__name__)
|
|
106
|
+
problem_source = _call(problem, spread=True)
|
|
107
|
+
lines.append("")
|
|
108
|
+
if problem.layers:
|
|
109
|
+
names.add("ConformalLayer")
|
|
110
|
+
|
|
111
|
+
body = [
|
|
112
|
+
f"problem = {problem_source}",
|
|
113
|
+
f"illumination = {_call(light)}",
|
|
114
|
+
f"wavelengths = {_wavelengths(parsed.wavelengths)}",
|
|
115
|
+
"",
|
|
116
|
+
]
|
|
117
|
+
if len(methods) == 1:
|
|
118
|
+
(method,) = methods
|
|
119
|
+
names.add("solve")
|
|
120
|
+
settings = options.get(method, {})
|
|
121
|
+
if settings:
|
|
122
|
+
call = (f"scan = solve(\n problem, illumination, wavelengths, method={method!r},\n"
|
|
123
|
+
+ "".join(f" {key}={_value(value)},\n" for key, value in settings.items()) + ")")
|
|
124
|
+
else:
|
|
125
|
+
call = f"scan = solve(problem, illumination, wavelengths, method={method!r})"
|
|
126
|
+
body += [
|
|
127
|
+
call,
|
|
128
|
+
"",
|
|
129
|
+
"# One row per wavelength, one column per order.",
|
|
130
|
+
"for m in scan.orders:",
|
|
131
|
+
" print(f\"order {m:+d}: peak {scan.order(int(m)).max():.4f}\")",
|
|
132
|
+
]
|
|
133
|
+
title = f"A grating solved with the {method} solver."
|
|
134
|
+
elif methods:
|
|
135
|
+
names.update({"sweep", "align"})
|
|
136
|
+
chosen = {m: dict(options[m]) for m in methods if options.get(m)}
|
|
137
|
+
body += [
|
|
138
|
+
f"methods = {list(methods)!r}",
|
|
139
|
+
f"options = {_value_dict(chosen)}",
|
|
140
|
+
"comparison = align(sweep(problem, illumination, wavelengths, methods, options))",
|
|
141
|
+
"",
|
|
142
|
+
"reference = methods[0]",
|
|
143
|
+
"for other in methods[1:]:",
|
|
144
|
+
" print(other, \"against\", reference, comparison.summary(other, reference))",
|
|
145
|
+
]
|
|
146
|
+
title = f"A grating solved with {', '.join(methods)}, and compared."
|
|
147
|
+
else:
|
|
148
|
+
body += ["print(problem)", "print(illumination)"]
|
|
149
|
+
title = "A grating and its illumination."
|
|
150
|
+
|
|
151
|
+
imports = ["import numpy as np", "", f"from gratinglab import {', '.join(sorted(names))}"]
|
|
152
|
+
return "\n".join([_HEADER.format(title=title, version=_version()), *imports, *lines, *body]) + "\n"
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _value_dict(mapping: Mapping[str, Mapping[str, Any]]) -> str:
|
|
156
|
+
inner = ", ".join(
|
|
157
|
+
f"{name!r}: {{{', '.join(f'{k!r}: {_value(v)}' for k, v in opts.items())}}}"
|
|
158
|
+
for name, opts in mapping.items()
|
|
159
|
+
)
|
|
160
|
+
return "{" + inner + "}"
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def mirror_script(result) -> str:
|
|
164
|
+
"""The script for the coatings window's Mirror tab, from its last result
|
|
165
|
+
(``mirror_view.MirrorResult``): the stack, the scan, and the three
|
|
166
|
+
things the tab reports."""
|
|
167
|
+
mirror = result.mirror
|
|
168
|
+
names = {"Mirror"}
|
|
169
|
+
if mirror.layers:
|
|
170
|
+
names.add("ConformalLayer")
|
|
171
|
+
args = [f"substrate={mirror.substrate!r}"]
|
|
172
|
+
if mirror.layers:
|
|
173
|
+
args.append(f"layers={_value(tuple(mirror.layers))}")
|
|
174
|
+
if mirror.roughness:
|
|
175
|
+
args.append(f"roughness={mirror.roughness!r}")
|
|
176
|
+
|
|
177
|
+
scan = _wavelengths(result.x)
|
|
178
|
+
if result.scan == "angle":
|
|
179
|
+
axes = [f"graze = {scan} # degrees from the surface", f"wavelength = {result.fixed!r} # nm"]
|
|
180
|
+
else:
|
|
181
|
+
axes = [f"graze = {result.fixed!r} # degrees from the surface", f"wavelength = {scan} # nm"]
|
|
182
|
+
body = [
|
|
183
|
+
f"mirror = Mirror({', '.join(args)})",
|
|
184
|
+
*axes,
|
|
185
|
+
"",
|
|
186
|
+
f"reflectivity = mirror.reflectivity(graze, wavelength, polarization={result.polarization!r})",
|
|
187
|
+
"depth = mirror.penetration_depth(graze, wavelength) # 1/e intensity depth, nm, by material",
|
|
188
|
+
"",
|
|
189
|
+
"print(f\"reflectivity from {reflectivity.min():.4g} to {reflectivity.max():.4g}\")",
|
|
190
|
+
"for material, d in depth.items():",
|
|
191
|
+
" print(f\"1/e depth in {material}: {d.min():.3g} to {d.max():.3g} nm\")",
|
|
192
|
+
]
|
|
193
|
+
if mirror.layers:
|
|
194
|
+
one = "graze[0], wavelength" if result.scan == "angle" else "graze, wavelength[0]"
|
|
195
|
+
body += [
|
|
196
|
+
"",
|
|
197
|
+
"# The thinnest top layer that reads as bulk, at the first point of the scan.",
|
|
198
|
+
f"needed = mirror.bulk_thickness({one}, tolerance={result.tolerance!r}, "
|
|
199
|
+
f"polarization={result.polarization!r})",
|
|
200
|
+
f"print(f\"{mirror.layers[-1].material} needed to read as bulk: {{needed:.3g}} nm\")",
|
|
201
|
+
]
|
|
202
|
+
title = "A coating stack as a flat mirror."
|
|
203
|
+
imports = ["import numpy as np", "", f"from gratinglab import {', '.join(sorted(names))}", ""]
|
|
204
|
+
return "\n".join([_HEADER.format(title=title, version=_version()), *imports, *body]) + "\n"
|
|
@@ -19,6 +19,17 @@ from .integral import IntegralSolver, integral
|
|
|
19
19
|
from .rcwa import RcwaSolver, rcwa
|
|
20
20
|
from .scalar import ScalarSolver, interference_factor, scalar
|
|
21
21
|
|
|
22
|
+
|
|
23
|
+
def solve(problem, illumination, wavelengths, method: str = "scalar", **options):
|
|
24
|
+
"""Efficiency over ``wavelengths`` by the solver named ``method``.
|
|
25
|
+
|
|
26
|
+
A shorthand for ``get_solver(method).solve(...)``, for a script that
|
|
27
|
+
wants one call. ``options`` are that solver's own settings, such as
|
|
28
|
+
``quadrature_points`` for ``"scalar"`` or ``truncation`` for ``"rcwa"``.
|
|
29
|
+
Returns an :class:`~gratinglab.result.EfficiencyScan`.
|
|
30
|
+
"""
|
|
31
|
+
return get_solver(method).solve(problem, illumination, wavelengths, **options)
|
|
32
|
+
|
|
22
33
|
__all__ = [
|
|
23
34
|
"Capabilities",
|
|
24
35
|
"Progress",
|
|
@@ -28,6 +39,7 @@ __all__ = [
|
|
|
28
39
|
"available_solvers",
|
|
29
40
|
"get_solver",
|
|
30
41
|
"register",
|
|
42
|
+
"solve",
|
|
31
43
|
"CMethodSolver",
|
|
32
44
|
"cmethod",
|
|
33
45
|
"ScalarSolver",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gratinglab
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.1
|
|
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
|
|
@@ -447,10 +447,13 @@ icon --app gratinglab` regenerates the icon from the artwork in `gratinglab.gui.
|
|
|
447
447
|
|
|
448
448
|
| Document | Contents |
|
|
449
449
|
|---|---|
|
|
450
|
+
| [`docs/python.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/python.md) | Using gratinglab from your own code: the objects, the result, materials, the mirror, and "Copy as Python" from the windows |
|
|
451
|
+
| [`examples/`](https://github.com/jamccoy/gratinglab/tree/master/examples) | Short scripts that use gratinglab from your own code: an efficiency scan, two solvers compared, your own optical constants, a coating as a mirror, a parameter sweep; with a table of what to import for what |
|
|
450
452
|
| [`docs/roadmap.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/roadmap.md) | The current state of the project, planned work and open questions; the place to start |
|
|
451
453
|
| [`docs/conventions.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/conventions.md) | The normative definitions: signs, units, normalizations, and errata in the references |
|
|
452
454
|
| [`docs/theory/scalar.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/scalar.md) | The derivation of the scalar solver, its closed-form results and its limits |
|
|
453
455
|
| [`docs/theory/integral.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/integral.md) | The boundary-integral solver: conical formulation, perfect and finite conductivity |
|
|
456
|
+
| [`docs/theory/mirror.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/mirror.md) | The coating as a flat mirror: the recursion, what the penetration depth and bulk thickness mean, and what is and is not validated |
|
|
454
457
|
| [`docs/theory/metrology.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/theory/metrology.md) | The assumptions of the AFM pipeline, what it measures and what it does not, including what tip erosion can recover |
|
|
455
458
|
| [`docs/typical-materials.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/typical-materials.md) | The X-ray index model used without a table, what it is checked against, and its measured accuracy |
|
|
456
459
|
| [`docs/findings.md`](https://github.com/jamccoy/gratinglab/blob/master/docs/findings.md) | Empirical results, each with the evidence for it |
|
|
@@ -48,6 +48,7 @@ src/gratinglab/gui/provenance.py
|
|
|
48
48
|
src/gratinglab/gui/rcwa_options.py
|
|
49
49
|
src/gratinglab/gui/richtext.py
|
|
50
50
|
src/gratinglab/gui/scalar_options.py
|
|
51
|
+
src/gratinglab/gui/script.py
|
|
51
52
|
src/gratinglab/gui/state.py
|
|
52
53
|
src/gratinglab/gui/theme.py
|
|
53
54
|
src/gratinglab/gui/qt/__init__.py
|
|
@@ -184,6 +185,7 @@ tests/test_conditioning.py
|
|
|
184
185
|
tests/test_convergence.py
|
|
185
186
|
tests/test_cross_method.py
|
|
186
187
|
tests/test_efficiency_table.py
|
|
188
|
+
tests/test_examples.py
|
|
187
189
|
tests/test_factors.py
|
|
188
190
|
tests/test_four_way.py
|
|
189
191
|
tests/test_fresnel.py
|
|
@@ -210,6 +212,7 @@ tests/test_gui_qt.py
|
|
|
210
212
|
tests/test_gui_rcwa_options.py
|
|
211
213
|
tests/test_gui_richtext.py
|
|
212
214
|
tests/test_gui_scalar_options.py
|
|
215
|
+
tests/test_gui_script.py
|
|
213
216
|
tests/test_gui_stack_editor.py
|
|
214
217
|
tests/test_gui_state.py
|
|
215
218
|
tests/test_gui_theme.py
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Every script in ``examples/`` runs, and says what it claims to.
|
|
2
|
+
|
|
3
|
+
An example nobody runs goes stale the first time an interface moves, and the
|
|
4
|
+
person who finds out is the one who copied it. Each is run here in-process,
|
|
5
|
+
start to finish, and a line or two of its output is checked so that "it ran"
|
|
6
|
+
also means "it computed something".
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import re
|
|
10
|
+
import runpy
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
import numpy as np
|
|
14
|
+
import pytest
|
|
15
|
+
|
|
16
|
+
EXAMPLES = Path(__file__).resolve().parents[1] / "examples"
|
|
17
|
+
|
|
18
|
+
#: Each numbered example, and text its output must contain.
|
|
19
|
+
EXPECTED = {
|
|
20
|
+
"01_efficiency_scan.py": ("solved 41 wavelengths", "order +2: 0.7342", "first record:"),
|
|
21
|
+
"02_compare_solvers.py": ("order 1 efficiency", "largest difference over all orders", "absorbed"),
|
|
22
|
+
"03_your_own_material.py": ("Glass: covers 400 to 700 nm", "index at 500 nm: 1.5220", "refused", "typical:Au at 1 nm"),
|
|
23
|
+
"04_mirror_and_coating.py": ("gold needed to read as bulk", "20 nm is enough", "20 nm is not enough", "r_s ="),
|
|
24
|
+
"05_parameter_sweep.py": ("blaze angle order +1 at 2 nm", "best of these: 15.0 deg", "typical:Ni"),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_every_numbered_example_is_checked():
|
|
29
|
+
"""A new example joins the table, or this says so."""
|
|
30
|
+
numbered = sorted(p.name for p in EXAMPLES.glob("[0-9]*.py"))
|
|
31
|
+
assert numbered == sorted(EXPECTED)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@pytest.mark.parametrize("name", sorted(EXPECTED))
|
|
35
|
+
def test_example_runs_and_reports(name, capsys, monkeypatch):
|
|
36
|
+
# 03 points GRATINGLAB_MATERIALS at a folder of its own; setting it here
|
|
37
|
+
# first means monkeypatch puts back what the suite had.
|
|
38
|
+
monkeypatch.setenv("GRATINGLAB_MATERIALS", "")
|
|
39
|
+
runpy.run_path(str(EXAMPLES / name), run_name="__main__")
|
|
40
|
+
out = capsys.readouterr().out
|
|
41
|
+
for text in EXPECTED[name]:
|
|
42
|
+
assert text in out, f"{name} did not print {text!r}"
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def test_the_guides_code_blocks_run(tmp_path, monkeypatch):
|
|
46
|
+
"""`docs/python.md` is read as a reference, so its snippets are run too:
|
|
47
|
+
in order, in one namespace, as a reader following the page would."""
|
|
48
|
+
guide = EXAMPLES.parent / "docs" / "python.md"
|
|
49
|
+
blocks = re.findall(r"```python\n(.*?)```", guide.read_text(encoding="utf-8"), re.S)
|
|
50
|
+
assert len(blocks) >= 5
|
|
51
|
+
(tmp_path / "film.csv").write_text(
|
|
52
|
+
"wavelength (nm), n, k\n400, 1.5, 0\n500, 1.4, 0\n", encoding="utf-8")
|
|
53
|
+
monkeypatch.chdir(tmp_path)
|
|
54
|
+
namespace = {"wavelengths": np.linspace(1.0, 5.0, 5)}
|
|
55
|
+
for number, block in enumerate(blocks, 1):
|
|
56
|
+
exec(compile(block, f"<docs/python.md block {number}>", "exec"), namespace)
|
|
57
|
+
assert namespace["scan"].order(1).shape == (41,)
|
|
58
|
+
assert set(namespace["comparison"].methods) == {"scalar", "rcwa"}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@pytest.mark.parametrize("name", sorted(EXPECTED))
|
|
62
|
+
def test_examples_print_plain_ascii(name):
|
|
63
|
+
"""A degree sign in a print raises UnicodeEncodeError on a console whose
|
|
64
|
+
code page lacks it, which is the first thing a new user would see."""
|
|
65
|
+
text = (EXAMPLES / name).read_text(encoding="utf-8")
|
|
66
|
+
assert all(ord(c) < 128 for c in text), name
|