Skip to content

feat(typing): Improve type hints for varwrap - #1114

Merged
FabianHofmann merged 10 commits into
masterfrom
feature/varwrap-typing
Nov 2, 2026
Merged

FabianHofmann merged 10 commits into
masterfrom
feature/varwrap-typing

Conversation

@FabianHofmann

Copy link
Copy Markdown
Collaborator

Supersedes and closes #1029 by @RobbieKiwi, whose commits are kept unchanged on this branch. The original PR's fork branch could not be updated from here.

Note

The following content was generated by AI.

Changes proposed in this Pull Request

Same code change as #1029: varwrap is typed with a ParamSpec, so the Variable methods that wrap an xarray.Dataset method (sel, isel, shift, rename, stack, ...) carry the wrapped method's parameters and return Variable for type checkers and IDEs, instead of an untyped Callable. See #1029 for the before/after screenshots and the notes on Pylance and ty.

On top of #1029:

  • Merged current master.
  • Release notes: moved the entry from the already-released 0.10.1 section to Features in the upcoming 1.0.0 section, and reworded it to say which methods are affected and what changes for users.

Closes #1029

Checklist

  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

Generated by Claude Code

@codspeed

codspeed Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 note

ℹ️ 181 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

✅ 181 untouched benchmarks
⏩ 181 skipped benchmarks1


Comparing feature/varwrap-typing (71026e4) with master (0943171)

Open in CodSpeed

Footnotes

  1. 181 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@FabianHofmann
FabianHofmann merged commit 70fcfe5 into master Nov 2, 2026
23 checks passed
@FabianHofmann
FabianHofmann deleted the feature/varwrap-typing branch November 2, 2026 12:52
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.

2 participants