Skip to content

Improve experimental data header/column parsing and make header dialog UI responsive#5

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

Improve experimental data header/column parsing and make header dialog UI responsive#5
KWWyatt merged 2 commits into
fix-experimental-data-dialog-crashfrom
codex/fix-crash-in-experimentaldataheaderdialog-snudgo

Conversation

@KWWyatt
Copy link
Copy Markdown
Owner

@KWWyatt KWWyatt commented May 14, 2026

Motivation

  • Improve robustness when loading experimental data files by ignoring metadata/comment lines and more reliably detecting header rows and column labels.
  • Make the experimental-data header dialog more usable on different screen sizes and for long file paths by adding wrapping and responsive sizing.

Description

  • Enhance parsing logic in project.py by adding _strip_comment_prefix, _is_comment_metadata_line, and _tokens_look_like_column_labels helpers and updating _guess_experimental_header_rows, _read_experimental_column_names, and _first_data_tokens to skip or interpret comment/metadata lines correctly.
  • Refine token classification so comment lines with metadata (e.g. # Background: ...) are not mistaken for column header lines and column label detection is improved (keywords matching and normalization).
  • Update experimental_data_loader.py UI: use QApplication.primaryScreen() to bound dialog size, set better defaults for resize and maximum size, enable word wrap for file and status labels, change preview wrapping and minimum height, and add _configure_column_combo to improve QComboBox sizing behavior.
  • Update test imports and add tests to cover the new behavior: test_experimental_data_header_dialog_geometry_is_screen_bounded and test_experimental_data_metadata_comments_are_not_used_as_columns.

Testing

  • Ran test suite (pytest) including new UI and parser tests; test_experimental_data_header_dialog_geometry_is_screen_bounded passed.
  • Ran test_experimental_data_metadata_comments_are_not_used_as_columns which verifies header detection and load_experimental_data_file behavior and passed.
  • Existing experimental-data header selection tests (e.g. test_experimental_data_header_dialog_allows_manual_column_selection) were executed and remained green.

Codex Task

Constrain header dialog child size hints so long labels and combo entries do not inflate minimum tracking size on Windows. Improve experimental header/column detection to ignore metadata comment lines while still accepting commented real headers like '# q I(q)'. Add regression coverage for metadata comment parsing and dialog size policies.
@KWWyatt KWWyatt merged commit 81e4dca into fix-experimental-data-dialog-crash May 14, 2026
@KWWyatt KWWyatt deleted the codex/fix-crash-in-experimentaldataheaderdialog-snudgo 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