Skip to content

Ignore metadata comments in experimental data parsing and improve header dialog sizing#6

Merged
KWWyatt merged 2 commits into
fix-experimental-data-dialog-crashfrom
codex/fix-crash-in-experimentaldataheaderdialog-x89ihv
May 14, 2026
Merged

Ignore metadata comments in experimental data parsing and improve header dialog sizing#6
KWWyatt merged 2 commits into
fix-experimental-data-dialog-crashfrom
codex/fix-crash-in-experimentaldataheaderdialog-x89ihv

Conversation

@KWWyatt
Copy link
Copy Markdown
Owner

@KWWyatt KWWyatt commented May 14, 2026

Motivation

  • Experimental data files may include comment lines with metadata or prefixed inline comments that should not be interpreted as column labels, and the header-selection dialog needs to behave well on varied screen sizes and long file paths.

Description

  • Updated experimental data parsing to detect and ignore comment/metadata lines and to strip comment prefixes before tokenizing by adding _strip_comment_prefix, _is_comment_metadata_line, and _tokens_look_like_column_labels, and by updating _guess_experimental_header_rows, _read_experimental_column_names, and _first_data_tokens to use these helpers.
  • Improved robustness of column-name detection by checking whether tokens look like numeric data or plausible column labels before treating a line as a header.
  • Enhanced the ExperimentalDataHeaderDialog UI to size itself relative to the primary screen, set sensible minimums and maximums, enable word-wrapping for long file paths, change preview wrapping and minimum height, and configure column QComboBox sizing via a helper _configure_column_combo.
  • Updated imports and tests to cover the new behavior and UI changes.

Testing

  • Added test_experimental_data_metadata_comments_are_not_used_as_columns, test_experimental_data_ignores_metadata_prefix_before_inline_header, and test_experimental_data_header_dialog_geometry_is_screen_bounded to tests/test_saxs_ui.py and ran them with pytest; they passed.
  • Ran the updated tests/test_saxs_ui.py file via pytest tests/test_saxs_ui.py and the suite completed successfully.

Codex Task

When a commented line includes metadata and a trailing inline header fragment, extract the header-like segment instead of tokenizing metadata words as column labels. Add regression coverage for '# ... factor: 1.0 # q_(Å⁻¹) I(q)' style inputs.
@KWWyatt KWWyatt merged commit 6da0e0d into fix-experimental-data-dialog-crash May 14, 2026
@KWWyatt KWWyatt deleted the codex/fix-crash-in-experimentaldataheaderdialog-x89ihv branch May 14, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant