mlgidGUI 1.1.0__tar.gz → 1.2.0__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.
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/CHANGELOG.md +43 -0
- {mlgidgui-1.1.0/mlgidgui.egg-info → mlgidgui-1.2.0}/PKG-INFO +1 -1
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/__init__.py +1 -1
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/conversion.py +84 -8
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/conversion_config.py +18 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/conversion_panel.py +32 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/image_viewer.py +11 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/image_viewer_interact.py +41 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/image_viewer_overlays.py +61 -13
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_build.py +70 -8
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_peaks.py +32 -3
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_structure.py +34 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/peaks_table_panel.py +8 -1
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/profile_viewer.py +3 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/structure_panel.py +20 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/structure_tree.py +31 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/viewer_items.py +16 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/viewer_styles.py +56 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0/mlgidgui.egg-info}/PKG-INFO +1 -1
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui.egg-info/SOURCES.txt +5 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/pyproject.toml +1 -1
- mlgidgui-1.2.0/tests/test_axis_units.py +79 -0
- mlgidgui-1.2.0/tests/test_conversion_exp_fixed.py +238 -0
- mlgidgui-1.2.0/tests/test_delete_selects_next.py +313 -0
- mlgidgui-1.2.0/tests/test_sim_pens.py +235 -0
- mlgidgui-1.2.0/tests/test_structure_refresh.py +228 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/LICENSE +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/MANIFEST.in +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/README.md +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/__main__.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/ai_values.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/arc_roi.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/array_edit_dialog.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgid_logo_mlgidgui.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgid_logo_mlgidgui_dark.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui.ico +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui_128.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui_16.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui_24.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui_256.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui_32.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui_48.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/app/mlgidgui_64.png +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/about.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/chevron-down.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/chevron-right.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/clear-peaks.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/clear-recent.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/close.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/colormap.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/copy-diagnostics.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/cursor-readout.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-conversion.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-display.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-expected.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-logs.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-peaks.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-pipeline.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-profiles.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-tracking.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/dock-tree.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/exit.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/export-csv.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/export-figure.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/file-close.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/file-open.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/file-recent.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/find-peak.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/fullscreen.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/help-controls.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/log-scale.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/next.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/node-dataset.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/node-group.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/node-link.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/pause.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/play.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/playback-settings.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/prev.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/redo.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/refresh.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/reset-layout.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/reset-peaks.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/reset-zoom.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/save-as.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/save.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/theme-dark.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/theme-light.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/undo.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/view-cartesian.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/assets/icons/view-polar.svg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/browser_widgets.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/calibration_dialog.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/controls_help.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/desktop_entry.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/detection_config.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/detection_model.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/diagnostics.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/figure_export_window.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/file_dialogs.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/file_model.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/fit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/flow_layout.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/frame_range.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/h5_edit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/h5_edit_ops.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/h5_repack.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/icons.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/image_viewer_render.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/import_dialog.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_constants.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_dialogs.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_files.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_frames.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_matched.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_menus.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_pipeline.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_preview.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_sim.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_tracking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/main_window_update.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/manual_fit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/nexus_schema.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/parameter_panel.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/peak_clipboard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/peak_link.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/peak_lists.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/peak_picking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/peak_zoom.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/pen_picker.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/phase_tracking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/phase_views_dialogs.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/phase_views_window.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/pipeline.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/pipeline_panel.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/polar.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/preview_fit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/profile_binning.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/profile_masking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/roi_intensity.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/scan_tracking_panel.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/selftest.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/session.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/settings_migration.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/simulation_pattern.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/skin.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/structure_clipboard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/structure_dialogs.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/theme.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/theme_tokens.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/update_check.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/update_ui.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/welcome_view.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/widgets.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/workers.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui/workflow_rail.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui.egg-info/dependency_links.txt +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui.egg-info/entry_points.txt +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui.egg-info/requires.txt +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/mlgidgui.egg-info/top_level.txt +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/setup.cfg +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/setup.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_add_predicted_gui.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_add_to_detected.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_ai_values.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_array_edit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_aspect_ratio.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_async_entry_switch.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_async_open.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_batch_fit_2d.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_blocked_tracking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_branding.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_browser_entry_select.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_bulk_delete.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_button_variants.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_card_language.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_cartesian_draw.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_cif_empty_pattern.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_contrast_persists.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_controls_help.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_conversion_nexus_info.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_conversion_overrides.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_delete_peak_row.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_desktop_entry.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_detection_model.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_detection_params.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_diagnostics.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_dock_layout.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_dock_resize.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_energy_guard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_fabio_gui.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_fabio_stack.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_figure_export_svg.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_file_browser_delete.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_file_dialogs.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_file_tree_refresh.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_fill_matched_sweep_gui.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_fit_area.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_fit_gaussian.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_fit_mode_selector.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_flow_layout.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_flow_layout_collapse.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_frame_range_parser.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_frame_spinbox.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_frozen_app.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_h5_edit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_h5_edit_undo.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_h5_repack.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_hermetic_guard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_icons.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_import_converted.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_inject_fitted_peaks_op.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_lazy_normalize.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_lazy_peaks.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_lazy_raw_loading.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_manual_fit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_manual_peak_box_ops.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_matched_consolidation.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_matched_identity.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_matched_invalidation_on_refit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_matched_remap_on_fitted_delete.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_mixin_slots.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_multi_select.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_neighbour_masking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_nexus_schema.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_no_hardcoded_colours.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_paste_to_range.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_clipboard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_dataset_bootstrap.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_linking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_lists.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_picking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_roundtrip.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_score_edit.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peak_zoom.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_peaks_table_interaction.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_pen_picker.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_phase_tracking.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_pipeline_entry_preflight.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_pipeline_frame_scope.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_pipeline_primary_table.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_pipeline_progress.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_pipeline_queue_snapshot.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_polar_to_qxyz.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_profile_binning.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_profile_overlay_stored.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_progress_accent.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_pygid_incompat_guard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_quick_select.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_raw_async_gui.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_raw_preview_flip.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_raw_session.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_reset_analysis.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_roi_intensity.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_scan_tracking_gui.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_score_cutoff.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_selection_sync.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_session_reactivation.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_settings_migration.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_shallow_entry_listing.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_sim_overlay_gui.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_simulation_pattern.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_skin_qss.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_smoke_construction.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_smoke_session.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_smoke_silx_detach.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_status_bar_activity.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_stored_fit_readout.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_clipboard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_edits.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_layout.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_links.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_panel.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_search.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_tree.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_structure_tree_edits.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_theme_apply.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_theme_persistence.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_theme_tokens.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_undo_redo_shortcut.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_update_check.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_view_preservation.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_viewer_controls.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_viewer_released_frame_source.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_welcome_view.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_wheel_guard.py +0 -0
- {mlgidgui-1.1.0 → mlgidgui-1.2.0}/tests/test_workflow_rail.py +0 -0
|
@@ -4,6 +4,49 @@ All notable changes to mlgidGUI (called mlgidLAB until 1.0.0) are recorded
|
|
|
4
4
|
here. Versions follow [PEP 440](https://peps.python.org/pep-0440/); `aN`
|
|
5
5
|
suffixes are alpha pre-releases.
|
|
6
6
|
|
|
7
|
+
## 1.2.0 (2026-11-22)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Fixed fields in the conversion's Experimental metadata.** The
|
|
12
|
+
dropdown now starts with `start_time`, `end_time`, `source_type`,
|
|
13
|
+
`source_name`, `instrument_name` and `temperature`; the custom
|
|
14
|
+
key/value table below it works as before. A field left empty is not
|
|
15
|
+
touched, so pygid's own handling stays (`nan` for the first four,
|
|
16
|
+
nothing for `source_name` and `temperature`). The values are written
|
|
17
|
+
after the conversion, so they also survive scans converted in several
|
|
18
|
+
batches. A custom row named like a fixed field fills it.
|
|
19
|
+
|
|
20
|
+
- **Deleting a peak selects the next one.** After a detected or fitted
|
|
21
|
+
peak is deleted (Delete key, the Peaks table, or the Delete button), the
|
|
22
|
+
peak with the next id after it is selected, so working through a frame
|
|
23
|
+
no longer needs a click between deletes. If it was the last one, the
|
|
24
|
+
last remaining peak is selected. Undo selects the restored peak, redo
|
|
25
|
+
goes back to the neighbour.
|
|
26
|
+
|
|
27
|
+
- **Refresh button in the Structure tab.** A detection, fitting or
|
|
28
|
+
matching run, or a conversion, changes the file without telling the
|
|
29
|
+
Structure tab, so a new group (such as the `mlgidDETECT` metadata)
|
|
30
|
+
stayed missing from the tree. The new *Refresh* button, first in the
|
|
31
|
+
row above the tree, re-reads the open files into the tree and the
|
|
32
|
+
selected node. Open groups and the selection stay where they were. It
|
|
33
|
+
waits while a run is writing to the file.
|
|
34
|
+
|
|
35
|
+
- **Colour, line style and width of the Expected-pattern boxes.** Under
|
|
36
|
+
"Show expected pattern" there are now three swatches, *missed*,
|
|
37
|
+
*explained* and *selected*. A click opens the same pen editor as the
|
|
38
|
+
Detected and Fitted swatches, and the boxes on the image follow as you
|
|
39
|
+
change it. The choice is remembered, and *Automatic* puts the original
|
|
40
|
+
look back. The swatches also show what each colour means.
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- **Axis units no longer get an SI prefix.** The radius axes could read
|
|
45
|
+
"mÅ⁻¹" (with the numbers multiplied by 1000) when the range was below
|
|
46
|
+
1 Å⁻¹, "kÅ⁻¹" above 1000, and the angle axis "mdeg". The image and
|
|
47
|
+
profile axes now always show Å⁻¹, degrees and pixels with the real
|
|
48
|
+
numbers.
|
|
49
|
+
|
|
7
50
|
## 1.1.0 (2026-11-16)
|
|
8
51
|
|
|
9
52
|
### Added
|
|
@@ -28,6 +28,7 @@ from mlgidgui.conversion_config import (
|
|
|
28
28
|
CONV_DET2POL_GID,
|
|
29
29
|
CONV_DET2Q,
|
|
30
30
|
CONV_DET2Q_GID,
|
|
31
|
+
EXP_FIXED_FIELDS,
|
|
31
32
|
OUTPUT_SEPARATE_FILES,
|
|
32
33
|
OUTPUT_SINGLE_ENTRY,
|
|
33
34
|
ConversionConfig,
|
|
@@ -907,7 +908,13 @@ def _build_exp_metadata(pygid_mod: Any, kv: dict[str, str]) -> Any:
|
|
|
907
908
|
a metadata entry needs to round-trip as a number rather than a
|
|
908
909
|
label.
|
|
909
910
|
"""
|
|
910
|
-
|
|
911
|
+
# The fixed fields (EXP_FIXED_FIELDS) are written after conversion by
|
|
912
|
+
# ``write_post_metadata``; a custom row using one of those names was
|
|
913
|
+
# merged into it by ``clean_post_metadata``.
|
|
914
|
+
cleaned = {
|
|
915
|
+
k: v for k, v in (kv or {}).items()
|
|
916
|
+
if k and k not in EXP_FIXED_FIELDS
|
|
917
|
+
}
|
|
911
918
|
if not cleaned:
|
|
912
919
|
return None
|
|
913
920
|
obj = pygid_mod.ExpMetadata(**cleaned)
|
|
@@ -929,19 +936,23 @@ def _build_exp_metadata(pygid_mod: Any, kv: dict[str, str]) -> Any:
|
|
|
929
936
|
|
|
930
937
|
@dataclass
|
|
931
938
|
class PostMetadata:
|
|
932
|
-
"""Cleaned user, technique and beamtime metadata
|
|
939
|
+
"""Cleaned experiment, user, technique and beamtime metadata.
|
|
933
940
|
|
|
934
941
|
Every value is a non-empty string. ``users`` keeps
|
|
935
942
|
``USER_FIELD_NAME_KEY`` in each dict (the subgroup name);
|
|
936
|
-
``techniques`` and ``beamtime`` hold only pygid's field names
|
|
943
|
+
``techniques`` and ``beamtime`` hold only pygid's field names;
|
|
944
|
+
``experiment`` holds the filled ``EXP_FIXED_FIELDS``.
|
|
937
945
|
"""
|
|
938
946
|
|
|
939
947
|
users: list[dict[str, str]] = field(default_factory=list)
|
|
940
948
|
techniques: list[dict[str, str]] = field(default_factory=list)
|
|
941
949
|
beamtime: dict[str, str] = field(default_factory=dict)
|
|
950
|
+
experiment: dict[str, str] = field(default_factory=dict)
|
|
942
951
|
|
|
943
952
|
def is_empty(self) -> bool:
|
|
944
|
-
return not (
|
|
953
|
+
return not (
|
|
954
|
+
self.users or self.techniques or self.beamtime or self.experiment
|
|
955
|
+
)
|
|
945
956
|
|
|
946
957
|
|
|
947
958
|
def _filled(values: dict[str, str] | None, keys) -> dict[str, str]:
|
|
@@ -993,7 +1004,32 @@ def clean_post_metadata(cfg: ConversionConfig) -> PostMetadata:
|
|
|
993
1004
|
if t
|
|
994
1005
|
]
|
|
995
1006
|
beamtime = _filled(cfg.beamtime_info, BEAMTIME_FIELDS)
|
|
996
|
-
|
|
1007
|
+
experiment = _merge_fixed_exp_fields(cfg)
|
|
1008
|
+
return PostMetadata(
|
|
1009
|
+
users=users, techniques=techniques, beamtime=beamtime,
|
|
1010
|
+
experiment=experiment,
|
|
1011
|
+
)
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
def _merge_fixed_exp_fields(cfg: ConversionConfig) -> dict[str, str]:
|
|
1015
|
+
"""The filled fixed experimental fields.
|
|
1016
|
+
|
|
1017
|
+
A custom row of the metadata table that uses a fixed field's name
|
|
1018
|
+
(for instance a ``temperature`` row added by hand or from HDF5)
|
|
1019
|
+
fills that field when the field itself is empty, so the value lands
|
|
1020
|
+
in the one dataset pygid uses. Both filled with different values
|
|
1021
|
+
raises ``ValueError``: one of them would silently win.
|
|
1022
|
+
"""
|
|
1023
|
+
fixed = _filled(cfg.expmeta_fixed, EXP_FIXED_FIELDS)
|
|
1024
|
+
custom = _filled(cfg.expmeta_kv, EXP_FIXED_FIELDS)
|
|
1025
|
+
for key, value in custom.items():
|
|
1026
|
+
if key in fixed and fixed[key] != value:
|
|
1027
|
+
raise ValueError(
|
|
1028
|
+
f"Experimental metadata {key!r} is set twice (field "
|
|
1029
|
+
f"{fixed[key]!r}, custom row {value!r}); keep one"
|
|
1030
|
+
)
|
|
1031
|
+
fixed.setdefault(key, value)
|
|
1032
|
+
return fixed
|
|
997
1033
|
|
|
998
1034
|
|
|
999
1035
|
def _read_text(dataset) -> str:
|
|
@@ -1025,6 +1061,44 @@ def _existing_techniques(techniques_grp) -> list[dict[str, str]]:
|
|
|
1025
1061
|
return out
|
|
1026
1062
|
|
|
1027
1063
|
|
|
1064
|
+
# Where each fixed experimental field lives, relative to the entry:
|
|
1065
|
+
# (group, dataset name, NeXus type), the same places pygid's
|
|
1066
|
+
# ``save_exp_metadata`` uses.
|
|
1067
|
+
_EXP_TARGETS = {
|
|
1068
|
+
"start_time": ("", "start_time", "NX_DATE_TIME"),
|
|
1069
|
+
"end_time": ("", "end_time", "NX_DATE_TIME"),
|
|
1070
|
+
"instrument_name": ("instrument", "name", "NX_CHAR"),
|
|
1071
|
+
"source_type": ("instrument/source", "type", "NX_CHAR"),
|
|
1072
|
+
"source_name": ("instrument/source", "name", "NX_CHAR"),
|
|
1073
|
+
"temperature": ("instrument", "temperature", "NX_FLOAT"),
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
def _exp_value(key: str, text: str):
|
|
1078
|
+
"""A temperature that reads as a number is stored as one."""
|
|
1079
|
+
if key == "temperature":
|
|
1080
|
+
try:
|
|
1081
|
+
return float(text)
|
|
1082
|
+
except ValueError:
|
|
1083
|
+
return text
|
|
1084
|
+
return text
|
|
1085
|
+
|
|
1086
|
+
|
|
1087
|
+
def _write_exp_fields(entry_grp, experiment: dict[str, str]) -> None:
|
|
1088
|
+
"""Write the filled fixed fields with pygid's own single-field writer.
|
|
1089
|
+
|
|
1090
|
+
Only filled fields are written, so an empty one keeps what pygid
|
|
1091
|
+
wrote during the conversion ('nan' for the required ones).
|
|
1092
|
+
"""
|
|
1093
|
+
from pygid.datasaver import ExpMetadata, save_single_metadata
|
|
1094
|
+
|
|
1095
|
+
for key, text in experiment.items():
|
|
1096
|
+
sub, dataset, nx_type = _EXP_TARGETS[key]
|
|
1097
|
+
grp = entry_grp.require_group(sub) if sub else entry_grp
|
|
1098
|
+
holder = ExpMetadata(**{key: _exp_value(key, text)})
|
|
1099
|
+
save_single_metadata(grp, holder, dataset, key, nx_type)
|
|
1100
|
+
|
|
1101
|
+
|
|
1028
1102
|
def _write_entry_metadata(entry_grp, meta: PostMetadata, nexus_reader) -> None:
|
|
1029
1103
|
"""Write ``meta`` into one NXentry with pygid's own writers.
|
|
1030
1104
|
|
|
@@ -1041,6 +1115,8 @@ def _write_entry_metadata(entry_grp, meta: PostMetadata, nexus_reader) -> None:
|
|
|
1041
1115
|
group is rebuilt the way ``set_techniques_info`` does it, because
|
|
1042
1116
|
pygid's helper numbers from ``technique_0`` on every call.
|
|
1043
1117
|
"""
|
|
1118
|
+
_write_exp_fields(entry_grp, meta.experiment)
|
|
1119
|
+
|
|
1044
1120
|
for user in meta.users:
|
|
1045
1121
|
# pygid's helper pops ``field_name`` from the dict it is given.
|
|
1046
1122
|
nexus_reader._set_user_information_single_entry(entry_grp, dict(user))
|
|
@@ -1072,7 +1148,7 @@ def _write_entry_metadata(entry_grp, meta: PostMetadata, nexus_reader) -> None:
|
|
|
1072
1148
|
def write_post_metadata(
|
|
1073
1149
|
entries: list[tuple[Path, str]], meta: PostMetadata,
|
|
1074
1150
|
) -> None:
|
|
1075
|
-
"""Write user / technique / beamtime metadata into
|
|
1151
|
+
"""Write experiment / user / technique / beamtime metadata into entries.
|
|
1076
1152
|
|
|
1077
1153
|
pygid cannot take these during conversion, so ``execute`` calls this
|
|
1078
1154
|
once after the last scan with every ``(output file, entry)`` it
|
|
@@ -1101,11 +1177,11 @@ def write_post_metadata(
|
|
|
1101
1177
|
_write_entry_metadata(f[group], meta, nexus_reader)
|
|
1102
1178
|
except Exception as exc: # noqa: BLE001 - reported, run continues
|
|
1103
1179
|
logger.warning(
|
|
1104
|
-
"
|
|
1180
|
+
"Experiment/user/technique/beamtime metadata could not be written "
|
|
1105
1181
|
"to %s: %s", path, exc,
|
|
1106
1182
|
)
|
|
1107
1183
|
continue
|
|
1108
1184
|
logger.info(
|
|
1109
|
-
"Wrote user/technique/beamtime metadata to %s (%s)",
|
|
1185
|
+
"Wrote experiment/user/technique/beamtime metadata to %s (%s)",
|
|
1110
1186
|
path.name, ", ".join(groups),
|
|
1111
1187
|
)
|
|
@@ -85,6 +85,22 @@ BEAMTIME_FIELDS = (
|
|
|
85
85
|
"DOI",
|
|
86
86
|
)
|
|
87
87
|
|
|
88
|
+
# Experimental metadata fields the panel always shows (pygid's
|
|
89
|
+
# ``ExpMetadata`` names). Left empty they are not touched, so pygid's
|
|
90
|
+
# own handling stays: start_time, end_time, instrument_name and
|
|
91
|
+
# source_type become 'nan', source_name and temperature are not written.
|
|
92
|
+
# Written after conversion (``conversion.write_post_metadata``), because
|
|
93
|
+
# pygid hands its metadata object to the first batch only and later
|
|
94
|
+
# batches would overwrite these with 'nan'.
|
|
95
|
+
EXP_FIXED_FIELDS = (
|
|
96
|
+
"start_time",
|
|
97
|
+
"end_time",
|
|
98
|
+
"source_type",
|
|
99
|
+
"source_name",
|
|
100
|
+
"instrument_name",
|
|
101
|
+
"temperature",
|
|
102
|
+
)
|
|
103
|
+
|
|
88
104
|
|
|
89
105
|
@dataclass
|
|
90
106
|
class RawScan:
|
|
@@ -182,6 +198,8 @@ class ConversionConfig:
|
|
|
182
198
|
smplmeta_yaml: str = ""
|
|
183
199
|
# Experimental metadata key/value pairs from the metadata table.
|
|
184
200
|
expmeta_kv: dict[str, str] = field(default_factory=dict)
|
|
201
|
+
# The fixed experimental fields (EXP_FIXED_FIELDS); empty = untouched.
|
|
202
|
+
expmeta_fixed: dict[str, str] = field(default_factory=dict)
|
|
185
203
|
# Post-conversion NeXus metadata, all optional (see USER_FIELDS etc.).
|
|
186
204
|
# One dict per user (keys: USER_FIELD_NAME_KEY + USER_FIELDS), one per
|
|
187
205
|
# technique (TECHNIQUE_FIELDS), and one beamtime dict
|
|
@@ -58,6 +58,7 @@ from mlgidgui.conversion_config import (
|
|
|
58
58
|
CONV_DET2POL_GID,
|
|
59
59
|
CONV_DET2Q,
|
|
60
60
|
CONV_DET2Q_GID,
|
|
61
|
+
EXP_FIXED_FIELDS,
|
|
61
62
|
FRAME_ALL,
|
|
62
63
|
FRAME_LIST,
|
|
63
64
|
FRAME_SINGLE,
|
|
@@ -1154,6 +1155,33 @@ class ConversionPanel(QWidget):
|
|
|
1154
1155
|
section.body_layout.addWidget(self.exp_meta_section)
|
|
1155
1156
|
exp_body = self.exp_meta_section.body_layout
|
|
1156
1157
|
|
|
1158
|
+
exp_hint = QLabel(
|
|
1159
|
+
"<i>Fixed fields, written after the conversion. Left empty, "
|
|
1160
|
+
"pygid's own handling stays: start_time, end_time, "
|
|
1161
|
+
"instrument_name and source_type become 'nan', source_name "
|
|
1162
|
+
"and temperature are not written. Times as ISO 8601 "
|
|
1163
|
+
"(2026-11-22T14:30:00).</i>"
|
|
1164
|
+
)
|
|
1165
|
+
exp_hint.setWordWrap(True)
|
|
1166
|
+
exp_body.addWidget(exp_hint)
|
|
1167
|
+
exp_form = _make_form()
|
|
1168
|
+
exp_form.setContentsMargins(0, 0, 0, 0)
|
|
1169
|
+
exp_form.setSpacing(4)
|
|
1170
|
+
self.exp_fixed_fields: dict[str, QLineEdit] = {}
|
|
1171
|
+
for key in EXP_FIXED_FIELDS:
|
|
1172
|
+
edit = QLineEdit()
|
|
1173
|
+
if key.endswith("_time"):
|
|
1174
|
+
edit.setPlaceholderText("2026-11-22T14:30:00")
|
|
1175
|
+
elif key == "temperature":
|
|
1176
|
+
edit.setPlaceholderText("number, e.g. 300 (kelvin)")
|
|
1177
|
+
self.exp_fixed_fields[key] = edit
|
|
1178
|
+
exp_form.addRow(f"{key}:", edit)
|
|
1179
|
+
exp_form_host = QWidget()
|
|
1180
|
+
exp_form_host.setLayout(exp_form)
|
|
1181
|
+
exp_body.addWidget(exp_form_host)
|
|
1182
|
+
custom_label = QLabel("<b>Custom fields</b>")
|
|
1183
|
+
exp_body.addWidget(custom_label)
|
|
1184
|
+
|
|
1157
1185
|
self.exp_meta_table = _skin_item_view(QTableWidget(0, 3))
|
|
1158
1186
|
self.exp_meta_table.setHorizontalHeaderLabels(["Key", "Value", "Source"])
|
|
1159
1187
|
self.exp_meta_table.horizontalHeader().setSectionResizeMode(
|
|
@@ -2015,6 +2043,10 @@ class ConversionPanel(QWidget):
|
|
|
2015
2043
|
if key:
|
|
2016
2044
|
kv[key] = value
|
|
2017
2045
|
cfg.expmeta_kv = kv
|
|
2046
|
+
cfg.expmeta_fixed = {
|
|
2047
|
+
key: edit.text().strip()
|
|
2048
|
+
for key, edit in self.exp_fixed_fields.items()
|
|
2049
|
+
}
|
|
2018
2050
|
self._collect_nexus_info(cfg)
|
|
2019
2051
|
|
|
2020
2052
|
# Output.
|
|
@@ -99,6 +99,7 @@ from mlgidgui.viewer_styles import (
|
|
|
99
99
|
_load_matched_pen_overrides,
|
|
100
100
|
_save_matched_pen_overrides,
|
|
101
101
|
load_overlay_pen_overrides,
|
|
102
|
+
load_sim_pen_overrides,
|
|
102
103
|
overlay_pen as _overlay_pen,
|
|
103
104
|
save_overlay_pen_overrides,
|
|
104
105
|
_sim_intensity_scale,
|
|
@@ -123,6 +124,7 @@ from mlgidgui.viewer_items import (
|
|
|
123
124
|
_cart_table_row_contains,
|
|
124
125
|
_cart_to_polar,
|
|
125
126
|
_clip_angle,
|
|
127
|
+
_disable_si_prefix,
|
|
126
128
|
_disable_viewport_scroll,
|
|
127
129
|
_has_label_modifiers,
|
|
128
130
|
_peaks_from_manual,
|
|
@@ -242,6 +244,10 @@ class GIWAXSImageViewer(
|
|
|
242
244
|
# or fitted overlay. Carries the kind; the Display dock's swatch
|
|
243
245
|
# button listens so the legend follows the image.
|
|
244
246
|
overlayPenChanged = Signal(str)
|
|
247
|
+
# Emitted with the state name ("missed" / "explained" / "selected")
|
|
248
|
+
# when the user's pen for the Expected-pattern overlay changes, so
|
|
249
|
+
# the dock swatches follow (including back to the built-in look).
|
|
250
|
+
simPenChanged = Signal(str)
|
|
245
251
|
# Emitted when the set of simulated reflections selected for
|
|
246
252
|
# injection changes (click toggle, Select missed, pattern swap,
|
|
247
253
|
# intensity-cutoff pruning). Carries the sorted reflection indices;
|
|
@@ -395,6 +401,8 @@ class GIWAXSImageViewer(
|
|
|
395
401
|
outer.addWidget(bar_widget)
|
|
396
402
|
|
|
397
403
|
self._plot = pg.PlotItem()
|
|
404
|
+
# Å⁻¹ / deg / px stay as they are: no "mÅ⁻¹" below 1, no "kpx".
|
|
405
|
+
_disable_si_prefix(self._plot)
|
|
398
406
|
self._view = pg.ImageView(self, view=self._plot)
|
|
399
407
|
self._view.ui.roiBtn.hide()
|
|
400
408
|
self._view.ui.menuBtn.hide()
|
|
@@ -598,6 +606,9 @@ class GIWAXSImageViewer(
|
|
|
598
606
|
# deliberately survive ``clear()`` (display preferences, not
|
|
599
607
|
# file state).
|
|
600
608
|
self._sim_pattern = None
|
|
609
|
+
# The user's partial pen per reflection state, layered over the
|
|
610
|
+
# built-in look (``viewer_styles.sim_pen``); persisted app-wide.
|
|
611
|
+
self._sim_pen_overrides: dict[str, dict] = load_sim_pen_overrides()
|
|
601
612
|
self._sim_selected: set[int] = set()
|
|
602
613
|
self._sim_min_intensity: float = 0.01
|
|
603
614
|
self._sim_visible: bool = True
|
|
@@ -1793,6 +1793,47 @@ class ViewerInteractMixin:
|
|
|
1793
1793
|
self._set_selected(self._row_selection(cur.kind, table, row, frame))
|
|
1794
1794
|
return True
|
|
1795
1795
|
|
|
1796
|
+
def select_neighbour_of_deleted(
|
|
1797
|
+
self, kind: str, deleted_ids,
|
|
1798
|
+
) -> int | None:
|
|
1799
|
+
"""After a delete, select the peak that follows the deleted one.
|
|
1800
|
+
|
|
1801
|
+
Walks the peaks of ``kind`` on the current frame in id order, the
|
|
1802
|
+
way ``step_selection`` does, and selects the one with the
|
|
1803
|
+
smallest id above the highest deleted id: gaps left by earlier
|
|
1804
|
+
deletes are skipped, and a fitted row hidden by the "show only
|
|
1805
|
+
tracked peaks" filter is never picked since it cannot be
|
|
1806
|
+
selected on screen. When nothing comes after (the last peak was
|
|
1807
|
+
deleted) the highest remaining id is selected instead, so
|
|
1808
|
+
working through a frame does not leave a blank Parameter panel;
|
|
1809
|
+
with no peak left the selection stays empty. Selected through
|
|
1810
|
+
``_set_selected``, so the view follows it exactly as after a
|
|
1811
|
+
click. Returns the id selected, or None.
|
|
1812
|
+
"""
|
|
1813
|
+
frame = self.current_frame
|
|
1814
|
+
table = (self._frame_peaks.get(frame) or {}).get(kind)
|
|
1815
|
+
if table is None or len(table) == 0:
|
|
1816
|
+
return None
|
|
1817
|
+
gone = {int(i) for i in deleted_ids}
|
|
1818
|
+
if not gone:
|
|
1819
|
+
return None
|
|
1820
|
+
ids = np.asarray(table.ids)
|
|
1821
|
+
rows = [
|
|
1822
|
+
i for i in range(len(ids))
|
|
1823
|
+
if int(ids[i]) not in gone
|
|
1824
|
+
and not (kind == "fitted"
|
|
1825
|
+
and self._fitted_row_hidden(frame, int(ids[i])))
|
|
1826
|
+
]
|
|
1827
|
+
if not rows:
|
|
1828
|
+
return None
|
|
1829
|
+
after = [i for i in rows if int(ids[i]) > max(gone)]
|
|
1830
|
+
if after:
|
|
1831
|
+
row = min(after, key=lambda i: int(ids[i]))
|
|
1832
|
+
else:
|
|
1833
|
+
row = max(rows, key=lambda i: int(ids[i]))
|
|
1834
|
+
self._set_selected(self._row_selection(kind, table, row, frame))
|
|
1835
|
+
return int(ids[row])
|
|
1836
|
+
|
|
1796
1837
|
# -- Resizable ROI on the selected peak --
|
|
1797
1838
|
|
|
1798
1839
|
def _sync_roi(self) -> None:
|
|
@@ -28,6 +28,9 @@ from mlgidgui.viewer_styles import (
|
|
|
28
28
|
UNMATCHED_KEY,
|
|
29
29
|
UNMATCHED_UID,
|
|
30
30
|
_SIM_STATE_COLORS,
|
|
31
|
+
SIM_STATES,
|
|
32
|
+
save_sim_pen_overrides,
|
|
33
|
+
sim_pen as _sim_pen_for,
|
|
31
34
|
sim_state_colors,
|
|
32
35
|
OVERLAY_KINDS,
|
|
33
36
|
OVERLAY_STYLE,
|
|
@@ -352,6 +355,39 @@ class ViewerOverlaysMixin:
|
|
|
352
355
|
def clear_simulation_pattern(self) -> None:
|
|
353
356
|
self.set_simulation_pattern(None)
|
|
354
357
|
|
|
358
|
+
# --- Expected-pattern pens ---
|
|
359
|
+
|
|
360
|
+
def sim_pen(self, state: str) -> dict:
|
|
361
|
+
"""The effective ``{color, style, width}`` of a reflection state
|
|
362
|
+
("missed" / "explained" / "selected"): built-in look, the user's
|
|
363
|
+
pen on top."""
|
|
364
|
+
return _sim_pen_for(state, self._sim_pen_overrides)
|
|
365
|
+
|
|
366
|
+
def sim_pen_override(self, state: str) -> dict:
|
|
367
|
+
"""The user's partial pen for a state ({} when untouched)."""
|
|
368
|
+
return dict(self._sim_pen_overrides.get(state) or {})
|
|
369
|
+
|
|
370
|
+
def set_sim_pen(self, state: str, pen: dict | None) -> None:
|
|
371
|
+
"""Set or clear the user's pen for one Expected-pattern state.
|
|
372
|
+
|
|
373
|
+
``pen`` is a partial ``{color, style, width}``; ``None`` puts the
|
|
374
|
+
state back on its built-in look. Persisted app-wide and applied
|
|
375
|
+
at once: the overlay is rebuilt for the current frame.
|
|
376
|
+
"""
|
|
377
|
+
if state not in SIM_STATES:
|
|
378
|
+
raise ValueError(f"Unknown expected-pattern state: {state!r}")
|
|
379
|
+
if pen:
|
|
380
|
+
self._sim_pen_overrides[state] = dict(pen)
|
|
381
|
+
else:
|
|
382
|
+
self._sim_pen_overrides.pop(state, None)
|
|
383
|
+
save_sim_pen_overrides(self._sim_pen_overrides)
|
|
384
|
+
self._render_simulation_overlays(self.current_frame)
|
|
385
|
+
self.simPenChanged.emit(state)
|
|
386
|
+
|
|
387
|
+
def _sim_override(self, state: str, key: str):
|
|
388
|
+
"""One property of the user's pen for ``state``, or None."""
|
|
389
|
+
return (self._sim_pen_overrides.get(state) or {}).get(key)
|
|
390
|
+
|
|
355
391
|
def set_simulation_visible(self, visible: bool) -> None:
|
|
356
392
|
self._sim_visible = bool(visible)
|
|
357
393
|
self._render_simulation_overlays(self.current_frame)
|
|
@@ -507,7 +543,8 @@ class ViewerOverlaysMixin:
|
|
|
507
543
|
the spots, one dashed curve per ring (state-coloured)."""
|
|
508
544
|
items: list = []
|
|
509
545
|
polar = self._mode == MODE_POLAR
|
|
510
|
-
for state
|
|
546
|
+
for state in sim_state_colors():
|
|
547
|
+
color = self.sim_pen(state)["color"]
|
|
511
548
|
spots = [
|
|
512
549
|
r for r, s in zip(reflections, states)
|
|
513
550
|
if s == state and not r.is_ring
|
|
@@ -515,6 +552,17 @@ class ViewerOverlaysMixin:
|
|
|
515
552
|
if not spots:
|
|
516
553
|
continue
|
|
517
554
|
selected = state == "selected"
|
|
555
|
+
# Diamond outline: the built-in width and a solid line unless
|
|
556
|
+
# the user set them; the diamond SIZE stays intensity-coded.
|
|
557
|
+
spot_width = self._sim_override(state, "width")
|
|
558
|
+
if spot_width is None:
|
|
559
|
+
spot_width = 2.2 if selected else 1.5
|
|
560
|
+
spot_style = self._sim_override(state, "style")
|
|
561
|
+
spot_pen = (
|
|
562
|
+
pg.mkPen(QColor(color), width=spot_width)
|
|
563
|
+
if spot_style is None else
|
|
564
|
+
pg.mkPen(QColor(color), width=spot_width, style=spot_style)
|
|
565
|
+
)
|
|
518
566
|
if polar:
|
|
519
567
|
xs = np.array([r.radius for r in spots])
|
|
520
568
|
ys = np.array([r.angle for r in spots])
|
|
@@ -527,7 +575,7 @@ class ViewerOverlaysMixin:
|
|
|
527
575
|
_sim_marker_size(r.rel_intensity) + (2 if selected else 0)
|
|
528
576
|
for r in spots
|
|
529
577
|
],
|
|
530
|
-
pen=
|
|
578
|
+
pen=spot_pen,
|
|
531
579
|
brush=None,
|
|
532
580
|
data=[r.index for r in spots],
|
|
533
581
|
))
|
|
@@ -537,11 +585,16 @@ class ViewerOverlaysMixin:
|
|
|
537
585
|
if not r.is_ring:
|
|
538
586
|
continue
|
|
539
587
|
selected = state == "selected"
|
|
540
|
-
width
|
|
588
|
+
# Ring width encodes intensity; a width the user set replaces
|
|
589
|
+
# that coding (one width for every ring of the state).
|
|
590
|
+
width = self._sim_override(state, "width")
|
|
591
|
+
if width is None:
|
|
592
|
+
width = 1.0 + 1.5 * _sim_intensity_scale(r.rel_intensity)
|
|
593
|
+
width += 1.0 if selected else 0.0
|
|
594
|
+
ring_pen = self.sim_pen(state)
|
|
541
595
|
pen = pg.mkPen(
|
|
542
|
-
QColor(
|
|
543
|
-
|
|
544
|
-
style=Qt.PenStyle.DashLine,
|
|
596
|
+
QColor(ring_pen["color"]), width=width,
|
|
597
|
+
style=ring_pen["style"],
|
|
545
598
|
)
|
|
546
599
|
pen.setCosmetic(True)
|
|
547
600
|
if polar:
|
|
@@ -568,13 +621,12 @@ class ViewerOverlaysMixin:
|
|
|
568
621
|
rw, aw = simulation_pattern.default_box_size(tables.get("fitted"))
|
|
569
622
|
extent = self.angular_extent()
|
|
570
623
|
items: list = []
|
|
571
|
-
for state
|
|
624
|
+
for state in sim_state_colors():
|
|
572
625
|
rows = [
|
|
573
626
|
r for r, s in zip(reflections, states) if s == state
|
|
574
627
|
]
|
|
575
628
|
if not rows:
|
|
576
629
|
continue
|
|
577
|
-
selected = state == "selected"
|
|
578
630
|
table = PeakTable(
|
|
579
631
|
q_xy=np.array([r.q_xy for r in rows]),
|
|
580
632
|
q_z=np.array([r.q_z for r in rows]),
|
|
@@ -591,11 +643,7 @@ class ViewerOverlaysMixin:
|
|
|
591
643
|
score=np.zeros(len(rows)),
|
|
592
644
|
amplitude=np.zeros(len(rows)),
|
|
593
645
|
)
|
|
594
|
-
box = _PeakShapeItem(
|
|
595
|
-
color=color,
|
|
596
|
-
style=Qt.PenStyle.DashLine,
|
|
597
|
-
width=2.2 if selected else 1.4,
|
|
598
|
-
)
|
|
646
|
+
box = _PeakShapeItem(**self.sim_pen(state))
|
|
599
647
|
if self._mode == MODE_POLAR:
|
|
600
648
|
box.set_polar(table, extent=extent)
|
|
601
649
|
else:
|
|
@@ -49,7 +49,6 @@ from mlgidgui.conversion_panel import ConversionPanel
|
|
|
49
49
|
from mlgidgui.image_viewer import (
|
|
50
50
|
GIWAXSImageViewer,
|
|
51
51
|
OVERLAY_STYLE,
|
|
52
|
-
SIM_MISSED_COLOR,
|
|
53
52
|
)
|
|
54
53
|
from mlgidgui.main_window_constants import (
|
|
55
54
|
APP_NAME,
|
|
@@ -113,6 +112,7 @@ class BuildMixin:
|
|
|
113
112
|
self.data_viewer = DataViewerFrame(self)
|
|
114
113
|
self.structure_panel = StructurePanel(self)
|
|
115
114
|
self.structure_panel.recheckRequested.connect(self._on_structure_recheck)
|
|
115
|
+
self.structure_panel.refreshRequested.connect(self._on_structure_refresh)
|
|
116
116
|
self.structure_panel.attributeEdited.connect(
|
|
117
117
|
self._on_structure_attribute_edited)
|
|
118
118
|
self.structure_panel.attributeRenamed.connect(
|
|
@@ -679,13 +679,6 @@ class BuildMixin:
|
|
|
679
679
|
sim_master_row = QHBoxLayout()
|
|
680
680
|
sim_master_row.setContentsMargins(0, 0, 0, 0)
|
|
681
681
|
sim_master_row.setSpacing(6)
|
|
682
|
-
sim_swatch = QLabel()
|
|
683
|
-
sim_swatch.setPixmap(_make_pen_swatch({
|
|
684
|
-
"color": SIM_MISSED_COLOR,
|
|
685
|
-
"style": Qt.PenStyle.DashLine,
|
|
686
|
-
"width": 1.5,
|
|
687
|
-
}))
|
|
688
|
-
sim_master_row.addWidget(sim_swatch)
|
|
689
682
|
self._sim_master_check = QCheckBox("Show expected pattern")
|
|
690
683
|
self._sim_master_check.setChecked(False)
|
|
691
684
|
self._sim_master_check.setToolTip(
|
|
@@ -701,6 +694,45 @@ class BuildMixin:
|
|
|
701
694
|
sim_master_widget.setLayout(sim_master_row)
|
|
702
695
|
sim_box.addWidget(sim_master_widget)
|
|
703
696
|
|
|
697
|
+
# The state swatches double as the legend (orange / green /
|
|
698
|
+
# white were never explained anywhere) and as the way in to the
|
|
699
|
+
# pen editor, like the Detected / Fitted swatches: colour, line
|
|
700
|
+
# style and width of each kind of reflection box.
|
|
701
|
+
sim_pen_row = QHBoxLayout()
|
|
702
|
+
sim_pen_row.setContentsMargins(20, 0, 0, 0)
|
|
703
|
+
sim_pen_row.setSpacing(6)
|
|
704
|
+
self._sim_pen_swatches: dict[str, QToolButton] = {}
|
|
705
|
+
for state, label, tip in (
|
|
706
|
+
("missed", "missed",
|
|
707
|
+
"reflections no matched peak explains yet"),
|
|
708
|
+
("explained", "explained",
|
|
709
|
+
"reflections explained by a matched box of this structure"),
|
|
710
|
+
("selected", "selected",
|
|
711
|
+
"reflections selected for adding"),
|
|
712
|
+
):
|
|
713
|
+
swatch = QToolButton()
|
|
714
|
+
swatch.setAutoRaise(True)
|
|
715
|
+
swatch.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
716
|
+
swatch.setToolButtonStyle(
|
|
717
|
+
Qt.ToolButtonStyle.ToolButtonTextBesideIcon
|
|
718
|
+
)
|
|
719
|
+
swatch.setText(label)
|
|
720
|
+
swatch.setToolTip(
|
|
721
|
+
f"Expected-pattern boxes: {tip}. Click to set their "
|
|
722
|
+
f"colour, line style and width."
|
|
723
|
+
)
|
|
724
|
+
swatch.clicked.connect(
|
|
725
|
+
lambda _=False, s=state: self._open_sim_pen_popup(s)
|
|
726
|
+
)
|
|
727
|
+
self._sim_pen_swatches[state] = swatch
|
|
728
|
+
self._refresh_sim_swatch(state)
|
|
729
|
+
sim_pen_row.addWidget(swatch)
|
|
730
|
+
sim_pen_row.addStretch(1)
|
|
731
|
+
sim_pen_widget = QWidget()
|
|
732
|
+
sim_pen_widget.setLayout(sim_pen_row)
|
|
733
|
+
sim_box.addWidget(sim_pen_widget)
|
|
734
|
+
self.viewer.simPenChanged.connect(self._refresh_sim_swatch)
|
|
735
|
+
|
|
704
736
|
sim_cif_row = QHBoxLayout()
|
|
705
737
|
sim_cif_row.setContentsMargins(20, 0, 0, 0)
|
|
706
738
|
sim_cif_row.setSpacing(6)
|
|
@@ -1461,6 +1493,36 @@ class BuildMixin:
|
|
|
1461
1493
|
)
|
|
1462
1494
|
popup.show_under(swatch)
|
|
1463
1495
|
|
|
1496
|
+
def _refresh_sim_swatch(self, state: str) -> None:
|
|
1497
|
+
"""Redraw one Expected-pattern state swatch from the pen in
|
|
1498
|
+
effect (driven by the viewer's ``simPenChanged``, so it also
|
|
1499
|
+
follows "Automatic")."""
|
|
1500
|
+
swatch = self._sim_pen_swatches.get(state)
|
|
1501
|
+
if swatch is None:
|
|
1502
|
+
return
|
|
1503
|
+
pix = _make_pen_swatch(self.viewer.sim_pen(state))
|
|
1504
|
+
swatch.setIcon(QIcon(pix))
|
|
1505
|
+
swatch.setIconSize(pix.size())
|
|
1506
|
+
|
|
1507
|
+
def _open_sim_pen_popup(self, state: str) -> None:
|
|
1508
|
+
"""Pen editor under an Expected-pattern state swatch."""
|
|
1509
|
+
swatch = self._sim_pen_swatches.get(state)
|
|
1510
|
+
if swatch is None:
|
|
1511
|
+
return
|
|
1512
|
+
popup = PenPopup(
|
|
1513
|
+
self,
|
|
1514
|
+
current=self.viewer.sim_pen(state),
|
|
1515
|
+
override=self.viewer.sim_pen_override(state),
|
|
1516
|
+
title=f"Expected pattern, {state} reflections",
|
|
1517
|
+
)
|
|
1518
|
+
popup.penChanged.connect(
|
|
1519
|
+
lambda pen, s=state: self.viewer.set_sim_pen(s, pen)
|
|
1520
|
+
)
|
|
1521
|
+
popup.resetPicked.connect(
|
|
1522
|
+
lambda s=state: self.viewer.set_sim_pen(s, None)
|
|
1523
|
+
)
|
|
1524
|
+
popup.show_under(swatch)
|
|
1525
|
+
|
|
1464
1526
|
def _hide_stale_dock_tab_bars(self) -> None:
|
|
1465
1527
|
"""Hide ghost dock tab bars.
|
|
1466
1528
|
|