Skip to content

refactor: add type hinting to data processors - #331

Open
leahaeusel wants to merge 8 commits into
queens-py:mainfrom
leahaeusel:add-type-hinting-to-data-processors
Open

refactor: add type hinting to data processors#331
leahaeusel wants to merge 8 commits into
queens-py:mainfrom
leahaeusel:add-type-hinting-to-data-processors

Conversation

@leahaeusel

Copy link
Copy Markdown
Member

Description and Context:
What and Why?

This PR adds type hinting to the data processors.

Related Issues and Pull Requests

  • Closes
  • Related to

Interested Parties

Note: More information on the merge request procedure in QUEENS can be found in the Submit a pull request section in the CONTRIBUTING.md file.

Copilot AI lite review requested due to automatic review settings August 12, 2026 13:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the queens.data_processors package to add/strengthen type hints across multiple concrete DataProcessor implementations, and updates tooling configuration so these modules are included in static type checking.

Changes:

  • Added/updated type annotations and docstrings for DataProcessor and several file-based processors (CSV/NumPy/PVD/TXT).
  • Improved a small piece of TXT parsing robustness (avoid failure when the logger prefix regex doesn’t match a line).
  • Updated mypy/pre-commit exclude patterns to stop excluding src/queens/data_processors from checks.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/queens/data_processors/txt_file.py Adds type hints and makes logger-prefix stripping resilient to non-matching lines.
src/queens/data_processors/pvd_file.py Adds type hints for PVD reading/filtering and Path-like parameters.
src/queens/data_processors/numpy_file.py Adds type hints for NumPy loading and Path-like parameters.
src/queens/data_processors/csv_file.py Adds type hints and refactors filtering variable names; introduces stricter filter config typing.
src/queens/data_processors/_data_processor.py Adds type hints to the abstract base processor and helper methods.
src/queens/data_processors/init.py Adds typing improvements to lazy-import __getattr__ and postpones annotation evaluation.
pyproject.toml Adjusts mypy exclude list to include data_processors in type checking.
.pre-commit-config.yaml Keeps pre-commit’s mypy exclude list consistent with pyproject (include data_processors).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/queens/data_processors/csv_file.py Outdated
Comment thread src/queens/data_processors/csv_file.py Outdated
Comment thread src/queens/data_processors/csv_file.py
Comment thread src/queens/data_processors/csv_file.py Outdated
Comment thread src/queens/data_processors/_data_processor.py Outdated
Comment thread src/queens/data_processors/csv_file.py Outdated
Comment thread src/queens/data_processors/numpy_file.py Outdated
Comment thread src/queens/data_processors/pvd_file.py Outdated
Comment thread src/queens/data_processors/txt_file.py Outdated
@rjoussen

Copy link
Copy Markdown
Contributor

Nice, type hinting makes coding so much nicer! I can look at it tomorrow probably. In the meantime, I think we have to be careful here with the merge order of #323: either you or me need to incorporate the changes the other PR made.

@leahaeusel

Copy link
Copy Markdown
Member Author

In the meantime, I think we have to be careful here with the merge order of #323: either you or me need to incorporate the changes the other PR made.

Very good point! I think we should merge #323 first, so it doesn't become even bigger. @queens-py/developers, could anyone take another look at #323 and review it?

Comment thread src/queens/data_processors/_data_processor.py
Comment thread src/queens/data_processors/_data_processor.py Outdated
Comment thread src/queens/data_processors/csv_file.py
Comment thread src/queens/data_processors/csv_file.py
Comment thread src/queens/data_processors/csv_file.py
Comment thread src/queens/data_processors/pvd_file.py Outdated

@leahaeusel leahaeusel left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for reviewing this extensive PR! I will also add the missing override decorators shortly.

Comment thread src/queens/data_processors/_data_processor.py
Comment thread src/queens/data_processors/csv_file.py
Comment thread src/queens/data_processors/csv_file.py
Comment thread src/queens/data_processors/pvd_file.py Outdated
@leahaeusel
leahaeusel force-pushed the add-type-hinting-to-data-processors branch from 0b4f49b to c5ec27b Compare August 17, 2026 12:07
@leahaeusel leahaeusel added type: usability Issue/PR to improve usability topic: data processor Issue/PR related to the data processors labels Aug 18, 2026
@leahaeusel
leahaeusel requested a review from rjoussen August 21, 2026 09:12
@leahaeusel
leahaeusel force-pushed the add-type-hinting-to-data-processors branch from ff53dca to 7d2f151 Compare August 21, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: data processor Issue/PR related to the data processors type: usability Issue/PR to improve usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants