-
Notifications
You must be signed in to change notification settings - Fork 21
Fix more type issues #3695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix more type issues #3695
Conversation
|
The build is currently broken because of scipp/plopp#448. I.e., because I had to re-lock dependencies to add the pandas stubs. |
There was a problem hiding this comment.
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 addresses typing inconsistencies and updates dependency tooling metadata.
- Replace concrete
dicthints with more generalMappingin core binning APIs - Add overload signatures for xarray and pandas compatibility functions
- Annotate benchmark methods with return types and bump dependency versions across requirements
Reviewed Changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/scipp/core/data_group.py | Change arg_dict type hint from dict to Mapping |
| src/scipp/core/cpp_classes.pyi | Update arg_dict types in bin overloads to Mapping |
| src/scipp/core/binning.py | Import Mapping and adjust standalone bin helpers |
| src/scipp/compat/xarray_compat.py | Add @overload definitions for from_xarray/to_xarray |
| src/scipp/compat/pandas_compat.py | Add overloads and refine types for from_pandas |
| requirements/*.txt | Bump pinned versions and update header instructions |
| pyproject.toml | Reorder and comment on excluded paths for typing |
| benchmarks/*.py | Add -> None return annotations to timing methods |
Comments suppressed due to low confidence (1)
src/scipp/core/data_group.py:337
- The name
Mappingis not imported in this module; addfrom collections.abc import Mapping(or importMappingfromtyping) so the type hint resolves correctly.
arg_dict: Mapping[str, int | Variable] | None = None,
Previously, we were missing stubs for pandas, so all types became `Any`.
I needed this comment when checking the tests. Maybe it will become necessary again once we check tests in CI
While working on typing of the tests, I found more issues with the actual package. There may be many more