Skip to content

feat: Improvements psychometric tests#78

Draft
cbueth wants to merge 13 commits intomainfrom
feat/improvements-psychometric-tests
Draft

feat: Improvements psychometric tests#78
cbueth wants to merge 13 commits intomainfrom
feat/improvements-psychometric-tests

Conversation

@cbueth
Copy link
Copy Markdown
Collaborator

@cbueth cbueth commented Apr 27, 2026

This PR includes various usability improvements for the calculation of the psychometric tests, ut also some new features:

  • Specified error messages
    • Troubleshooting page entry for these.
  • Add Sid class for holding and verifying session IDs.
  • Improve robustness of differeing sids across folder names and participant configs, which need to be matched. THis should also be used across the package.
  • Add a merged overview of the psychometric tests.

cbueth added 13 commits April 21, 2026 13:03
- Add search for zip files in parent directories when `config_folder` is missing.
- Improve error messages with suggestions for data recovery.

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Implement `is_valid_pid` and `is_valid_sid` functions in `data_path_utils`.
- Add unit tests for PID and SID validation in a new test module.

Signed-off-by: Carlson Büth <commit@cbueth.de>
…restructuring

- Implement `validate_psychometric_data` to check participant configurations and data folder consistency.
- Update restructuring script to use the new validation utility, ensuring data integrity.
- Add support for psychometric test mapping in config (`PSYCHOMETRIC_TEST_MAPPING`).
- Enhance logging with structured warnings and instructions for errors in psychometric tests.
- Extend `__init__.py` to expose the new utility `validate_psychometric_data`.
- Improve CLI with new options for sanity checks (`--check-only`, `--restructured`).

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Implement `parse_sid` in `data_path_utils` to parse and validate standard and extended SID formats.
- Update `is_valid_sid` to use `parse_sid` for improved validation logic.
- Add unit tests for `parse_sid`, including valid and invalid cases.
- Extend `__init__.py` to expose the new `parse_sid` utility.

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Document potential warnings in psychometric test calculations.
- Provide troubleshooting steps for data integrity, experimenter documentation, and configuration updates.

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Add comprehensive tests for various scenarios, including missing data, unexpected data, session normalization, and SID compliance.
- Ensure robust validation of configuration and data folder structure.

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Add detailed docstrings and parameter validation for psychometric test preprocessing functions, improving maintainability and clarity.
- Extend preprocessing logic to include `session_id`, detailed notes, and session parts in generated outputs.
- Refactor existing test-specific preprocessing functions (Stroop, Flanker, WikiVocab, PLAB, etc.) for stricter input validation and improved error handling.
- Add unit tests for restructuring and normalization of psychometric test sessions, including edge cases for missing/unexpected data and SID compliance.

Signed-off-by: Carlson Büth <commit@cbueth.de>
…dling

- Introduce `Sid` dataclass in `preprocessing.models` to replace the `parse_sid` utility.
- Update `preprocess_psychometric_tests` and `validate_psychometric_data` to use `Sid` for parsing and validation.
- Add extensive unit tests for `Sid` class, covering initialisation, validation, and equivalence.
- Remove legacy `is_valid_sid` and `parse_sid` functions from `data_path_utils`.
- Refactor preprocessing logic to improve SID-related error handling and validation consistency.

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Replace custom session name parsing with `Sid` for consistency and robustness across preprocessing scripts.
- Refactor psychometric test matching to use `Sid.equals_soft` for flexible folder identification.
- Improve error handling for invalid or non-standard session identifiers.
- Update unit tests to reflect changes and remove `parse_sid` remnants.

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Replace `pid_from_session` utility with `Sid` class throughout preprocessing scripts for consistent SID handling.
- Remove `is_valid_pid` function, consolidating validation logic within `Sid`.
- Update all unit tests to ensure compatibility with the new `Sid` implementation.
- Simplify utils module by removing redundant functions and their references.
- Enhance error handling and validation for non-standard session identifiers.

Signed-off-by: Carlson Büth <commit@cbueth.de>
- Implement `create_merged_psychometric_overview` to merge disjoint psychometric test sessions into a single overview.
- Add logic to handle overlapping test results with warnings and separate entries.
- Extend preprocessing pipeline to create merged psychometric overviews automatically.
- Add comprehensive unit tests covering disjoint sessions, overlapping sessions, and independent merging scenarios.

Signed-off-by: Carlson Büth <commit@cbueth.de>
Signed-off-by: Carlson Büth <commit@cbueth.de>
Signed-off-by: Carlson Büth <commit@cbueth.de>
@cbueth cbueth requested a review from theDebbister April 27, 2026 12:27
@cbueth cbueth self-assigned this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant